forked from qt-creator/qt-creator
connect() to ambiguous signals/slots: Replace static_cast with QOverload
Change-Id: I473d7a2a16509cee944a2a21b022a3f6f02cfd8d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -31,7 +31,7 @@ MyMain::MyMain(QWidget *parent, Qt::WFlags flags)
|
|||||||
: QWidget(parent, flags)
|
: QWidget(parent, flags)
|
||||||
{
|
{
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
connect(ui.comboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
connect(ui.comboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||||
this, &MyMain::select);
|
this, &MyMain::select);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -145,8 +145,7 @@ void DumpSender::sendDumpAndQuit()
|
|||||||
|
|
||||||
connect(reply, &QNetworkReply::uploadProgress, this, &DumpSender::uploadProgress);
|
connect(reply, &QNetworkReply::uploadProgress, this, &DumpSender::uploadProgress);
|
||||||
connect(reply, &QNetworkReply::finished, QCoreApplication::instance(), &QCoreApplication::quit);
|
connect(reply, &QNetworkReply::finished, QCoreApplication::instance(), &QCoreApplication::quit);
|
||||||
connect(reply,
|
connect(reply, QOverload<QNetworkReply::NetworkError>::of(&QNetworkReply::error),
|
||||||
static_cast<void (QNetworkReply::*)(QNetworkReply::NetworkError)>(&QNetworkReply::error),
|
|
||||||
QCoreApplication::instance(), &QCoreApplication::quit);
|
QCoreApplication::instance(), &QCoreApplication::quit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -235,7 +235,7 @@ void SavedAction::connectWidget(QWidget *widget, ApplyMode applyMode)
|
|||||||
} else if (auto spinBox = qobject_cast<QSpinBox *>(widget)) {
|
} else if (auto spinBox = qobject_cast<QSpinBox *>(widget)) {
|
||||||
spinBox->setValue(m_value.toInt());
|
spinBox->setValue(m_value.toInt());
|
||||||
if (applyMode == ImmediateApply) {
|
if (applyMode == ImmediateApply) {
|
||||||
connect(spinBox, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged),
|
connect(spinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||||
this, [this, spinBox]() { setValue(spinBox->value()); });
|
this, [this, spinBox]() { setValue(spinBox->value()); });
|
||||||
}
|
}
|
||||||
} else if (auto lineEdit = qobject_cast<QLineEdit *>(widget)) {
|
} else if (auto lineEdit = qobject_cast<QLineEdit *>(widget)) {
|
||||||
|
@@ -56,8 +56,7 @@ const char FORMAT_ENTIRE_FILE_FALLBACK[] = "formatEntireFileFallback";
|
|||||||
UncrustifySettings::UncrustifySettings() :
|
UncrustifySettings::UncrustifySettings() :
|
||||||
AbstractSettings(Constants::Uncrustify::SETTINGS_NAME, ".cfg")
|
AbstractSettings(Constants::Uncrustify::SETTINGS_NAME, ".cfg")
|
||||||
{
|
{
|
||||||
connect(&m_versionProcess,
|
connect(&m_versionProcess, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
||||||
static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
|
|
||||||
this, &UncrustifySettings::parseVersionProcessResult);
|
this, &UncrustifySettings::parseVersionProcessResult);
|
||||||
|
|
||||||
setCommand("uncrustify");
|
setCommand("uncrustify");
|
||||||
|
@@ -87,7 +87,7 @@ public:
|
|||||||
|
|
||||||
updateComboBox();
|
updateComboBox();
|
||||||
refresh();
|
refresh();
|
||||||
connect(m_comboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
connect(m_comboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||||
this, &CMakeKitAspectWidget::currentCMakeToolChanged);
|
this, &CMakeKitAspectWidget::currentCMakeToolChanged);
|
||||||
|
|
||||||
m_manageButton->setContentsMargins(0, 0, 0, 0);
|
m_manageButton->setContentsMargins(0, 0, 0, 0);
|
||||||
|
@@ -118,7 +118,7 @@ ServerMode::ServerMode(const Environment &env,
|
|||||||
|
|
||||||
connect(m_cmakeProcess.get(), &QtcProcess::started, this, [this]() { m_connectionTimer.start(); });
|
connect(m_cmakeProcess.get(), &QtcProcess::started, this, [this]() { m_connectionTimer.start(); });
|
||||||
connect(m_cmakeProcess.get(),
|
connect(m_cmakeProcess.get(),
|
||||||
static_cast<void(QtcProcess::*)(int, QProcess::ExitStatus)>(&QtcProcess::finished),
|
QOverload<int, QProcess::ExitStatus>::of(&QtcProcess::finished),
|
||||||
this, &ServerMode::handleCMakeFinished);
|
this, &ServerMode::handleCMakeFinished);
|
||||||
|
|
||||||
QString argumentString;
|
QString argumentString;
|
||||||
@@ -211,7 +211,7 @@ void ServerMode::connectToServer()
|
|||||||
|
|
||||||
auto socket = new QLocalSocket(m_cmakeProcess.get());
|
auto socket = new QLocalSocket(m_cmakeProcess.get());
|
||||||
connect(socket, &QLocalSocket::readyRead, this, &ServerMode::handleRawCMakeServerData);
|
connect(socket, &QLocalSocket::readyRead, this, &ServerMode::handleRawCMakeServerData);
|
||||||
connect(socket, static_cast<void(QLocalSocket::*)(QLocalSocket::LocalSocketError)>(&QLocalSocket::error),
|
connect(socket, QOverload<QLocalSocket::LocalSocketError>::of(&QLocalSocket::error),
|
||||||
this, [this, socket]() {
|
this, [this, socket]() {
|
||||||
reportError(socket->errorString());
|
reportError(socket->errorString());
|
||||||
m_cmakeSocket = nullptr;
|
m_cmakeSocket = nullptr;
|
||||||
|
@@ -498,7 +498,7 @@ void TeaLeafReader::startCMake(const QStringList &configurationArguments)
|
|||||||
this, &TeaLeafReader::processCMakeOutput);
|
this, &TeaLeafReader::processCMakeOutput);
|
||||||
connect(m_cmakeProcess, &QProcess::readyReadStandardError,
|
connect(m_cmakeProcess, &QProcess::readyReadStandardError,
|
||||||
this, &TeaLeafReader::processCMakeError);
|
this, &TeaLeafReader::processCMakeError);
|
||||||
connect(m_cmakeProcess, static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
|
connect(m_cmakeProcess, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
||||||
this, &TeaLeafReader::cmakeFinished);
|
this, &TeaLeafReader::cmakeFinished);
|
||||||
|
|
||||||
QString args;
|
QString args;
|
||||||
|
@@ -68,10 +68,8 @@ Core::Id ClangDiagnosticConfigsSelectionWidget::currentConfigId() const
|
|||||||
void ClangDiagnosticConfigsSelectionWidget::connectToCurrentIndexChanged()
|
void ClangDiagnosticConfigsSelectionWidget::connectToCurrentIndexChanged()
|
||||||
{
|
{
|
||||||
m_currentIndexChangedConnection
|
m_currentIndexChangedConnection
|
||||||
= connect(m_selectionComboBox,
|
= connect(m_selectionComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||||
static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
this, [this]() { emit currentConfigChanged(currentConfigId()); });
|
||||||
this,
|
|
||||||
[this]() { emit currentConfigChanged(currentConfigId()); });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClangDiagnosticConfigsSelectionWidget::disconnectFromCurrentIndexChanged()
|
void ClangDiagnosticConfigsSelectionWidget::disconnectFromCurrentIndexChanged()
|
||||||
|
@@ -541,7 +541,7 @@ BreakpointDialog::BreakpointDialog(unsigned int enabledParts, QWidget *parent)
|
|||||||
verticalLayout->addWidget(m_buttonBox);
|
verticalLayout->addWidget(m_buttonBox);
|
||||||
verticalLayout->setStretchFactor(groupBoxAdvanced, 10);
|
verticalLayout->setStretchFactor(groupBoxAdvanced, 10);
|
||||||
|
|
||||||
connect(m_comboBoxType, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated),
|
connect(m_comboBoxType, QOverload<int>::of(&QComboBox::activated),
|
||||||
this, &BreakpointDialog::typeChanged);
|
this, &BreakpointDialog::typeChanged);
|
||||||
connect(m_buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
connect(m_buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
||||||
connect(m_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
connect(m_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||||
|
@@ -203,7 +203,7 @@ CdbEngine::CdbEngine() :
|
|||||||
|
|
||||||
connect(action(CreateFullBacktrace), &QAction::triggered,
|
connect(action(CreateFullBacktrace), &QAction::triggered,
|
||||||
this, &CdbEngine::createFullBacktrace);
|
this, &CdbEngine::createFullBacktrace);
|
||||||
connect(&m_process, static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
|
connect(&m_process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
||||||
this, &CdbEngine::processFinished);
|
this, &CdbEngine::processFinished);
|
||||||
connect(&m_process, &QProcess::errorOccurred, this, &CdbEngine::processError);
|
connect(&m_process, &QProcess::errorOccurred, this, &CdbEngine::processError);
|
||||||
connect(&m_process, &QProcess::readyReadStandardOutput,
|
connect(&m_process, &QProcess::readyReadStandardOutput,
|
||||||
|
@@ -326,7 +326,7 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
|
|||||||
this, &StartApplicationDialog::updateState);
|
this, &StartApplicationDialog::updateState);
|
||||||
connect(d->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
connect(d->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
||||||
connect(d->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
connect(d->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||||
connect(d->historyComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
connect(d->historyComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||||
this, &StartApplicationDialog::historyIndexChanged);
|
this, &StartApplicationDialog::historyIndexChanged);
|
||||||
|
|
||||||
connect(d->channelOverrideEdit, &QLineEdit::textChanged,
|
connect(d->channelOverrideEdit, &QLineEdit::textChanged,
|
||||||
|
@@ -121,7 +121,7 @@ DebuggerRunConfigWidget::DebuggerRunConfigWidget(DebuggerRunConfigurationAspect
|
|||||||
this, &DebuggerRunConfigWidget::useQmlDebuggerClicked);
|
this, &DebuggerRunConfigWidget::useQmlDebuggerClicked);
|
||||||
connect(m_useCppDebugger, &QAbstractButton::clicked,
|
connect(m_useCppDebugger, &QAbstractButton::clicked,
|
||||||
this, &DebuggerRunConfigWidget::useCppDebuggerClicked);
|
this, &DebuggerRunConfigWidget::useCppDebuggerClicked);
|
||||||
connect(m_debugServerPort, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged),
|
connect(m_debugServerPort, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||||
this, &DebuggerRunConfigWidget::qmlDebugServerPortChanged);
|
this, &DebuggerRunConfigWidget::qmlDebugServerPortChanged);
|
||||||
connect(m_useMultiProcess, &QAbstractButton::toggled,
|
connect(m_useMultiProcess, &QAbstractButton::toggled,
|
||||||
this, &DebuggerRunConfigWidget::useMultiProcessToggled);
|
this, &DebuggerRunConfigWidget::useMultiProcessToggled);
|
||||||
|
@@ -145,7 +145,7 @@ public:
|
|||||||
if (hideSwitcherUnlessNeeded)
|
if (hideSwitcherUnlessNeeded)
|
||||||
m_engineChooser->hide();
|
m_engineChooser->hide();
|
||||||
|
|
||||||
connect(m_engineChooser, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated),
|
connect(m_engineChooser, QOverload<int>::of(&QComboBox::activated),
|
||||||
this, &EngineManagerPrivate::activateEngineByIndex);
|
this, &EngineManagerPrivate::activateEngineByIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -118,7 +118,7 @@ void PdbEngine::setupEngine()
|
|||||||
QString bridge = ICore::resourcePath() + "/debugger/pdbbridge.py";
|
QString bridge = ICore::resourcePath() + "/debugger/pdbbridge.py";
|
||||||
|
|
||||||
connect(&m_proc, &QProcess::errorOccurred, this, &PdbEngine::handlePdbError);
|
connect(&m_proc, &QProcess::errorOccurred, this, &PdbEngine::handlePdbError);
|
||||||
connect(&m_proc, static_cast<void(QProcess::*)(int,QProcess::ExitStatus)>(&QProcess::finished),
|
connect(&m_proc, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
||||||
this, &PdbEngine::handlePdbFinished);
|
this, &PdbEngine::handlePdbFinished);
|
||||||
connect(&m_proc, &QProcess::readyReadStandardOutput,
|
connect(&m_proc, &QProcess::readyReadStandardOutput,
|
||||||
this, &PdbEngine::readPdbStandardOutput);
|
this, &PdbEngine::readPdbStandardOutput);
|
||||||
|
@@ -245,7 +245,7 @@ public:
|
|||||||
connect(&m_timerUpdate, &QTimer::timeout,
|
connect(&m_timerUpdate, &QTimer::timeout,
|
||||||
this, &RelativeNumbersColumn::followEditorLayout);
|
this, &RelativeNumbersColumn::followEditorLayout);
|
||||||
|
|
||||||
auto start = static_cast<void(QTimer::*)()>(&QTimer::start);
|
auto start = QOverload<>::of(&QTimer::start);
|
||||||
connect(m_editor, &QPlainTextEdit::cursorPositionChanged,
|
connect(m_editor, &QPlainTextEdit::cursorPositionChanged,
|
||||||
&m_timerUpdate, start);
|
&m_timerUpdate, start);
|
||||||
connect(m_editor->verticalScrollBar(), &QAbstractSlider::valueChanged,
|
connect(m_editor->verticalScrollBar(), &QAbstractSlider::valueChanged,
|
||||||
|
@@ -81,14 +81,14 @@ QWidget *GeneralSettingsPage::widget()
|
|||||||
updateFont(); // changes that might have happened when updating the selectors
|
updateFont(); // changes that might have happened when updating the selectors
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(m_ui->styleComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
connect(m_ui->styleComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||||
this, [this]() {
|
this, [this]() {
|
||||||
updateFont();
|
updateFont();
|
||||||
updateFontSizeSelector();
|
updateFontSizeSelector();
|
||||||
updateFont(); // changes that might have happened when updating the selectors
|
updateFont(); // changes that might have happened when updating the selectors
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(m_ui->sizeComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
connect(m_ui->sizeComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||||
this, &GeneralSettingsPage::updateFont);
|
this, &GeneralSettingsPage::updateFont);
|
||||||
|
|
||||||
m_homePage = LocalHelpManager::homePage();
|
m_homePage = LocalHelpManager::homePage();
|
||||||
|
@@ -88,8 +88,6 @@ ExportDialog::ExportDialog(QWidget *parent)
|
|||||||
, m_heightSpinBox(new QSpinBox(this))
|
, m_heightSpinBox(new QSpinBox(this))
|
||||||
, m_aspectRatio(1)
|
, m_aspectRatio(1)
|
||||||
{
|
{
|
||||||
using QSpinBoxIntSignal = void (QSpinBox::*)(int);
|
|
||||||
|
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
|
|
||||||
auto formLayout = new QFormLayout(this);
|
auto formLayout = new QFormLayout(this);
|
||||||
@@ -102,14 +100,14 @@ ExportDialog::ExportDialog(QWidget *parent)
|
|||||||
auto sizeLayout = new QHBoxLayout;
|
auto sizeLayout = new QHBoxLayout;
|
||||||
m_widthSpinBox->setMinimum(exportMinimumSize);
|
m_widthSpinBox->setMinimum(exportMinimumSize);
|
||||||
m_widthSpinBox->setMaximum(exportMaximumSize);
|
m_widthSpinBox->setMaximum(exportMaximumSize);
|
||||||
connect(m_widthSpinBox, static_cast<QSpinBoxIntSignal>(&QSpinBox::valueChanged),
|
connect(m_widthSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||||
this, &ExportDialog::exportWidthChanged);
|
this, &ExportDialog::exportWidthChanged);
|
||||||
sizeLayout->addWidget(m_widthSpinBox);
|
sizeLayout->addWidget(m_widthSpinBox);
|
||||||
//: Multiplication, as in 32x32
|
//: Multiplication, as in 32x32
|
||||||
sizeLayout->addWidget(new QLabel(tr("x")));
|
sizeLayout->addWidget(new QLabel(tr("x")));
|
||||||
m_heightSpinBox->setMinimum(exportMinimumSize);
|
m_heightSpinBox->setMinimum(exportMinimumSize);
|
||||||
m_heightSpinBox->setMaximum(exportMaximumSize);
|
m_heightSpinBox->setMaximum(exportMaximumSize);
|
||||||
connect(m_heightSpinBox, static_cast<QSpinBoxIntSignal>(&QSpinBox::valueChanged),
|
connect(m_heightSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||||
this, &ExportDialog::exportHeightChanged);
|
this, &ExportDialog::exportHeightChanged);
|
||||||
sizeLayout->addWidget(m_heightSpinBox);
|
sizeLayout->addWidget(m_heightSpinBox);
|
||||||
auto resetButton = new QToolButton(this);
|
auto resetButton = new QToolButton(this);
|
||||||
|
@@ -53,7 +53,7 @@ CreateSimulatorDialog::CreateSimulatorDialog(QWidget *parent) :
|
|||||||
m_ui->runtimeCombo->currentIndex() > 0);
|
m_ui->runtimeCombo->currentIndex() > 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto indexChanged = static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged);
|
const auto indexChanged = QOverload<int>::of(&QComboBox::currentIndexChanged);
|
||||||
connect(m_ui->nameEdit, &QLineEdit::textChanged, enableOk);
|
connect(m_ui->nameEdit, &QLineEdit::textChanged, enableOk);
|
||||||
connect(m_ui->runtimeCombo, indexChanged, enableOk);
|
connect(m_ui->runtimeCombo, indexChanged, enableOk);
|
||||||
connect(m_ui->deviceTypeCombo, indexChanged, [this, enableOk]() {
|
connect(m_ui->deviceTypeCombo, indexChanged, [this, enableOk]() {
|
||||||
|
@@ -171,7 +171,7 @@ IosBuildSettingsWidget::IosBuildSettingsWidget(IosBuildConfiguration *bc)
|
|||||||
if (m_isDevice) {
|
if (m_isDevice) {
|
||||||
connect(IosConfigurations::instance(), &IosConfigurations::provisioningDataChanged,
|
connect(IosConfigurations::instance(), &IosConfigurations::provisioningDataChanged,
|
||||||
this, &IosBuildSettingsWidget::populateDevelopmentTeams);
|
this, &IosBuildSettingsWidget::populateDevelopmentTeams);
|
||||||
connect(m_signEntityCombo, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
connect(m_signEntityCombo, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||||
this, &IosBuildSettingsWidget::onSigningEntityComboIndexChanged);
|
this, &IosBuildSettingsWidget::onSigningEntityComboIndexChanged);
|
||||||
connect(m_autoSignCheckbox, &QCheckBox::toggled,
|
connect(m_autoSignCheckbox, &QCheckBox::toggled,
|
||||||
this, &IosBuildSettingsWidget::configureSigningUi);
|
this, &IosBuildSettingsWidget::configureSigningUi);
|
||||||
|
@@ -332,7 +332,7 @@ void IosDeviceTypeAspect::addToConfigurationLayout(QFormLayout *layout)
|
|||||||
|
|
||||||
updateValues();
|
updateValues();
|
||||||
|
|
||||||
connect(m_deviceTypeComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
connect(m_deviceTypeComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||||
this, &IosDeviceTypeAspect::setDeviceTypeIndex);
|
this, &IosDeviceTypeAspect::setDeviceTypeIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -60,11 +60,11 @@ NimCompilerBuildStepConfigWidget::NimCompilerBuildStepConfigWidget(NimCompilerBu
|
|||||||
this, &NimCompilerBuildStepConfigWidget::updateUi);
|
this, &NimCompilerBuildStepConfigWidget::updateUi);
|
||||||
|
|
||||||
// Connect UI signals
|
// Connect UI signals
|
||||||
connect(m_ui->targetComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated),
|
connect(m_ui->targetComboBox, QOverload<int>::of(&QComboBox::activated),
|
||||||
this, &NimCompilerBuildStepConfigWidget::onTargetChanged);
|
this, &NimCompilerBuildStepConfigWidget::onTargetChanged);
|
||||||
connect(m_ui->additionalArgumentsLineEdit, &QLineEdit::textEdited,
|
connect(m_ui->additionalArgumentsLineEdit, &QLineEdit::textEdited,
|
||||||
this, &NimCompilerBuildStepConfigWidget::onAdditionalArgumentsTextEdited);
|
this, &NimCompilerBuildStepConfigWidget::onAdditionalArgumentsTextEdited);
|
||||||
connect(m_ui->defaultArgumentsComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated),
|
connect(m_ui->defaultArgumentsComboBox, QOverload<int>::of(&QComboBox::activated),
|
||||||
this, &NimCompilerBuildStepConfigWidget::onDefaultArgumentsComboBoxIndexChanged);
|
this, &NimCompilerBuildStepConfigWidget::onDefaultArgumentsComboBoxIndexChanged);
|
||||||
|
|
||||||
updateUi();
|
updateUi();
|
||||||
|
@@ -30,8 +30,8 @@ namespace Suggest {
|
|||||||
|
|
||||||
NimSuggestServer::NimSuggestServer(QObject *parent) : QObject(parent)
|
NimSuggestServer::NimSuggestServer(QObject *parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
connect(&m_process, static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>
|
connect(&m_process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
||||||
(&QProcess::finished), this, &NimSuggestServer::onFinished);
|
this, &NimSuggestServer::onFinished);
|
||||||
connect(&m_process, &QProcess::started, this, &NimSuggestServer::onStarted);
|
connect(&m_process, &QProcess::started, this, &NimSuggestServer::onStarted);
|
||||||
connect(&m_process, &QProcess::readyReadStandardOutput, this,
|
connect(&m_process, &QProcess::readyReadStandardOutput, this,
|
||||||
&NimSuggestServer::onStandardOutputAvailable);
|
&NimSuggestServer::onStandardOutputAvailable);
|
||||||
@@ -69,8 +69,8 @@ bool NimSuggestServer::start(const QString &executablePath,
|
|||||||
|
|
||||||
void NimSuggestServer::kill()
|
void NimSuggestServer::kill()
|
||||||
{
|
{
|
||||||
disconnect(&m_process, static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>
|
disconnect(&m_process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
||||||
(&QProcess::finished), this, &NimSuggestServer::onFinished);
|
this, &NimSuggestServer::onFinished);
|
||||||
m_process.kill();
|
m_process.kill();
|
||||||
m_process.waitForFinished();
|
m_process.waitForFinished();
|
||||||
clearState();
|
clearState();
|
||||||
|
@@ -76,8 +76,7 @@ PerfConfigWidget::PerfConfigWidget(PerfSettings *settings, QWidget *parent) :
|
|||||||
m_ui->sampleMode->addItem(tr("frequency (Hz)"), QLatin1String(Constants::PerfSampleFrequency));
|
m_ui->sampleMode->addItem(tr("frequency (Hz)"), QLatin1String(Constants::PerfSampleFrequency));
|
||||||
m_ui->sampleMode->addItem(tr("event count"), QLatin1String(Constants::PerfSampleCount));
|
m_ui->sampleMode->addItem(tr("event count"), QLatin1String(Constants::PerfSampleCount));
|
||||||
|
|
||||||
auto comboboxChangedSignal
|
auto comboboxChangedSignal = QOverload<int>::of(&QComboBox::currentIndexChanged);
|
||||||
= static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged);
|
|
||||||
connect(m_ui->callgraphMode, comboboxChangedSignal, this, [this](int index) {
|
connect(m_ui->callgraphMode, comboboxChangedSignal, this, [this](int index) {
|
||||||
QString mode = m_ui->callgraphMode->itemData(index).toString();
|
QString mode = m_ui->callgraphMode->itemData(index).toString();
|
||||||
m_settings->setCallgraphMode(mode);
|
m_settings->setCallgraphMode(mode);
|
||||||
|
@@ -1007,7 +1007,7 @@ void ComboBoxField::setup(JsonFieldPage *page, const QString &name)
|
|||||||
// the selectionModel does not behave like expected and wanted - so we block signals here
|
// the selectionModel does not behave like expected and wanted - so we block signals here
|
||||||
// (for example there was some losing focus thing when hovering over items, ...)
|
// (for example there was some losing focus thing when hovering over items, ...)
|
||||||
selectionModel()->blockSignals(true);
|
selectionModel()->blockSignals(true);
|
||||||
QObject::connect(w, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated), [w, this](int index) {
|
QObject::connect(w, QOverload<int>::of(&QComboBox::activated), [w, this](int index) {
|
||||||
w->blockSignals(true);
|
w->blockSignals(true);
|
||||||
selectionModel()->clearSelection();
|
selectionModel()->clearSelection();
|
||||||
|
|
||||||
|
@@ -376,7 +376,7 @@ public:
|
|||||||
|
|
||||||
m_projectSelection = new QComboBox;
|
m_projectSelection = new QComboBox;
|
||||||
m_projectSelection->setModel(&m_comboBoxModel);
|
m_projectSelection->setModel(&m_comboBoxModel);
|
||||||
connect(m_projectSelection, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated),
|
connect(m_projectSelection, QOverload<int>::of(&QComboBox::activated),
|
||||||
this, &ProjectWindowPrivate::projectSelected, Qt::QueuedConnection);
|
this, &ProjectWindowPrivate::projectSelected, Qt::QueuedConnection);
|
||||||
|
|
||||||
SessionManager *sessionManager = SessionManager::instance();
|
SessionManager *sessionManager = SessionManager::instance();
|
||||||
|
@@ -104,7 +104,7 @@ QWidget *ZoomAction::createWidget(QWidget *parent)
|
|||||||
comboBox->setCurrentIndex(m_currentComboBoxIndex);
|
comboBox->setCurrentIndex(m_currentComboBoxIndex);
|
||||||
blockSignals(false);
|
blockSignals(false);
|
||||||
});
|
});
|
||||||
connect(comboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
connect(comboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||||
[this, comboBox](int index) {
|
[this, comboBox](int index) {
|
||||||
m_currentComboBoxIndex = index;
|
m_currentComboBoxIndex = index;
|
||||||
|
|
||||||
|
@@ -59,7 +59,7 @@ QWidget *NumberSeriesAction::createWidget(QWidget *parent)
|
|||||||
comboBox->setModel(m_comboBoxModel.data());
|
comboBox->setModel(m_comboBoxModel.data());
|
||||||
|
|
||||||
comboBox->setCurrentIndex(m_comboBoxModelIndex);
|
comboBox->setCurrentIndex(m_comboBoxModelIndex);
|
||||||
connect(comboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
connect(comboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||||
this, &NumberSeriesAction::emitValueChanged);
|
this, &NumberSeriesAction::emitValueChanged);
|
||||||
|
|
||||||
return comboBox;
|
return comboBox;
|
||||||
|
@@ -39,7 +39,7 @@ ImportsWidget::ImportsWidget(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
setWindowTitle(tr("Import Manager"));
|
setWindowTitle(tr("Import Manager"));
|
||||||
m_addImportComboBox = new ImportManagerComboBox(this);
|
m_addImportComboBox = new ImportManagerComboBox(this);
|
||||||
connect(m_addImportComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated),
|
connect(m_addImportComboBox, QOverload<int>::of(&QComboBox::activated),
|
||||||
this, &ImportsWidget::addSelectedImport);
|
this, &ImportsWidget::addSelectedImport);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -53,7 +53,7 @@ QWidget *ComponentAction::createWidget(QWidget *parent)
|
|||||||
comboBox->setToolTip(tr("Edit sub components defined in this file."));
|
comboBox->setToolTip(tr("Edit sub components defined in this file."));
|
||||||
comboBox->setModel(m_componentView->standardItemModel());
|
comboBox->setModel(m_componentView->standardItemModel());
|
||||||
comboBox->setCurrentIndex(-1);
|
comboBox->setCurrentIndex(-1);
|
||||||
connect(comboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated),
|
connect(comboBox, QOverload<int>::of(&QComboBox::activated),
|
||||||
this, &ComponentAction::emitCurrentComponentChanged);
|
this, &ComponentAction::emitCurrentComponentChanged);
|
||||||
connect(this, &ComponentAction::currentIndexChanged, comboBox, &QComboBox::setCurrentIndex);
|
connect(this, &ComponentAction::currentIndexChanged, comboBox, &QComboBox::setCurrentIndex);
|
||||||
|
|
||||||
|
@@ -49,7 +49,7 @@ QnxSettingsWidget::QnxSettingsWidget(QWidget *parent) :
|
|||||||
this, &QnxSettingsWidget::addConfiguration);
|
this, &QnxSettingsWidget::addConfiguration);
|
||||||
connect(m_ui->removeButton, &QAbstractButton::clicked,
|
connect(m_ui->removeButton, &QAbstractButton::clicked,
|
||||||
this, &QnxSettingsWidget::removeConfiguration);
|
this, &QnxSettingsWidget::removeConfiguration);
|
||||||
connect(m_ui->configsCombo, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
connect(m_ui->configsCombo, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||||
this, &QnxSettingsWidget::updateInformation);
|
this, &QnxSettingsWidget::updateInformation);
|
||||||
connect(m_ui->generateKitsCheckBox, &QAbstractButton::toggled,
|
connect(m_ui->generateKitsCheckBox, &QAbstractButton::toggled,
|
||||||
this, &QnxSettingsWidget::generateKits);
|
this, &QnxSettingsWidget::generateKits);
|
||||||
|
@@ -644,7 +644,7 @@ public:
|
|||||||
ExampleSetModel *exampleSetModel = m_examplesModel->exampleSetModel();
|
ExampleSetModel *exampleSetModel = m_examplesModel->exampleSetModel();
|
||||||
exampleSetSelector->setModel(exampleSetModel);
|
exampleSetSelector->setModel(exampleSetModel);
|
||||||
exampleSetSelector->setCurrentIndex(exampleSetModel->selectedExampleSet());
|
exampleSetSelector->setCurrentIndex(exampleSetModel->selectedExampleSet());
|
||||||
connect(exampleSetSelector, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated),
|
connect(exampleSetSelector, QOverload<int>::of(&QComboBox::activated),
|
||||||
exampleSetModel, &ExampleSetModel::selectExampleSet);
|
exampleSetModel, &ExampleSetModel::selectExampleSet);
|
||||||
connect(exampleSetModel, &ExampleSetModel::selectedExampleSetChanged,
|
connect(exampleSetModel, &ExampleSetModel::selectedExampleSetChanged,
|
||||||
exampleSetSelector, &QComboBox::setCurrentIndex);
|
exampleSetSelector, &QComboBox::setCurrentIndex);
|
||||||
|
@@ -60,8 +60,7 @@ QWidget *CompletionSettingsPage::widget()
|
|||||||
m_page = new Ui::CompletionSettingsPage;
|
m_page = new Ui::CompletionSettingsPage;
|
||||||
m_page->setupUi(m_widget);
|
m_page->setupUi(m_widget);
|
||||||
|
|
||||||
connect(m_page->completionTrigger,
|
connect(m_page->completionTrigger, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||||
static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
|
||||||
this, &CompletionSettingsPage::onCompletionTriggerChanged);
|
this, &CompletionSettingsPage::onCompletionTriggerChanged);
|
||||||
|
|
||||||
int caseSensitivityIndex = 0;
|
int caseSensitivityIndex = 0;
|
||||||
|
@@ -509,7 +509,7 @@ CallgrindToolPrivate::CallgrindToolPrivate()
|
|||||||
m_searchFilter = new QLineEdit;
|
m_searchFilter = new QLineEdit;
|
||||||
m_searchFilter->setPlaceholderText(CallgrindTool::tr("Filter..."));
|
m_searchFilter->setPlaceholderText(CallgrindTool::tr("Filter..."));
|
||||||
connect(m_searchFilter, &QLineEdit::textChanged,
|
connect(m_searchFilter, &QLineEdit::textChanged,
|
||||||
&m_updateTimer, static_cast<void(QTimer::*)()>(&QTimer::start));
|
&m_updateTimer, QOverload<>::of(&QTimer::start));
|
||||||
|
|
||||||
setCostFormat(settings->costFormat());
|
setCostFormat(settings->costFormat());
|
||||||
enableCycleDetection(settings->detectCycles());
|
enableCycleDetection(settings->detectCycles());
|
||||||
|
@@ -85,7 +85,7 @@ ModelTestWidget::ModelTestWidget(CallgrindWidgetHandler *handler)
|
|||||||
m_format->addItem("absolute", CostDelegate::FormatAbsolute);
|
m_format->addItem("absolute", CostDelegate::FormatAbsolute);
|
||||||
m_format->addItem("relative", CostDelegate::FormatRelative);
|
m_format->addItem("relative", CostDelegate::FormatRelative);
|
||||||
m_format->addItem("rel. to parent", CostDelegate::FormatRelativeToParent);
|
m_format->addItem("rel. to parent", CostDelegate::FormatRelativeToParent);
|
||||||
connect(m_format, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
|
connect(m_format, QOverload<int>::of(&QComboBox::activated),
|
||||||
this, &ModelTestWidget::formatChanged);
|
this, &ModelTestWidget::formatChanged);
|
||||||
h->addWidget(m_format);
|
h->addWidget(m_format);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user