forked from qt-creator/qt-creator
Replace static_casts by QOverload where possible
Mainly to get rid of the QProcess::finished deprecation warning. Also adjust coding style in the surrounding connects when needed. Change-Id: I12f9b248c7974b892c4a069356e578e80f8c59e9 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -284,7 +284,7 @@ QueryContext::QueryContext(const QString &query,
|
||||
connect(&m_process, &QProcess::readyReadStandardOutput, this, [this] {
|
||||
m_output.append(m_process.readAllStandardOutput());
|
||||
});
|
||||
connect(&m_process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
|
||||
connect(&m_process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
||||
this, &QueryContext::processFinished);
|
||||
connect(&m_process, &QProcess::errorOccurred, this, &QueryContext::processError);
|
||||
connect(&m_watcher, &QFutureWatcherBase::canceled, this, &QueryContext::terminate);
|
||||
@@ -376,7 +376,7 @@ void QueryContext::timeout()
|
||||
arg(timeOutMS / 1000), QMessageBox::NoButton, parent);
|
||||
QPushButton *terminateButton = box.addButton(tr("Terminate"), QMessageBox::YesRole);
|
||||
box.addButton(tr("Keep Running"), QMessageBox::NoRole);
|
||||
connect(&m_process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
|
||||
connect(&m_process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
||||
&box, &QDialog::reject);
|
||||
box.exec();
|
||||
if (m_process.state() != QProcess::Running)
|
||||
|
||||
@@ -140,7 +140,7 @@ FetchContext::FetchContext(const QSharedPointer<GerritChange> &change,
|
||||
, m_state(FetchState)
|
||||
{
|
||||
connect(&m_process, &QProcess::errorOccurred, this, &FetchContext::processError);
|
||||
connect(&m_process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
|
||||
connect(&m_process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
||||
this, &FetchContext::processFinished);
|
||||
connect(&m_process, &QProcess::readyReadStandardError,
|
||||
this, &FetchContext::processReadyReadStandardError);
|
||||
|
||||
@@ -146,10 +146,10 @@ GerritPushDialog::GerritPushDialog(const QString &workingDir, const QString &rev
|
||||
}
|
||||
|
||||
m_ui->localBranchComboBox->init(workingDir);
|
||||
connect(m_ui->localBranchComboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
connect(m_ui->localBranchComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
this, &GerritPushDialog::updateCommits);
|
||||
|
||||
connect(m_ui->targetBranchComboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
connect(m_ui->targetBranchComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
this, &GerritPushDialog::setChangeRange);
|
||||
|
||||
connect(m_ui->targetBranchComboBox, &QComboBox::currentTextChanged,
|
||||
|
||||
Reference in New Issue
Block a user