mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-07-02 11:24:56 +00:00
CStringEditor: Make use of Qt 5 signals and slots
This commit is contained in:
parent
8df5ec051d
commit
df8b0543ba
@ -115,19 +115,19 @@ void CStringEditor::InitUI()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Connect signals & slots
|
// Connect signals & slots
|
||||||
connect( mpUI->StringNameListView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
|
connect(mpUI->StringNameListView->selectionModel(), &QItemSelectionModel::currentChanged,
|
||||||
this, SLOT(OnStringSelected(QModelIndex)) );
|
this, &CStringEditor::OnStringSelected);
|
||||||
|
|
||||||
connect( mpUI->StringNameLineEdit, SIGNAL(textChanged(QString)), this, SLOT(OnStringNameEdited()) );
|
connect(mpUI->StringNameLineEdit, &QLineEdit::textChanged, this, &CStringEditor::OnStringNameEdited);
|
||||||
connect( mpUI->StringTextEdit, SIGNAL(textChanged()), this, SLOT(OnStringTextEdited()) );
|
connect(mpUI->StringTextEdit, &QPlainTextEdit::textChanged, this, &CStringEditor::OnStringTextEdited);
|
||||||
connect( mpUI->EditLanguageTabBar, SIGNAL(currentChanged(int)), this, SLOT(OnLanguageChanged(int)) );
|
connect(mpUI->EditLanguageTabBar, &QTabBar::currentChanged, this, &CStringEditor::OnLanguageChanged);
|
||||||
connect( mpUI->AddStringButton, SIGNAL(pressed()), this, SLOT(OnAddString()) );
|
connect(mpUI->AddStringButton, &QPushButton::pressed, this, &CStringEditor::OnAddString);
|
||||||
connect( mpUI->RemoveStringButton, SIGNAL(pressed()), this, SLOT(OnRemoveString()) );
|
connect(mpUI->RemoveStringButton, &QPushButton::pressed, this, &CStringEditor::OnRemoveString);
|
||||||
|
|
||||||
connect( mpUI->ActionSave, SIGNAL(triggered(bool)), this, SLOT(Save()) );
|
connect(mpUI->ActionSave, &QAction::triggered, this, &CStringEditor::Save);
|
||||||
connect( mpUI->ActionSaveAndCook, SIGNAL(triggered(bool)), this, SLOT(SaveAndRepack()) );
|
connect(mpUI->ActionSaveAndCook, &QAction::triggered, this, &CStringEditor::SaveAndRepack);
|
||||||
|
|
||||||
connect( &UndoStack(), SIGNAL(indexChanged(int)), this, SLOT(UpdateUI()) );
|
connect(&UndoStack(), &QUndoStack::indexChanged, this, &CStringEditor::UpdateUI);
|
||||||
|
|
||||||
mpUI->ToolBar->addSeparator();
|
mpUI->ToolBar->addSeparator();
|
||||||
AddUndoActions(mpUI->ToolBar);
|
AddUndoActions(mpUI->ToolBar);
|
||||||
@ -327,7 +327,7 @@ void CStringEditor::OnStringTextEdited()
|
|||||||
|
|
||||||
void CStringEditor::OnAddString()
|
void CStringEditor::OnAddString()
|
||||||
{
|
{
|
||||||
UndoStack().beginMacro("Add String");
|
UndoStack().beginMacro(tr("Add String"));
|
||||||
|
|
||||||
// Add string
|
// Add string
|
||||||
IUndoCommand* pCommand = new TSerializeUndoCommand<CStringTable>(tr("Add String"), mpStringTable, true);
|
IUndoCommand* pCommand = new TSerializeUndoCommand<CStringTable>(tr("Add String"), mpStringTable, true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user