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->setVisible(true);
connect (ui.gameFileView, SIGNAL (currentIndexChanged(int)),
this, SLOT (slotCurrentGameFileIndexChanged(int)));
connect (ui.gameFileView, qOverload<int>(&ComboBox::currentIndexChanged),
this, &ContentSelector::slotCurrentGameFileIndexChanged);
ui.gameFileView->setCurrentIndex(0);
}
@ -63,20 +63,21 @@ void ContentSelectorView::ContentSelector::buildAddonView()
mAddonProxyModel->setDynamicSortFilter (true);
mAddonProxyModel->setSourceModel (mContentModel);
connect(ui.searchFilter, SIGNAL(textEdited(QString)), mAddonProxyModel, SLOT(setFilterWildcard(QString)));
connect(ui.searchFilter, SIGNAL(textEdited(QString)), this, SLOT(slotSearchFilterTextChanged(QString)));
connect(ui.searchFilter, &QLineEdit::textEdited, mAddonProxyModel, &QSortFilterProxyModel::setFilterWildcard);
connect(ui.searchFilter, &QLineEdit::textEdited, this, &ContentSelector::slotSearchFilterTextChanged);
ui.addonView->setModel(mAddonProxyModel);
connect(ui.addonView, SIGNAL(activated(const QModelIndex&)), this, SLOT(slotAddonTableItemActivated(const QModelIndex&)));
connect(mContentModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), this, SIGNAL(signalAddonDataChanged(QModelIndex,QModelIndex)));
connect(ui.addonView, &QTableView::activated, this, &ContentSelector::slotAddonTableItemActivated);
connect(mContentModel, &ContentSelectorModel::ContentModel::dataChanged,
this, &ContentSelector::signalAddonDataChanged);
buildContextMenu();
}
void ContentSelectorView::ContentSelector::buildContextMenu()
{
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->addAction(tr("&Check Selected"), this, SLOT(slotCheckMultiSelectedItems()));

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

Loading…
Cancel
Save