functor-based Qt signal-slot syntax components

crashfix_debugdraw
mpeco 2 years ago
parent aa57d04b54
commit 1868534071

@ -29,8 +29,8 @@ void ContentSelectorView::ContentSelector::buildGameFileView()
ui.gameFileView->addItem("<No game file>"); ui.gameFileView->addItem("<No game file>");
ui.gameFileView->setVisible(true); ui.gameFileView->setVisible(true);
connect (ui.gameFileView, SIGNAL (currentIndexChanged(int)), connect (ui.gameFileView, qOverload<int>(&ComboBox::currentIndexChanged),
this, SLOT (slotCurrentGameFileIndexChanged(int))); this, &ContentSelector::slotCurrentGameFileIndexChanged);
ui.gameFileView->setCurrentIndex(0); ui.gameFileView->setCurrentIndex(0);
} }
@ -63,20 +63,21 @@ void ContentSelectorView::ContentSelector::buildAddonView()
mAddonProxyModel->setDynamicSortFilter (true); mAddonProxyModel->setDynamicSortFilter (true);
mAddonProxyModel->setSourceModel (mContentModel); mAddonProxyModel->setSourceModel (mContentModel);
connect(ui.searchFilter, SIGNAL(textEdited(QString)), mAddonProxyModel, SLOT(setFilterWildcard(QString))); connect(ui.searchFilter, &QLineEdit::textEdited, mAddonProxyModel, &QSortFilterProxyModel::setFilterWildcard);
connect(ui.searchFilter, SIGNAL(textEdited(QString)), this, SLOT(slotSearchFilterTextChanged(QString))); connect(ui.searchFilter, &QLineEdit::textEdited, this, &ContentSelector::slotSearchFilterTextChanged);
ui.addonView->setModel(mAddonProxyModel); ui.addonView->setModel(mAddonProxyModel);
connect(ui.addonView, SIGNAL(activated(const QModelIndex&)), this, SLOT(slotAddonTableItemActivated(const QModelIndex&))); connect(ui.addonView, &QTableView::activated, this, &ContentSelector::slotAddonTableItemActivated);
connect(mContentModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), this, SIGNAL(signalAddonDataChanged(QModelIndex,QModelIndex))); connect(mContentModel, &ContentSelectorModel::ContentModel::dataChanged,
this, &ContentSelector::signalAddonDataChanged);
buildContextMenu(); buildContextMenu();
} }
void ContentSelectorView::ContentSelector::buildContextMenu() void ContentSelectorView::ContentSelector::buildContextMenu()
{ {
ui.addonView->setContextMenuPolicy(Qt::CustomContextMenu); ui.addonView->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui.addonView, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(slotShowContextMenu(const QPoint&))); connect(ui.addonView, &QTableView::customContextMenuRequested, this, &ContentSelector::slotShowContextMenu);
mContextMenu = new QMenu(ui.addonView); mContextMenu = new QMenu(ui.addonView);
mContextMenu->addAction(tr("&Check Selected"), this, SLOT(slotCheckMultiSelectedItems())); mContextMenu->addAction(tr("&Check Selected"), this, SLOT(slotCheckMultiSelectedItems()));

@ -14,11 +14,11 @@ Process::ProcessInvoker::ProcessInvoker(QObject* parent)
{ {
mProcess = new QProcess(this); mProcess = new QProcess(this);
connect(mProcess, SIGNAL(error(QProcess::ProcessError)), connect(mProcess, &QProcess::errorOccurred,
this, SLOT(processError(QProcess::ProcessError))); this, &ProcessInvoker::processError);
connect(mProcess, SIGNAL(finished(int,QProcess::ExitStatus)), connect(mProcess, qOverload<int,QProcess::ExitStatus>(&QProcess::finished),
this, SLOT(processFinished(int,QProcess::ExitStatus))); this, &ProcessInvoker::processFinished);
mName = QString(); mName = QString();

Loading…
Cancel
Save