From 6f37348b4c9f00879787374672d42ca1d14083bc Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 26 Feb 2019 09:40:49 +0100 Subject: [PATCH] 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 --- .../instances/nodeinstanceclientproxy.cpp | 3 +-- src/libs/clangsupport/connectionclient.cpp | 2 +- src/libs/clangsupport/connectionserver.h | 2 +- .../qmt/model_widgets_ui/propertiesviewmview.cpp | 16 ++++++++-------- src/libs/qmldebug/qmldebugconnection.cpp | 8 ++++---- .../qmleditorwidgets/contextpanetextwidget.cpp | 5 ++--- src/libs/qmleditorwidgets/customcolordialog.cpp | 12 ++++-------- src/libs/ssh/sshremoteprocess.cpp | 4 +--- src/libs/utils/completingtextedit.cpp | 2 +- src/libs/utils/newclasswidget.cpp | 2 +- src/libs/utils/projectintropage.cpp | 2 +- src/libs/utils/settingsselector.cpp | 2 +- src/libs/utils/synchronousprocess.cpp | 3 +-- src/libs/utils/textfieldcombobox.cpp | 2 +- src/plugins/android/androidavdmanager.cpp | 2 +- src/plugins/android/androidbuildapkwidget.cpp | 6 +++--- src/plugins/android/androidmanager.cpp | 2 +- .../android/androidmanifesteditorwidget.cpp | 4 ++-- src/plugins/android/androidsignaloperation.cpp | 6 ++---- src/plugins/android/avddialog.cpp | 2 +- .../android/createandroidmanifestwizard.cpp | 2 +- src/plugins/autotest/gtest/gtestoutputreader.cpp | 3 +-- src/plugins/autotest/testrunner.cpp | 3 +-- src/plugins/baremetal/gdbserverprovider.cpp | 4 ++-- .../baremetal/gdbserverproviderprocess.cpp | 2 +- src/plugins/beautifier/configurationeditor.cpp | 2 +- src/plugins/beautifier/configurationpanel.cpp | 2 +- .../clangprojectsettingswidget.cpp | 2 +- .../clangtools/clangselectablefilesdialog.cpp | 2 +- src/plugins/clangtools/clangtoolrunner.cpp | 2 +- .../clangtools/clangtoolsconfigwidget.cpp | 2 +- src/plugins/clearcase/activityselector.cpp | 6 +++--- src/plugins/coreplugin/dialogs/newdialog.cpp | 2 +- .../coreplugin/dialogs/readonlyfilesdialog.cpp | 6 +++--- src/plugins/coreplugin/editortoolbar.cpp | 6 +++--- src/plugins/coreplugin/externaltool.cpp | 2 +- src/plugins/coreplugin/find/findtoolbar.cpp | 3 +-- src/plugins/coreplugin/find/findtoolwindow.cpp | 7 +++---- .../find/highlightscrollbarcontroller.cpp | 2 +- .../coreplugin/find/searchresultwindow.cpp | 2 +- src/plugins/coreplugin/locator/executefilter.cpp | 2 +- src/plugins/coreplugin/mimetypemagicdialog.cpp | 2 +- src/plugins/coreplugin/navigationsubwidget.cpp | 2 +- src/plugins/coreplugin/outputpanemanager.cpp | 2 +- src/plugins/coreplugin/sidebarwidget.cpp | 2 +- src/plugins/cpaster/pasteselectdialog.cpp | 2 +- src/plugins/cpaster/pasteview.cpp | 2 +- .../cppeditor/cppcodemodelinspectordialog.cpp | 2 +- src/plugins/cppeditor/cppparsecontext.cpp | 2 +- .../cpptools/clangdiagnosticconfigswidget.cpp | 4 ++-- src/plugins/cpptools/cppeditoroutline.cpp | 4 ++-- .../analyzer/analyzerrunconfigwidget.cpp | 2 +- src/plugins/debugger/debuggerkitinformation.cpp | 2 +- src/plugins/debugger/debuggermainwindow.cpp | 2 +- src/plugins/debugger/gdb/gdbengine.cpp | 2 +- src/plugins/debugger/lldb/lldbengine.cpp | 2 +- src/plugins/designer/qtcreatorintegration.cpp | 3 +-- src/plugins/diffeditor/diffeditor.cpp | 4 ++-- src/plugins/git/gerrit/gerritmodel.cpp | 4 ++-- src/plugins/git/gerrit/gerritplugin.cpp | 2 +- src/plugins/git/gerrit/gerritpushdialog.cpp | 4 ++-- src/plugins/help/helpwidget.cpp | 2 +- src/plugins/help/openpagesmanager.cpp | 2 +- src/plugins/ios/iostoolhandler.cpp | 2 +- src/plugins/modeleditor/modeleditor.cpp | 2 +- src/plugins/perforce/perforcechecker.cpp | 2 +- src/plugins/perfprofiler/perfconfigwidget.cpp | 2 +- src/plugins/perfprofiler/perfdatareader.cpp | 2 +- src/plugins/projectexplorer/abiwidget.cpp | 12 ++++++------ .../projectexplorer/abstractprocessstep.cpp | 2 +- .../projectexplorer/applicationlauncher.cpp | 5 ++--- .../buildsettingspropertiespage.cpp | 2 +- .../codestylesettingspropertiespage.cpp | 2 +- .../projectexplorer/customparserconfigdialog.cpp | 12 ++++++------ src/plugins/projectexplorer/customtoolchain.cpp | 2 +- .../devicesupport/deviceprocessesdialog.cpp | 12 ++++-------- .../devicesupport/devicesettingswidget.cpp | 2 +- .../devicesupport/sshdeviceprocess.cpp | 3 +-- .../editorsettingspropertiespage.cpp | 4 ++-- .../projectexplorer/environmentaspectwidget.cpp | 2 +- .../projectexplorer/foldernavigationwidget.cpp | 2 +- src/plugins/projectexplorer/kitchooser.cpp | 4 ++-- src/plugins/projectexplorer/kitinformation.cpp | 6 +++--- .../projectconfigurationaspects.cpp | 2 +- .../projectexplorersettingspage.cpp | 2 +- src/plugins/projectexplorer/projectmodels.cpp | 4 +--- .../projectexplorer/projectwizardpage.cpp | 6 +++--- .../runsettingspropertiespage.cpp | 4 ++-- src/plugins/qbsprojectmanager/qbsbuildstep.cpp | 4 ++-- .../qbsprofilessettingspage.cpp | 2 +- .../qmakeprojectmanager/externaleditors.cpp | 3 +-- .../librarydetailscontroller.cpp | 2 +- src/plugins/qmakeprojectmanager/qmakestep.cpp | 2 +- .../componentcore/changestyleaction.cpp | 2 +- .../components/formeditor/backgroundaction.cpp | 2 +- .../instances/nodeinstanceserverproxy.cpp | 6 +++--- .../connectioneditor/delegates.cpp | 8 ++++---- .../timelineeditor/canvasstyledialog.cpp | 2 +- .../timelineeditor/easingcurvedialog.cpp | 2 +- .../timelineeditor/timelineanimationform.cpp | 4 ++-- .../timelineeditor/timelinesettingsmodel.cpp | 2 +- src/plugins/qmljseditor/qmljseditor.cpp | 8 ++++---- src/plugins/qmljseditor/qmljseditordocument.cpp | 4 ++-- .../qmlprofiler/qmlprofilerconfigwidget.cpp | 2 +- .../qmlprojectrunconfiguration.cpp | 2 +- src/plugins/qtsupport/qtkitinformation.cpp | 2 +- src/plugins/qtsupport/qtversionmanager.cpp | 2 +- .../genericlinuxdeviceconfigurationwidget.cpp | 4 ++-- src/plugins/remotelinux/linuxdevicetester.cpp | 4 ++-- .../remotelinuxcheckforfreediskspacestep.cpp | 3 +-- src/plugins/remotelinux/rsyncdeploystep.cpp | 2 +- src/plugins/scxmleditor/common/colorsettings.cpp | 3 ++- .../scxmleditor/common/stateproperties.cpp | 2 +- src/plugins/serialterminal/serialoutputpane.cpp | 6 +++--- .../texteditor/behaviorsettingswidget.cpp | 2 +- .../codeassist/genericproposalwidget.cpp | 2 +- .../texteditor/codestyleselectorwidget.cpp | 2 +- src/plugins/texteditor/colorschemeedit.cpp | 10 +++++----- src/plugins/texteditor/findinfiles.cpp | 2 +- src/plugins/texteditor/fontsettingspage.cpp | 7 +++---- .../texteditor/snippets/snippetssettingspage.cpp | 2 +- src/plugins/texteditor/tabsettingswidget.cpp | 4 ++-- src/plugins/texteditor/texteditor.cpp | 10 +++++----- src/plugins/todo/todooutputpane.cpp | 2 +- src/plugins/updateinfo/settingspage.cpp | 2 +- src/plugins/valgrind/callgrindtool.cpp | 2 +- src/plugins/valgrind/memchecktool.cpp | 6 +++--- src/plugins/valgrind/valgrindconfigwidget.cpp | 10 +++++----- src/plugins/vcsbase/submitfieldwidget.cpp | 2 +- src/plugins/vcsbase/vcsbaseeditor.cpp | 4 ++-- src/plugins/vcsbase/vcsbaseeditorconfig.cpp | 2 +- src/plugins/winrt/winrtdevice.cpp | 3 +-- src/plugins/winrt/winrtrunnerhelper.cpp | 3 +-- src/shared/help/bookmarkmanager.cpp | 2 +- src/tools/iostool/main.cpp | 2 +- .../qtcreatorcrashhandler/backtracecollector.cpp | 6 +++--- 136 files changed, 225 insertions(+), 253 deletions(-) diff --git a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp index 06a16f01c26..ca4792e7a0f 100644 --- a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp +++ b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp @@ -87,8 +87,7 @@ void NodeInstanceClientProxy::initializeSocket() { QLocalSocket *localSocket = new QLocalSocket(this); connect(localSocket, &QIODevice::readyRead, this, &NodeInstanceClientProxy::readDataStream); - connect(localSocket, - static_cast(&QLocalSocket::error), + connect(localSocket, QOverload::of(&QLocalSocket::error), QCoreApplication::instance(), &QCoreApplication::quit); connect(localSocket, &QLocalSocket::disconnected, QCoreApplication::instance(), &QCoreApplication::quit); localSocket->connectToServer(QCoreApplication::arguments().at(1), QIODevice::ReadWrite | QIODevice::Unbuffered); diff --git a/src/libs/clangsupport/connectionclient.cpp b/src/libs/clangsupport/connectionclient.cpp index bdbedab5c07..b3025baeea2 100644 --- a/src/libs/clangsupport/connectionclient.cpp +++ b/src/libs/clangsupport/connectionclient.cpp @@ -325,7 +325,7 @@ void ConnectionClient::connectStandardOutputAndError(QProcess *process) const void ConnectionClient::connectLocalSocketError() const { connect(m_localSocket, - static_cast(&QLocalSocket::error), + QOverload::of(&QLocalSocket::error), this, &ConnectionClient::printLocalSocketError); } diff --git a/src/libs/clangsupport/connectionserver.h b/src/libs/clangsupport/connectionserver.h index 8f13e631c57..68defa48d3d 100644 --- a/src/libs/clangsupport/connectionserver.h +++ b/src/libs/clangsupport/connectionserver.h @@ -76,7 +76,7 @@ private: void connectToLocalServer(const QString &connectionName) { QObject::connect(&m_localSocket, - static_cast(&QLocalSocket::error), + QOverload::of(&QLocalSocket::error), [&] (QLocalSocket::LocalSocketError) { qWarning() << "ConnectionServer error:" << m_localSocket.errorString() << connectionName; }); diff --git a/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.cpp b/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.cpp index 63d716d2d10..c8b11d44e14 100644 --- a/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.cpp +++ b/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.cpp @@ -352,7 +352,7 @@ void PropertiesView::MView::visitMElement(const MElement *element) m_stereotypeComboBox->addItems(m_propertiesView->stereotypeController()->knownStereotypes(m_stereotypeElement)); connect(m_stereotypeComboBox->lineEdit(), &QLineEdit::textEdited, this, &PropertiesView::MView::onStereotypesChanged); - connect(m_stereotypeComboBox, static_cast(&QComboBox::activated), + connect(m_stereotypeComboBox, QOverload::of(&QComboBox::activated), this, &PropertiesView::MView::onStereotypesChanged); } if (!m_stereotypeComboBox->hasFocus()) { @@ -580,7 +580,7 @@ void PropertiesView::MView::visitMDependency(const MDependency *dependency) m_directionSelector = new QComboBox(m_topWidget); m_directionSelector->addItems(QStringList({ "->", "<-", "<->" })); addRow(tr("Direction:"), m_directionSelector, "direction"); - connect(m_directionSelector, static_cast(&QComboBox::activated), + connect(m_directionSelector, QOverload::of(&QComboBox::activated), this, &PropertiesView::MView::onDependencyDirectionChanged); } if (isSingleSelection) { @@ -664,7 +664,7 @@ void PropertiesView::MView::visitMAssociation(const MAssociation *association) m_endAKind = new QComboBox(m_topWidget); m_endAKind->addItems({ tr("Association"), tr("Aggregation"), tr("Composition") }); addRow(tr("Relationship:"), m_endAKind, "relationship a"); - connect(m_endAKind, static_cast(&QComboBox::activated), + connect(m_endAKind, QOverload::of(&QComboBox::activated), this, &PropertiesView::MView::onAssociationEndAKindChanged); } if (isSingleSelection) { @@ -729,7 +729,7 @@ void PropertiesView::MView::visitMAssociation(const MAssociation *association) m_endBKind = new QComboBox(m_topWidget); m_endBKind->addItems({ tr("Association"), tr("Aggregation"), tr("Composition") }); addRow(tr("Relationship:"), m_endBKind, "relationship b"); - connect(m_endBKind, static_cast(&QComboBox::activated), + connect(m_endBKind, QOverload::of(&QComboBox::activated), this, &PropertiesView::MView::onAssociationEndBKindChanged); } if (isSingleSelection) { @@ -930,7 +930,7 @@ void PropertiesView::MView::visitDObject(const DObject *object) m_visualSecondaryRoleSelector->addItems({ tr("Normal"), tr("Lighter"), tr("Darker"), tr("Soften"), tr("Outline"), tr("Flat") }); addRow(tr("Role:"), m_visualSecondaryRoleSelector, "role"); - connect(m_visualSecondaryRoleSelector, static_cast(&QComboBox::activated), + connect(m_visualSecondaryRoleSelector, QOverload::of(&QComboBox::activated), this, &PropertiesView::MView::onVisualSecondaryRoleChanged); } if (!m_visualSecondaryRoleSelector->hasFocus()) { @@ -958,7 +958,7 @@ void PropertiesView::MView::visitDObject(const DObject *object) m_stereotypeDisplaySelector->addItems({ tr("Smart"), tr("None"), tr("Label"), tr("Decoration"), tr("Icon") }); addRow(tr("Stereotype display:"), m_stereotypeDisplaySelector, "stereotype display"); - connect(m_stereotypeDisplaySelector, static_cast(&QComboBox::activated), + connect(m_stereotypeDisplaySelector, QOverload::of(&QComboBox::activated), this, &PropertiesView::MView::onStereotypeDisplayChanged); } if (!m_stereotypeDisplaySelector->hasFocus()) { @@ -995,7 +995,7 @@ void PropertiesView::MView::visitDClass(const DClass *klass) m_templateDisplaySelector = new QComboBox(m_topWidget); m_templateDisplaySelector->addItems({ tr("Smart"), tr("Box"), tr("Angle Brackets") }); addRow(tr("Template display:"), m_templateDisplaySelector, "template display"); - connect(m_templateDisplaySelector, static_cast(&QComboBox::activated), + connect(m_templateDisplaySelector, QOverload::of(&QComboBox::activated), this, &PropertiesView::MView::onTemplateDisplayChanged); } if (!m_templateDisplaySelector->hasFocus()) { @@ -1126,7 +1126,7 @@ void PropertiesView::MView::visitDAnnotation(const DAnnotation *annotation) tr("Subtitle"), tr("Emphasized"), tr("Soften"), tr("Footnote") })); addRow(tr("Role:"), m_annotationVisualRoleSelector, "visual role"); - connect(m_annotationVisualRoleSelector, static_cast(&QComboBox::activated), + connect(m_annotationVisualRoleSelector, QOverload::of(&QComboBox::activated), this, &PropertiesView::MView::onAnnotationVisualRoleChanged); } if (!m_annotationVisualRoleSelector->hasFocus()) { diff --git a/src/libs/qmldebug/qmldebugconnection.cpp b/src/libs/qmldebug/qmldebugconnection.cpp index 6664df2b99b..008aca91917 100644 --- a/src/libs/qmldebug/qmldebugconnection.cpp +++ b/src/libs/qmldebug/qmldebugconnection.cpp @@ -352,8 +352,8 @@ void QmlDebugConnection::connectToHost(const QString &hostName, quint16 port) emit logStateChange(socketStateToString(state)); }); - connect(socket, static_cast - (&QAbstractSocket::error), this, [this](QAbstractSocket::SocketError error) { + connect(socket, QOverload::of(&QAbstractSocket::error), + this, [this](QAbstractSocket::SocketError error) { emit logError(socketErrorToString(error)); socketDisconnected(); }); @@ -391,8 +391,8 @@ void QmlDebugConnection::newConnection() connect(socket, &QLocalSocket::disconnected, this, &QmlDebugConnection::socketDisconnected); - connect(socket, static_cast - (&QLocalSocket::error), this, [this](QLocalSocket::LocalSocketError error) { + connect(socket, QOverload::of(&QLocalSocket::error), + this, [this](QLocalSocket::LocalSocketError error) { emit logError(socketErrorToString(static_cast(error))); socketDisconnected(); }); diff --git a/src/libs/qmleditorwidgets/contextpanetextwidget.cpp b/src/libs/qmleditorwidgets/contextpanetextwidget.cpp index bba9bf4d95b..70b6c700db4 100644 --- a/src/libs/qmleditorwidgets/contextpanetextwidget.cpp +++ b/src/libs/qmleditorwidgets/contextpanetextwidget.cpp @@ -73,8 +73,7 @@ ContextPaneTextWidget::ContextPaneTextWidget(QWidget *parent) : connect(parentContextWidget->colorDialog(), &CustomColorDialog::rejected, this, &ContextPaneTextWidget::onColorDialogCancled); - connect(ui->fontSizeSpinBox, - static_cast(&QmlEditorWidgets::FontSizeSpinBox::valueChanged), + connect(ui->fontSizeSpinBox, QOverload::of(&QmlEditorWidgets::FontSizeSpinBox::valueChanged), this, &ContextPaneTextWidget::onFontSizeChanged); connect(ui->fontSizeSpinBox, &QmlEditorWidgets::FontSizeSpinBox::formatChanged, this, &ContextPaneTextWidget::onFontFormatChanged); @@ -104,7 +103,7 @@ ContextPaneTextWidget::ContextPaneTextWidget(QWidget *parent) : connect(ui->bottomAlignmentButton, &QToolButton::toggled, this, &ContextPaneTextWidget::onVerticalAlignmentChanged); - connect(ui->styleComboBox, static_cast(&QComboBox::currentIndexChanged), + connect(ui->styleComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &ContextPaneTextWidget::onStyleComboBoxChanged); } diff --git a/src/libs/qmleditorwidgets/customcolordialog.cpp b/src/libs/qmleditorwidgets/customcolordialog.cpp index a99410467f7..de603e0ea9c 100644 --- a/src/libs/qmleditorwidgets/customcolordialog.cpp +++ b/src/libs/qmleditorwidgets/customcolordialog.cpp @@ -113,17 +113,13 @@ CustomColorDialog::CustomColorDialog(QWidget *parent) : QFrame(parent ) resize(sizeHint()); connect(m_colorBox, &ColorBox::colorChanged, this, &CustomColorDialog::onColorBoxChanged); - connect(m_alphaSpinBox, - static_cast(&QDoubleSpinBox::valueChanged), + connect(m_alphaSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &CustomColorDialog::spinBoxChanged); - connect(m_rSpinBox, - static_cast(&QDoubleSpinBox::valueChanged), + connect(m_rSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &CustomColorDialog::spinBoxChanged); - connect(m_gSpinBox, - static_cast(&QDoubleSpinBox::valueChanged), + connect(m_gSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &CustomColorDialog::spinBoxChanged); - connect(m_bSpinBox, - static_cast(&QDoubleSpinBox::valueChanged), + connect(m_bSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &CustomColorDialog::spinBoxChanged); connect(m_hueControl, &HueControl::hueChanged, this, &CustomColorDialog::onHueChanged); diff --git a/src/libs/ssh/sshremoteprocess.cpp b/src/libs/ssh/sshremoteprocess.cpp index aa46214afbb..48e965d6fa8 100644 --- a/src/libs/ssh/sshremoteprocess.cpp +++ b/src/libs/ssh/sshremoteprocess.cpp @@ -66,9 +66,7 @@ SshRemoteProcess::SshRemoteProcess(const QByteArray &command, const QStringList d->remoteCommand = command; d->connectionArgs = connectionArgs; - connect(this, - static_cast(&QProcess::finished), - [this] { + connect(this, QOverload::of(&QProcess::finished), this, [this] { QString error; if (exitStatus() == QProcess::CrashExit) error = tr("The ssh binary crashed: %1").arg(errorString()); diff --git a/src/libs/utils/completingtextedit.cpp b/src/libs/utils/completingtextedit.cpp index f4d7b0441c2..3a34973c000 100644 --- a/src/libs/utils/completingtextedit.cpp +++ b/src/libs/utils/completingtextedit.cpp @@ -114,7 +114,7 @@ void CompletingTextEdit::setCompleter(QCompleter *c) completer()->setWidget(this); completer()->setCompletionMode(QCompleter::PopupCompletion); - connect(completer(), static_cast(&QCompleter::activated), + connect(completer(), QOverload::of(&QCompleter::activated), this, [this](const QString &str) { d->insertCompletion(str); }); } diff --git a/src/libs/utils/newclasswidget.cpp b/src/libs/utils/newclasswidget.cpp index 8700b8204c3..9205d435dcc 100644 --- a/src/libs/utils/newclasswidget.cpp +++ b/src/libs/utils/newclasswidget.cpp @@ -88,7 +88,7 @@ NewClassWidget::NewClassWidget(QWidget *parent) : connect(d->m_ui.classLineEdit, &QLineEdit::textEdited, this, &NewClassWidget::classNameEdited); connect(d->m_ui.baseClassComboBox, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, &NewClassWidget::suggestClassNameFromBase); connect(d->m_ui.baseClassComboBox, &QComboBox::editTextChanged, this, &NewClassWidget::slotValidChanged); diff --git a/src/libs/utils/projectintropage.cpp b/src/libs/utils/projectintropage.cpp index a449fe1285f..56127ac4797 100644 --- a/src/libs/utils/projectintropage.cpp +++ b/src/libs/utils/projectintropage.cpp @@ -101,7 +101,7 @@ ProjectIntroPage::ProjectIntroPage(QWidget *parent) : connect(d->m_ui.nameLineEdit, &FancyLineEdit::validReturnPressed, this, &ProjectIntroPage::slotActivated); connect(d->m_ui.projectComboBox, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, &ProjectIntroPage::slotChanged); setProperty(SHORT_TITLE_PROPERTY, tr("Location")); diff --git a/src/libs/utils/settingsselector.cpp b/src/libs/utils/settingsselector.cpp index ddfa7a137c4..6ae5bff43cf 100644 --- a/src/libs/utils/settingsselector.cpp +++ b/src/libs/utils/settingsselector.cpp @@ -73,7 +73,7 @@ SettingsSelector::SettingsSelector(QWidget *parent) : connect(m_renameButton, &QAbstractButton::clicked, this, &SettingsSelector::renameButtonClicked); connect(m_configurationCombo, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, &SettingsSelector::currentChanged); } diff --git a/src/libs/utils/synchronousprocess.cpp b/src/libs/utils/synchronousprocess.cpp index a153e6ac91f..bfb9d0d2964 100644 --- a/src/libs/utils/synchronousprocess.cpp +++ b/src/libs/utils/synchronousprocess.cpp @@ -297,8 +297,7 @@ SynchronousProcess::SynchronousProcess() : { d->m_timer.setInterval(1000); connect(&d->m_timer, &QTimer::timeout, this, &SynchronousProcess::slotTimeout); - connect(&d->m_process, - static_cast(&QProcess::finished), + connect(&d->m_process, QOverload::of(&QProcess::finished), this, &SynchronousProcess::finished); connect(&d->m_process, &QProcess::errorOccurred, this, &SynchronousProcess::error); connect(&d->m_process, &QProcess::readyReadStandardOutput, diff --git a/src/libs/utils/textfieldcombobox.cpp b/src/libs/utils/textfieldcombobox.cpp index db940ad53a3..aad64d2e7de 100644 --- a/src/libs/utils/textfieldcombobox.cpp +++ b/src/libs/utils/textfieldcombobox.cpp @@ -43,7 +43,7 @@ TextFieldComboBox::TextFieldComboBox(QWidget *parent) : QComboBox(parent) { setEditable(false); - connect(this, static_cast(&QComboBox::currentIndexChanged), + connect(this, QOverload::of(&QComboBox::currentIndexChanged), this, &TextFieldComboBox::slotCurrentIndexChanged); } diff --git a/src/plugins/android/androidavdmanager.cpp b/src/plugins/android/androidavdmanager.cpp index 128cd8a2817..457d85d53b3 100644 --- a/src/plugins/android/androidavdmanager.cpp +++ b/src/plugins/android/androidavdmanager.cpp @@ -296,7 +296,7 @@ bool AndroidAvdManager::startAvdAsync(const QString &avdName) const auto avdProcess = new QProcess(); avdProcess->setProcessChannelMode(QProcess::MergedChannels); QObject::connect(avdProcess, - static_cast(&QProcess::finished), + QOverload::of(&QProcess::finished), avdProcess, std::bind(&avdProcessFinished, std::placeholders::_1, avdProcess)); diff --git a/src/plugins/android/androidbuildapkwidget.cpp b/src/plugins/android/androidbuildapkwidget.cpp index 02d0c3e92b5..a347d12043d 100644 --- a/src/plugins/android/androidbuildapkwidget.cpp +++ b/src/plugins/android/androidbuildapkwidget.cpp @@ -100,7 +100,7 @@ AndroidBuildApkInnerWidget::AndroidBuildApkInnerWidget(AndroidBuildApkStep *step // target sdk connect(m_ui->targetSDKComboBox, - static_cast(&QComboBox::activated), + QOverload::of(&QComboBox::activated), this, &AndroidBuildApkInnerWidget::setTargetSdk); // deployment options @@ -122,10 +122,10 @@ AndroidBuildApkInnerWidget::AndroidBuildApkInnerWidget(AndroidBuildApkStep *step connect(m_ui->KeystoreLocationPathChooser, &Utils::PathChooser::pathChanged, this, &AndroidBuildApkInnerWidget::updateKeyStorePath); connect(m_ui->certificatesAliasComboBox, - static_cast(&QComboBox::activated), + QOverload::of(&QComboBox::activated), this, &AndroidBuildApkInnerWidget::certificatesAliasComboBoxActivated); connect(m_ui->certificatesAliasComboBox, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, &AndroidBuildApkInnerWidget::certificatesAliasComboBoxCurrentIndexChanged); connect(m_step->buildConfiguration(), &ProjectExplorer::BuildConfiguration::buildTypeChanged, diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index eb689fdf0ba..0fdaba96a6c 100644 --- a/src/plugins/android/androidmanager.cpp +++ b/src/plugins/android/androidmanager.cpp @@ -666,7 +666,7 @@ QProcess *AndroidManager::runAdbCommandDetached(const QStringList &args, QString p->start(adb, args); if (p->waitForStarted(500) && p->state() == QProcess::Running) { if (deleteOnFinish) { - connect(p.get(), static_cast(&QProcess::finished), + connect(p.get(), QOverload::of(&QProcess::finished), p.get(), &QObject::deleteLater); } return p.release(); diff --git a/src/plugins/android/androidmanifesteditorwidget.cpp b/src/plugins/android/androidmanifesteditorwidget.cpp index 6d60a198c2b..34eaab71594 100644 --- a/src/plugins/android/androidmanifesteditorwidget.cpp +++ b/src/plugins/android/androidmanifesteditorwidget.cpp @@ -202,10 +202,10 @@ void AndroidManifestEditorWidget::initializePage() connect(m_versionNameLinedit, &QLineEdit::textEdited, this, setDirtyFunc); connect(m_androidMinSdkVersion, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, setDirtyFunc); connect(m_androidTargetSdkVersion, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, setDirtyFunc); } diff --git a/src/plugins/android/androidsignaloperation.cpp b/src/plugins/android/androidsignaloperation.cpp index bb54b833ab0..2410ed4732d 100644 --- a/src/plugins/android/androidsignaloperation.cpp +++ b/src/plugins/android/androidsignaloperation.cpp @@ -63,8 +63,7 @@ void Android::Internal::AndroidSignalOperation::adbFindRunAsFinished(int exitCod m_state = Idle; emit finished(m_errorMessage); } else { - connect(m_adbProcess, - static_cast(&QProcess::finished), + connect(m_adbProcess, QOverload::of(&QProcess::finished), this, &AndroidSignalOperation::adbKillFinished); m_state = Kill; m_timeout->start(); @@ -113,8 +112,7 @@ void Android::Internal::AndroidSignalOperation::signalOperationViaADB(qint64 pid m_adbProcess->disconnect(this); m_pid = pid; m_signal = signal; - connect(m_adbProcess, - static_cast(&QProcess::finished), + connect(m_adbProcess, QOverload::of(&QProcess::finished), this, &AndroidSignalOperation::adbFindRunAsFinished); m_state = RunAs; m_timeout->start(); diff --git a/src/plugins/android/avddialog.cpp b/src/plugins/android/avddialog.cpp index 7097f5c1c6c..c593f258dd0 100644 --- a/src/plugins/android/avddialog.cpp +++ b/src/plugins/android/avddialog.cpp @@ -66,7 +66,7 @@ AvdDialog::AvdDialog(int minApiLevel, AndroidSdkManager *sdkManager, const QStri updateApiLevelComboBox(); connect(m_avdDialog.abiComboBox, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, &AvdDialog::updateApiLevelComboBox); connect(&m_hideTipTimer, &QTimer::timeout, diff --git a/src/plugins/android/createandroidmanifestwizard.cpp b/src/plugins/android/createandroidmanifestwizard.cpp index 05f4d2b2d5a..2476acbaf15 100644 --- a/src/plugins/android/createandroidmanifestwizard.cpp +++ b/src/plugins/android/createandroidmanifestwizard.cpp @@ -95,7 +95,7 @@ ChooseProFilePage::ChooseProFilePage(CreateAndroidManifestWizard *wizard) } nodeSelected(m_comboBox->currentIndex()); - connect(m_comboBox, static_cast(&QComboBox::currentIndexChanged), + connect(m_comboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &ChooseProFilePage::nodeSelected); fl->addRow(tr(".pro file:"), m_comboBox); diff --git a/src/plugins/autotest/gtest/gtestoutputreader.cpp b/src/plugins/autotest/gtest/gtestoutputreader.cpp index f1efb479a4d..bbeb54e3cae 100644 --- a/src/plugins/autotest/gtest/gtestoutputreader.cpp +++ b/src/plugins/autotest/gtest/gtestoutputreader.cpp @@ -48,8 +48,7 @@ GTestOutputReader::GTestOutputReader(const QFutureInterface &futu , m_projectFile(projectFile) { if (m_testApplication) { - connect(m_testApplication, - static_cast(&QProcess::finished), + connect(m_testApplication, QOverload::of(&QProcess::finished), this, [this] (int exitCode, QProcess::ExitStatus /*exitStatus*/) { if (exitCode == 1 && !m_description.isEmpty()) { createAndReportResult(tr("Running tests failed.\n %1\nExecutable: %2") diff --git a/src/plugins/autotest/testrunner.cpp b/src/plugins/autotest/testrunner.cpp index b19e54e4c30..2f9b8b68bb6 100644 --- a/src/plugins/autotest/testrunner.cpp +++ b/src/plugins/autotest/testrunner.cpp @@ -217,8 +217,7 @@ void TestRunner::scheduleNext() } m_currentProcess->setProcessEnvironment(environment.toProcessEnvironment()); - connect(m_currentProcess, - static_cast(&QProcess::finished), + connect(m_currentProcess, QOverload::of(&QProcess::finished), this, &TestRunner::onProcessFinished); const int timeout = AutotestPlugin::settings()->timeout; QTimer::singleShot(timeout, m_currentProcess, [this]() { cancelCurrent(Timeout); }); diff --git a/src/plugins/baremetal/gdbserverprovider.cpp b/src/plugins/baremetal/gdbserverprovider.cpp index cf633d86024..436776d4651 100644 --- a/src/plugins/baremetal/gdbserverprovider.cpp +++ b/src/plugins/baremetal/gdbserverprovider.cpp @@ -258,7 +258,7 @@ GdbServerProviderConfigWidget::GdbServerProviderConfigWidget( connect(m_nameLineEdit, &QLineEdit::textChanged, this, &GdbServerProviderConfigWidget::dirty); connect(m_startupModeComboBox, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, &GdbServerProviderConfigWidget::dirty); } @@ -390,7 +390,7 @@ HostWidget::HostWidget(QWidget *parent) connect(m_hostLineEdit, &QLineEdit::textChanged, this, &HostWidget::dataChanged); - connect(m_portSpinBox, static_cast(&QSpinBox::valueChanged), + connect(m_portSpinBox, QOverload::of(&QSpinBox::valueChanged), this, &HostWidget::dataChanged); } diff --git a/src/plugins/baremetal/gdbserverproviderprocess.cpp b/src/plugins/baremetal/gdbserverproviderprocess.cpp index 45d14d57e0d..a5806149753 100644 --- a/src/plugins/baremetal/gdbserverproviderprocess.cpp +++ b/src/plugins/baremetal/gdbserverproviderprocess.cpp @@ -46,7 +46,7 @@ GdbServerProviderProcess::GdbServerProviderProcess( m_process->setUseCtrlCStub(true); connect(m_process, &QProcess::errorOccurred, this, &GdbServerProviderProcess::error); - connect(m_process, static_cast(&QProcess::finished), + connect(m_process, QOverload::of(&QProcess::finished), this, &GdbServerProviderProcess::finished); connect(m_process, &QProcess::readyReadStandardOutput, diff --git a/src/plugins/beautifier/configurationeditor.cpp b/src/plugins/beautifier/configurationeditor.cpp index 7c98602892a..179864b0b9c 100644 --- a/src/plugins/beautifier/configurationeditor.cpp +++ b/src/plugins/beautifier/configurationeditor.cpp @@ -98,7 +98,7 @@ ConfigurationEditor::ConfigurationEditor(QWidget *parent) : m_completer->setCaseSensitivity(Qt::CaseInsensitive); m_completer->popup()->installEventFilter(this); - connect(m_completer, static_cast(&QCompleter::activated), + connect(m_completer, QOverload::of(&QCompleter::activated), this, &ConfigurationEditor::insertCompleterText); connect(this, &ConfigurationEditor::cursorPositionChanged, this, &ConfigurationEditor::updateDocumentation); diff --git a/src/plugins/beautifier/configurationpanel.cpp b/src/plugins/beautifier/configurationpanel.cpp index 1e5a8dfaa9f..a693d42b99d 100644 --- a/src/plugins/beautifier/configurationpanel.cpp +++ b/src/plugins/beautifier/configurationpanel.cpp @@ -40,7 +40,7 @@ ConfigurationPanel::ConfigurationPanel(QWidget *parent) : connect(ui->add, &QPushButton::clicked, this, &ConfigurationPanel::add); connect(ui->edit, &QPushButton::clicked, this, &ConfigurationPanel::edit); connect(ui->remove, &QPushButton::clicked, this, &ConfigurationPanel::remove); - connect(ui->configurations, static_cast(&QComboBox::currentIndexChanged), + connect(ui->configurations, QOverload::of(&QComboBox::currentIndexChanged), this, &ConfigurationPanel::updateButtons); } diff --git a/src/plugins/clangcodemodel/clangprojectsettingswidget.cpp b/src/plugins/clangcodemodel/clangprojectsettingswidget.cpp index 09caba4a2df..a4bd50e5464 100644 --- a/src/plugins/clangcodemodel/clangprojectsettingswidget.cpp +++ b/src/plugins/clangcodemodel/clangprojectsettingswidget.cpp @@ -68,7 +68,7 @@ ClangProjectSettingsWidget::ClangProjectSettingsWidget(ProjectExplorer::Project connect(m_ui.delayedTemplateParseCheckBox, &QCheckBox::toggled, this, &ClangProjectSettingsWidget::onDelayedTemplateParseClicked); connect(m_ui.globalOrCustomComboBox, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, &ClangProjectSettingsWidget::onGlobalCustomChanged); connect(project, &ProjectExplorer::Project::aboutToSaveSettings, this, &ClangProjectSettingsWidget::onAboutToSaveProjectSettings); diff --git a/src/plugins/clangtools/clangselectablefilesdialog.cpp b/src/plugins/clangtools/clangselectablefilesdialog.cpp index 22c8d150c18..20e1e68098c 100644 --- a/src/plugins/clangtools/clangselectablefilesdialog.cpp +++ b/src/plugins/clangtools/clangselectablefilesdialog.cpp @@ -316,7 +316,7 @@ SelectableFilesDialog::SelectableFilesDialog(const ProjectInfo &projectInfo, } connect(m_ui->globalOrCustom, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), [=](int index){ m_ui->clangToolsBasicSettings->setEnabled(index == CustomSettings); if (index == CustomSettings) { diff --git a/src/plugins/clangtools/clangtoolrunner.cpp b/src/plugins/clangtools/clangtoolrunner.cpp index 227a94c50de..c02d59a7da1 100644 --- a/src/plugins/clangtools/clangtoolrunner.cpp +++ b/src/plugins/clangtools/clangtoolrunner.cpp @@ -75,7 +75,7 @@ ClangToolRunner::ClangToolRunner(const QString &clangExecutable, m_process.setProcessEnvironment(environment.toProcessEnvironment()); m_process.setWorkingDirectory(m_clangLogFileDir); // Current clang-cl puts log file into working dir. connect(&m_process, &QProcess::started, this, &ClangToolRunner::onProcessStarted); - connect(&m_process, static_cast(&QProcess::finished), + connect(&m_process, QOverload::of(&QProcess::finished), this, &ClangToolRunner::onProcessFinished); connect(&m_process, &QProcess::errorOccurred, this, &ClangToolRunner::onProcessError); connect(&m_process, &QProcess::readyRead, this, &ClangToolRunner::onProcessOutput); diff --git a/src/plugins/clangtools/clangtoolsconfigwidget.cpp b/src/plugins/clangtools/clangtoolsconfigwidget.cpp index c42ed9fb47b..ad966ab5180 100644 --- a/src/plugins/clangtools/clangtoolsconfigwidget.cpp +++ b/src/plugins/clangtools/clangtoolsconfigwidget.cpp @@ -52,7 +52,7 @@ ClangToolsConfigWidget::ClangToolsConfigWidget( m_ui->simultaneousProccessesSpinBox->setMinimum(1); m_ui->simultaneousProccessesSpinBox->setMaximum(QThread::idealThreadCount()); connect(m_ui->simultaneousProccessesSpinBox, - static_cast(&QSpinBox::valueChanged), + QOverload::of(&QSpinBox::valueChanged), [settings](int count) { settings->setSimultaneousProcesses(count); }); QCheckBox *buildBeforeAnalysis = m_ui->clangToolsBasicSettings->ui()->buildBeforeAnalysis; diff --git a/src/plugins/clearcase/activityselector.cpp b/src/plugins/clearcase/activityselector.cpp index 8ef25aef40a..8847f6416a7 100644 --- a/src/plugins/clearcase/activityselector.cpp +++ b/src/plugins/clearcase/activityselector.cpp @@ -66,7 +66,7 @@ ActivitySelector::ActivitySelector(QWidget *parent) : QWidget(parent), connect(btnAdd, &QToolButton::clicked, this, &ActivitySelector::newActivity); refresh(); - connect(m_cmbActivity, static_cast(&QComboBox::currentIndexChanged), + connect(m_cmbActivity, QOverload::of(&QComboBox::currentIndexChanged), this, &ActivitySelector::userChanged); } @@ -103,10 +103,10 @@ void ActivitySelector::setActivity(const QString &act) { int index = m_cmbActivity->findData(act); if (index != -1) { - disconnect(m_cmbActivity, static_cast(&QComboBox::currentIndexChanged), + disconnect(m_cmbActivity, QOverload::of(&QComboBox::currentIndexChanged), this, &ActivitySelector::userChanged); m_cmbActivity->setCurrentIndex(index); - connect(m_cmbActivity, static_cast(&QComboBox::currentIndexChanged), + connect(m_cmbActivity, QOverload::of(&QComboBox::currentIndexChanged), this, &ActivitySelector::userChanged); } } diff --git a/src/plugins/coreplugin/dialogs/newdialog.cpp b/src/plugins/coreplugin/dialogs/newdialog.cpp index e89ea9846c4..e691d826ed7 100644 --- a/src/plugins/coreplugin/dialogs/newdialog.cpp +++ b/src/plugins/coreplugin/dialogs/newdialog.cpp @@ -231,7 +231,7 @@ NewDialog::NewDialog(QWidget *parent) : connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &NewDialog::reject); connect(m_ui->comboBox, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, &NewDialog::setSelectedPlatform); } diff --git a/src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp b/src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp index af41349cff3..7392eb5905c 100644 --- a/src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp +++ b/src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp @@ -449,8 +449,8 @@ void ReadOnlyFilesDialogPrivate::initDialog(const QStringList &fileNames) groupForFile.fileName = fileName; groupForFile.group = radioButtonGroup; buttonGroups.append(groupForFile); - QObject::connect(radioButtonGroup, static_cast(&QButtonGroup::buttonClicked), - [this](int) { updateSelectAll(); }); + QObject::connect(radioButtonGroup, QOverload::of(&QButtonGroup::buttonClicked), + [this] { updateSelectAll(); }); } // Apply the Mac file dialog style. @@ -508,7 +508,7 @@ void ReadOnlyFilesDialogPrivate::initDialog(const QStringList &fileNames) ui.setAll->addItem(saveAsText); setAllIndexForOperation[SaveAs] = ui.setAll->count() - 1; } - QObject::connect(ui.setAll, static_cast(&QComboBox::activated), + QObject::connect(ui.setAll, QOverload::of(&QComboBox::activated), [this](int index) { setAll(index); }); // Filter which columns should be visible and resize them to content. diff --git a/src/plugins/coreplugin/editortoolbar.cpp b/src/plugins/coreplugin/editortoolbar.cpp index 55430f1a422..8f516fc6692 100644 --- a/src/plugins/coreplugin/editortoolbar.cpp +++ b/src/plugins/coreplugin/editortoolbar.cpp @@ -190,7 +190,7 @@ EditorToolBar::EditorToolBar(QWidget *parent) : // this signal is disconnected for standalone toolbars and replaced with // a private slot connection - connect(d->m_editorList, static_cast(&QComboBox::activated), + connect(d->m_editorList, QOverload::of(&QComboBox::activated), this, &EditorToolBar::listSelectionActivated); connect(d->m_editorList, &QComboBox::customContextMenuRequested, [this](QPoint p) { @@ -303,9 +303,9 @@ void EditorToolBar::setToolbarCreationFlags(ToolbarCreationFlags flags) connect(EditorManager::instance(), &EditorManager::currentEditorChanged, this, &EditorToolBar::updateEditorListSelection); - disconnect(d->m_editorList, static_cast(&QComboBox::activated), + disconnect(d->m_editorList, QOverload::of(&QComboBox::activated), this, &EditorToolBar::listSelectionActivated); - connect(d->m_editorList, static_cast(&QComboBox::activated), + connect(d->m_editorList, QOverload::of(&QComboBox::activated), this, &EditorToolBar::changeActiveEditor); d->m_splitButton->setVisible(false); d->m_closeSplitButton->setVisible(false); diff --git a/src/plugins/coreplugin/externaltool.cpp b/src/plugins/coreplugin/externaltool.cpp index 15f7a97660e..24a40db3eb7 100644 --- a/src/plugins/coreplugin/externaltool.cpp +++ b/src/plugins/coreplugin/externaltool.cpp @@ -654,7 +654,7 @@ void ExternalToolRunner::run() } m_process = new QtcProcess(this); connect(m_process, &QProcess::started, this, &ExternalToolRunner::started); - connect(m_process, static_cast(&QProcess::finished), + connect(m_process, QOverload::of(&QProcess::finished), this, &ExternalToolRunner::finished); connect(m_process, &QProcess::errorOccurred, this, &ExternalToolRunner::error); connect(m_process, &QProcess::readyReadStandardOutput, diff --git a/src/plugins/coreplugin/find/findtoolbar.cpp b/src/plugins/coreplugin/find/findtoolbar.cpp index 4307ba388d0..7492c330281 100644 --- a/src/plugins/coreplugin/find/findtoolbar.cpp +++ b/src/plugins/coreplugin/find/findtoolbar.cpp @@ -118,8 +118,7 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind) this, &FindToolBar::invokeFindEnter, Qt::QueuedConnection); connect(m_ui.replaceEdit, &Utils::FancyLineEdit::returnPressed, this, &FindToolBar::invokeReplaceEnter, Qt::QueuedConnection); - connect(m_findCompleter, - static_cast(&QCompleter::activated), + connect(m_findCompleter, QOverload::of(&QCompleter::activated), this, &FindToolBar::findCompleterActivated); auto shiftEnterAction = new QAction(m_ui.findEdit); diff --git a/src/plugins/coreplugin/find/findtoolwindow.cpp b/src/plugins/coreplugin/find/findtoolwindow.cpp index 04f138a1515..0490e8481fe 100644 --- a/src/plugins/coreplugin/find/findtoolwindow.cpp +++ b/src/plugins/coreplugin/find/findtoolwindow.cpp @@ -77,14 +77,13 @@ FindToolWindow::FindToolWindow(QWidget *parent) connect(m_ui.matchCase, &QAbstractButton::toggled, Find::instance(), &Find::setCaseSensitive); connect(m_ui.wholeWords, &QAbstractButton::toggled, Find::instance(), &Find::setWholeWord); connect(m_ui.regExp, &QAbstractButton::toggled, Find::instance(), &Find::setRegularExpression); - connect(m_ui.filterList, static_cast(&QComboBox::activated), - this, static_cast(&FindToolWindow::setCurrentFilter)); + connect(m_ui.filterList, QOverload::of(&QComboBox::activated), + this, QOverload::of(&FindToolWindow::setCurrentFilter)); m_findCompleter->setModel(Find::findCompletionModel()); m_ui.searchTerm->setSpecialCompleter(m_findCompleter); m_ui.searchTerm->installEventFilter(this); - connect(m_findCompleter, - static_cast(&QCompleter::activated), + connect(m_findCompleter, QOverload::of(&QCompleter::activated), this, &FindToolWindow::findCompleterActivated); m_ui.searchTerm->setValidationFunction(validateRegExp); diff --git a/src/plugins/coreplugin/find/highlightscrollbarcontroller.cpp b/src/plugins/coreplugin/find/highlightscrollbarcontroller.cpp index 2ea32798de9..b9d07b70da4 100644 --- a/src/plugins/coreplugin/find/highlightscrollbarcontroller.cpp +++ b/src/plugins/coreplugin/find/highlightscrollbarcontroller.cpp @@ -92,7 +92,7 @@ void HighlightScrollBarOverlay::scheduleUpdate() return; m_isCacheUpdateScheduled = true; - QTimer::singleShot(0, this, static_cast(&QWidget::update)); + QTimer::singleShot(0, this, QOverload<>::of(&QWidget::update)); } void HighlightScrollBarOverlay::paintEvent(QPaintEvent *paintEvent) diff --git a/src/plugins/coreplugin/find/searchresultwindow.cpp b/src/plugins/coreplugin/find/searchresultwindow.cpp index 7cea0166d10..b064c11bb55 100644 --- a/src/plugins/coreplugin/find/searchresultwindow.cpp +++ b/src/plugins/coreplugin/find/searchresultwindow.cpp @@ -124,7 +124,7 @@ namespace Internal { m_recentSearchesBox->setProperty("drawleftborder", true); m_recentSearchesBox->setSizeAdjustPolicy(QComboBox::AdjustToContents); m_recentSearchesBox->addItem(tr("New Search")); - connect(m_recentSearchesBox, static_cast(&QComboBox::activated), + connect(m_recentSearchesBox, QOverload::of(&QComboBox::activated), this, &SearchResultWindowPrivate::setCurrentIndexWithFocus); m_widget->setWindowTitle(q->displayName()); diff --git a/src/plugins/coreplugin/locator/executefilter.cpp b/src/plugins/coreplugin/locator/executefilter.cpp index b85bf4ff281..52766ed9f48 100644 --- a/src/plugins/coreplugin/locator/executefilter.cpp +++ b/src/plugins/coreplugin/locator/executefilter.cpp @@ -44,7 +44,7 @@ ExecuteFilter::ExecuteFilter() m_process = new Utils::QtcProcess(this); m_process->setEnvironment(Utils::Environment::systemEnvironment()); - connect(m_process, static_cast(&QProcess::finished), + connect(m_process, QOverload::of(&QProcess::finished), this, &ExecuteFilter::finished); connect(m_process, &QProcess::readyReadStandardOutput, this, &ExecuteFilter::readStandardOutput); connect(m_process, &QProcess::readyReadStandardError, this, &ExecuteFilter::readStandardError); diff --git a/src/plugins/coreplugin/mimetypemagicdialog.cpp b/src/plugins/coreplugin/mimetypemagicdialog.cpp index 5c1566d0222..36a5f099c6f 100644 --- a/src/plugins/coreplugin/mimetypemagicdialog.cpp +++ b/src/plugins/coreplugin/mimetypemagicdialog.cpp @@ -55,7 +55,7 @@ MimeTypeMagicDialog::MimeTypeMagicDialog(QWidget *parent) : connect(ui.informationLabel, &QLabel::linkActivated, this, [](const QString &link) { QDesktopServices::openUrl(QUrl(link)); }); - connect(ui.typeSelector, static_cast(&QComboBox::activated), + connect(ui.typeSelector, QOverload::of(&QComboBox::activated), this, [this]() { if (ui.useRecommendedGroupBox->isChecked()) setToRecommendedValues(); diff --git a/src/plugins/coreplugin/navigationsubwidget.cpp b/src/plugins/coreplugin/navigationsubwidget.cpp index c8aed179c5f..ab4858e3882 100644 --- a/src/plugins/coreplugin/navigationsubwidget.cpp +++ b/src/plugins/coreplugin/navigationsubwidget.cpp @@ -97,7 +97,7 @@ NavigationSubWidget::NavigationSubWidget(NavigationWidget *parentWidget, int pos setFactoryIndex(factoryIndex); connect(m_navigationComboBox, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, &NavigationSubWidget::comboBoxIndexChanged); comboBoxIndexChanged(factoryIndex); diff --git a/src/plugins/coreplugin/outputpanemanager.cpp b/src/plugins/coreplugin/outputpanemanager.cpp index 463c34e64a8..3f19d4b9b94 100644 --- a/src/plugins/coreplugin/outputpanemanager.cpp +++ b/src/plugins/coreplugin/outputpanemanager.cpp @@ -636,7 +636,7 @@ OutputPaneToggleButton::OutputPaneToggleButton(int number, const QString &text, m_flashTimer->setDirection(QTimeLine::Forward); m_flashTimer->setCurveShape(QTimeLine::SineCurve); m_flashTimer->setFrameRange(0, 92); - auto updateSlot = static_cast(&QWidget::update); + auto updateSlot = QOverload<>::of(&QWidget::update); connect(m_flashTimer, &QTimeLine::valueChanged, this, updateSlot); connect(m_flashTimer, &QTimeLine::finished, this, updateSlot); updateToolTip(); diff --git a/src/plugins/coreplugin/sidebarwidget.cpp b/src/plugins/coreplugin/sidebarwidget.cpp index daad4cf8131..fd561611c2e 100644 --- a/src/plugins/coreplugin/sidebarwidget.cpp +++ b/src/plugins/coreplugin/sidebarwidget.cpp @@ -99,7 +99,7 @@ SideBarWidget::SideBarWidget(SideBar *sideBar, const QString &id) } setCurrentItem(t); - connect(m_comboBox, static_cast(&QComboBox::currentIndexChanged), + connect(m_comboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &SideBarWidget::setCurrentIndex); } diff --git a/src/plugins/cpaster/pasteselectdialog.cpp b/src/plugins/cpaster/pasteselectdialog.cpp index 32337e48f02..193c49525b6 100644 --- a/src/plugins/cpaster/pasteselectdialog.cpp +++ b/src/plugins/cpaster/pasteselectdialog.cpp @@ -44,7 +44,7 @@ PasteSelectDialog::PasteSelectDialog(const QList &protocols, m_ui.protocolBox->addItem(protocol->name()); connect(protocol, &Protocol::listDone, this, &PasteSelectDialog::listDone); } - connect(m_ui.protocolBox, static_cast(&QComboBox::currentIndexChanged), + connect(m_ui.protocolBox, QOverload::of(&QComboBox::currentIndexChanged), this, &PasteSelectDialog::protocolChanged); m_refreshButton = m_ui.buttons->addButton(tr("Refresh"), QDialogButtonBox::ActionRole); diff --git a/src/plugins/cpaster/pasteview.cpp b/src/plugins/cpaster/pasteview.cpp index 0035fe10d31..17ad2abcfc0 100644 --- a/src/plugins/cpaster/pasteview.cpp +++ b/src/plugins/cpaster/pasteview.cpp @@ -53,7 +53,7 @@ PasteView::PasteView(const QList &protocols, foreach (const Protocol *p, protocols) m_ui.protocolBox->addItem(p->name()); - connect(m_ui.protocolBox, static_cast(&QComboBox::currentIndexChanged), + connect(m_ui.protocolBox, QOverload::of(&QComboBox::currentIndexChanged), this, &PasteView::protocolChanged); } diff --git a/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp b/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp index 1cedfbfd9d0..5f53fe316b4 100644 --- a/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp +++ b/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp @@ -1389,7 +1389,7 @@ CppCodeModelInspectorDialog::CppCodeModelInspectorDialog(QWidget *parent) connect(m_snapshotView, &FilterableView::filterChanged, this, &CppCodeModelInspectorDialog::onSnapshotFilterChanged); connect(m_ui->snapshotSelector, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, &CppCodeModelInspectorDialog::onSnapshotSelected); connect(m_ui->docSymbolsView, &QTreeView::expanded, this, &CppCodeModelInspectorDialog::onSymbolsViewExpandedOrCollapsed); diff --git a/src/plugins/cppeditor/cppparsecontext.cpp b/src/plugins/cppeditor/cppparsecontext.cpp index ef941f44d28..7c98fbba8f7 100644 --- a/src/plugins/cppeditor/cppparsecontext.cpp +++ b/src/plugins/cppeditor/cppparsecontext.cpp @@ -149,7 +149,7 @@ ParseContextWidget::ParseContextWidget(ParseContextModel &parseContextModel, QWi // Set up sync of this widget and model in both directions connect(this, - static_cast(&QComboBox::activated), + QOverload::of(&QComboBox::activated), &m_parseContextModel, &ParseContextModel::setPreferred); connect(&m_parseContextModel, &ParseContextModel::updated, diff --git a/src/plugins/cpptools/clangdiagnosticconfigswidget.cpp b/src/plugins/cpptools/clangdiagnosticconfigswidget.cpp index e5ff4cd9f54..e19a94513d7 100644 --- a/src/plugins/cpptools/clangdiagnosticconfigswidget.cpp +++ b/src/plugins/cpptools/clangdiagnosticconfigswidget.cpp @@ -910,7 +910,7 @@ void ClangDiagnosticConfigsWidget::updateValidityWidgets(const QString &errorMes void ClangDiagnosticConfigsWidget::connectClangTidyItemChanged() { connect(m_tidyChecks->tidyMode, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, &ClangDiagnosticConfigsWidget::onClangTidyModeChanged); connect(m_tidyTreeModel.get(), &TidyChecksTreeModel::dataChanged, @@ -920,7 +920,7 @@ void ClangDiagnosticConfigsWidget::connectClangTidyItemChanged() void ClangDiagnosticConfigsWidget::disconnectClangTidyItemChanged() { disconnect(m_tidyChecks->tidyMode, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, &ClangDiagnosticConfigsWidget::onClangTidyModeChanged); disconnect(m_tidyTreeModel.get(), &TidyChecksTreeModel::dataChanged, diff --git a/src/plugins/cpptools/cppeditoroutline.cpp b/src/plugins/cpptools/cppeditoroutline.cpp index d7840016d59..627385f107e 100644 --- a/src/plugins/cpptools/cppeditoroutline.cpp +++ b/src/plugins/cpptools/cppeditoroutline.cpp @@ -124,9 +124,9 @@ CppEditorOutline::CppEditorOutline(TextEditor::TextEditorWidget *editorWidget) &CppTools::CppToolsSettings::setSortedEditorDocumentOutline); m_combo->addAction(m_sortAction); - connect(m_combo, static_cast(&QComboBox::activated), + connect(m_combo, QOverload::of(&QComboBox::activated), this, &CppEditorOutline::gotoSymbolInEditor); - connect(m_combo, static_cast(&QComboBox::currentIndexChanged), + connect(m_combo, QOverload::of(&QComboBox::currentIndexChanged), this, &CppEditorOutline::updateToolTip); // Set up timers diff --git a/src/plugins/debugger/analyzer/analyzerrunconfigwidget.cpp b/src/plugins/debugger/analyzer/analyzerrunconfigwidget.cpp index 137e0612b4d..39a3684ab36 100644 --- a/src/plugins/debugger/analyzer/analyzerrunconfigwidget.cpp +++ b/src/plugins/debugger/analyzer/analyzerrunconfigwidget.cpp @@ -52,7 +52,7 @@ AnalyzerRunConfigWidget::AnalyzerRunConfigWidget(ProjectExplorer::GlobalOrProjec QApplication::translate("ProjectExplorer::Internal::EditorSettingsPropertiesPage", "Custom") })); globalSettingLayout->addWidget(m_settingsCombo); - connect(m_settingsCombo, static_cast(&QComboBox::activated), + connect(m_settingsCombo, QOverload::of(&QComboBox::activated), this, &AnalyzerRunConfigWidget::chooseSettings); m_restoreButton = new QPushButton( QApplication::translate("ProjectExplorer::Internal::EditorSettingsPropertiesPage", "Restore Global"), diff --git a/src/plugins/debugger/debuggerkitinformation.cpp b/src/plugins/debugger/debuggerkitinformation.cpp index 9b38456c982..8d45d121510 100644 --- a/src/plugins/debugger/debuggerkitinformation.cpp +++ b/src/plugins/debugger/debuggerkitinformation.cpp @@ -68,7 +68,7 @@ public: refresh(); m_comboBox->setToolTip(ki->description()); - connect(m_comboBox, static_cast(&QComboBox::currentIndexChanged), + connect(m_comboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &DebuggerKitAspectWidget::currentDebuggerChanged); m_manageButton = new QPushButton(KitAspectWidget::msgManage()); diff --git a/src/plugins/debugger/debuggermainwindow.cpp b/src/plugins/debugger/debuggermainwindow.cpp index a84b8e2781b..76f6301db61 100644 --- a/src/plugins/debugger/debuggermainwindow.cpp +++ b/src/plugins/debugger/debuggermainwindow.cpp @@ -144,7 +144,7 @@ DebuggerMainWindowPrivate::DebuggerMainWindowPrivate(DebuggerMainWindow *parent) m_perspectiveChooser->setObjectName("PerspectiveChooser"); m_perspectiveChooser->setProperty("panelwidget", true); m_perspectiveChooser->setSizeAdjustPolicy(QComboBox::AdjustToContents); - connect(m_perspectiveChooser, static_cast(&QComboBox::activated), + connect(m_perspectiveChooser, QOverload::of(&QComboBox::activated), this, [this](int item) { Perspective *perspective = Perspective::findPerspective(m_perspectiveChooser->itemData(item).toString()); QTC_ASSERT(perspective, return); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 8d2af5008a7..4117487c6a7 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -133,7 +133,7 @@ GdbEngine::GdbEngine() connect(&m_gdbProc, &QProcess::errorOccurred, this, &GdbEngine::handleGdbError); - connect(&m_gdbProc, static_cast(&QProcess::finished), + connect(&m_gdbProc, QOverload::of(&QProcess::finished), this, &GdbEngine::handleGdbFinished); connect(&m_gdbProc, &QtcProcess::readyReadStandardOutput, this, &GdbEngine::readGdbStandardOutput); diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 0dee8826a7f..f0c76422575 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -100,7 +100,7 @@ LldbEngine::LldbEngine() connect(&m_lldbProc, &QProcess::errorOccurred, this, &LldbEngine::handleLldbError); - connect(&m_lldbProc, static_cast(&QProcess::finished), + connect(&m_lldbProc, QOverload::of(&QProcess::finished), this, &LldbEngine::handleLldbFinished); connect(&m_lldbProc, &QProcess::readyReadStandardOutput, this, &LldbEngine::readLldbStandardOutput); diff --git a/src/plugins/designer/qtcreatorintegration.cpp b/src/plugins/designer/qtcreatorintegration.cpp index 9d3f9919a0a..f8e9cf66427 100644 --- a/src/plugins/designer/qtcreatorintegration.cpp +++ b/src/plugins/designer/qtcreatorintegration.cpp @@ -86,8 +86,7 @@ QtCreatorIntegration::QtCreatorIntegration(QDesignerFormEditorInterface *core, Q f &= ~ResourceEditorFeature; setFeatures(f); - connect(this, static_cast + connect(this, QOverload::of (&QDesignerIntegrationInterface::navigateToSlot), this, &QtCreatorIntegration::slotNavigateToSlot); connect(this, &QtCreatorIntegration::helpRequested, diff --git a/src/plugins/diffeditor/diffeditor.cpp b/src/plugins/diffeditor/diffeditor.cpp index 3e86febfab6..21aadbc3c34 100644 --- a/src/plugins/diffeditor/diffeditor.cpp +++ b/src/plugins/diffeditor/diffeditor.cpp @@ -179,7 +179,7 @@ DiffEditor::DiffEditor() QSizePolicy policy = m_entriesComboBox->sizePolicy(); policy.setHorizontalPolicy(QSizePolicy::Expanding); m_entriesComboBox->setSizePolicy(policy); - connect(m_entriesComboBox, static_cast(&QComboBox::currentIndexChanged), + connect(m_entriesComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &DiffEditor::setCurrentDiffFileIndex); m_toolBar->addWidget(m_entriesComboBox); @@ -209,7 +209,7 @@ DiffEditor::DiffEditor() m_viewSwitcherAction = m_toolBar->addAction(QIcon(), QString()); connect(m_whitespaceButtonAction, &QAction::toggled, this, &DiffEditor::ignoreWhitespaceHasChanged); - connect(m_contextSpinBox, static_cast(&QSpinBox::valueChanged), + connect(m_contextSpinBox, QOverload::of(&QSpinBox::valueChanged), this, &DiffEditor::contextLineCountHasChanged); connect(m_toggleSyncAction, &QAction::toggled, this, &DiffEditor::toggleSync); connect(m_toggleDescriptionAction, &QAction::toggled, this, &DiffEditor::toggleDescription); diff --git a/src/plugins/git/gerrit/gerritmodel.cpp b/src/plugins/git/gerrit/gerritmodel.cpp index 6c53345ef99..931ce338d8c 100644 --- a/src/plugins/git/gerrit/gerritmodel.cpp +++ b/src/plugins/git/gerrit/gerritmodel.cpp @@ -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(&QProcess::finished), + connect(&m_process, QOverload::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(&QProcess::finished), + connect(&m_process, QOverload::of(&QProcess::finished), &box, &QDialog::reject); box.exec(); if (m_process.state() != QProcess::Running) diff --git a/src/plugins/git/gerrit/gerritplugin.cpp b/src/plugins/git/gerrit/gerritplugin.cpp index 3cc82f5c459..a18a0492bf1 100644 --- a/src/plugins/git/gerrit/gerritplugin.cpp +++ b/src/plugins/git/gerrit/gerritplugin.cpp @@ -140,7 +140,7 @@ FetchContext::FetchContext(const QSharedPointer &change, , m_state(FetchState) { connect(&m_process, &QProcess::errorOccurred, this, &FetchContext::processError); - connect(&m_process, static_cast(&QProcess::finished), + connect(&m_process, QOverload::of(&QProcess::finished), this, &FetchContext::processFinished); connect(&m_process, &QProcess::readyReadStandardError, this, &FetchContext::processReadyReadStandardError); diff --git a/src/plugins/git/gerrit/gerritpushdialog.cpp b/src/plugins/git/gerrit/gerritpushdialog.cpp index 70f0ffa3b6b..a59f615b572 100644 --- a/src/plugins/git/gerrit/gerritpushdialog.cpp +++ b/src/plugins/git/gerrit/gerritpushdialog.cpp @@ -146,10 +146,10 @@ GerritPushDialog::GerritPushDialog(const QString &workingDir, const QString &rev } m_ui->localBranchComboBox->init(workingDir); - connect(m_ui->localBranchComboBox, static_cast(&QComboBox::currentIndexChanged), + connect(m_ui->localBranchComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &GerritPushDialog::updateCommits); - connect(m_ui->targetBranchComboBox, static_cast(&QComboBox::currentIndexChanged), + connect(m_ui->targetBranchComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &GerritPushDialog::setChangeRange); connect(m_ui->targetBranchComboBox, &QComboBox::currentTextChanged, diff --git a/src/plugins/help/helpwidget.cpp b/src/plugins/help/helpwidget.cpp index d07cf9e1458..64f76e4e6cb 100644 --- a/src/plugins/help/helpwidget.cpp +++ b/src/plugins/help/helpwidget.cpp @@ -220,7 +220,7 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget m_filterComboBox->setModel(LocalHelpManager::filterModel()); m_filterComboBox->setCurrentIndex(LocalHelpManager::filterIndex()); layout->addWidget(m_filterComboBox); - connect(m_filterComboBox, static_cast(&QComboBox::activated), + connect(m_filterComboBox, QOverload::of(&QComboBox::activated), LocalHelpManager::instance(), &LocalHelpManager::setFilterIndex); connect(LocalHelpManager::instance(), &LocalHelpManager::filterIndexChanged, m_filterComboBox, &QComboBox::setCurrentIndex); diff --git a/src/plugins/help/openpagesmanager.cpp b/src/plugins/help/openpagesmanager.cpp index 63d9a5cda01..a6b6168dcd0 100644 --- a/src/plugins/help/openpagesmanager.cpp +++ b/src/plugins/help/openpagesmanager.cpp @@ -61,7 +61,7 @@ OpenPagesManager::OpenPagesManager(QObject *parent) m_comboBox = new QComboBox; m_comboBox->setModel(m_model); m_comboBox->setContextMenuPolicy(Qt::CustomContextMenu); - connect(m_comboBox, static_cast(&QComboBox::activated), + connect(m_comboBox, QOverload::of(&QComboBox::activated), this, &OpenPagesManager::setCurrentPageByRow); connect(m_comboBox, &QWidget::customContextMenuRequested, this, &OpenPagesManager::openPagesContextMenu); diff --git a/src/plugins/ios/iostoolhandler.cpp b/src/plugins/ios/iostoolhandler.cpp index 2526ecfdc3c..d01e0c01143 100644 --- a/src/plugins/ios/iostoolhandler.cpp +++ b/src/plugins/ios/iostoolhandler.cpp @@ -676,7 +676,7 @@ IosDeviceToolHandlerPrivate::IosDeviceToolHandlerPrivate(const IosDeviceType &de QObject::connect(process.get(), &QProcess::readyReadStandardOutput, std::bind(&IosDeviceToolHandlerPrivate::subprocessHasData,this)); - QObject::connect(process.get(), static_cast(&QProcess::finished), + QObject::connect(process.get(), QOverload::of(&QProcess::finished), std::bind(&IosDeviceToolHandlerPrivate::subprocessFinished,this, _1,_2)); QObject::connect(process.get(), &QProcess::errorOccurred, diff --git a/src/plugins/modeleditor/modeleditor.cpp b/src/plugins/modeleditor/modeleditor.cpp index 56c03ba9a1b..67ee3a6294c 100644 --- a/src/plugins/modeleditor/modeleditor.cpp +++ b/src/plugins/modeleditor/modeleditor.cpp @@ -321,7 +321,7 @@ void ModelEditor::init(QWidget *parent) toolbarLayout->addWidget(openParentButton); d->diagramSelector = new QComboBox(d->toolbar); - connect(d->diagramSelector, static_cast(&QComboBox::activated), + connect(d->diagramSelector, QOverload::of(&QComboBox::activated), this, &ModelEditor::onDiagramSelectorSelected); toolbarLayout->addWidget(d->diagramSelector, 1); toolbarLayout->addStretch(1); diff --git a/src/plugins/perforce/perforcechecker.cpp b/src/plugins/perforce/perforcechecker.cpp index 92dd5a4cc42..2d27f8444ec 100644 --- a/src/plugins/perforce/perforcechecker.cpp +++ b/src/plugins/perforce/perforcechecker.cpp @@ -42,7 +42,7 @@ namespace Internal { PerforceChecker::PerforceChecker(QObject *parent) : QObject(parent) { connect(&m_process, &QProcess::errorOccurred, this, &PerforceChecker::slotError); - connect(&m_process, static_cast(&QProcess::finished), + connect(&m_process, QOverload::of(&QProcess::finished), this, &PerforceChecker::slotFinished); } diff --git a/src/plugins/perfprofiler/perfconfigwidget.cpp b/src/plugins/perfprofiler/perfconfigwidget.cpp index 287808244d2..b267c2923f8 100644 --- a/src/plugins/perfprofiler/perfconfigwidget.cpp +++ b/src/plugins/perfprofiler/perfconfigwidget.cpp @@ -83,7 +83,7 @@ PerfConfigWidget::PerfConfigWidget(PerfSettings *settings, QWidget *parent) : m_ui->stackSize->setEnabled(mode == QLatin1String(Constants::PerfCallgraphDwarf)); }); - auto spinBoxChangedSignal = static_cast(&QSpinBox::valueChanged); + auto spinBoxChangedSignal = QOverload::of(&QSpinBox::valueChanged); connect(m_ui->stackSize, spinBoxChangedSignal, m_settings, &PerfSettings::setStackSize); connect(m_ui->period, spinBoxChangedSignal, m_settings, &PerfSettings::setPeriod); connect(m_ui->sampleMode, comboboxChangedSignal, this, [this](int index) { diff --git a/src/plugins/perfprofiler/perfdatareader.cpp b/src/plugins/perfprofiler/perfdatareader.cpp index c137e87b8cb..f4b0d19c3c4 100644 --- a/src/plugins/perfprofiler/perfdatareader.cpp +++ b/src/plugins/perfprofiler/perfdatareader.cpp @@ -64,7 +64,7 @@ PerfDataReader::PerfDataReader(QObject *parent) : m_remoteProcessStart(std::numeric_limits::max()), m_lastRemoteTimestamp(0) { - connect(&m_input, static_cast(&QProcess::finished), + connect(&m_input, QOverload::of(&QProcess::finished), this, [this](int exitCode) { emit processFinished(); // process any remaining input before signaling finished() diff --git a/src/plugins/projectexplorer/abiwidget.cpp b/src/plugins/projectexplorer/abiwidget.cpp index d4a3070d695..835dff757de 100644 --- a/src/plugins/projectexplorer/abiwidget.cpp +++ b/src/plugins/projectexplorer/abiwidget.cpp @@ -85,7 +85,7 @@ AbiWidget::AbiWidget(QWidget *parent) : QWidget(parent), d->m_abi->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLengthWithIcon); d->m_abi->setMinimumContentsLength(4); layout->addWidget(d->m_abi); - connect(d->m_abi, static_cast(&QComboBox::currentIndexChanged), + connect(d->m_abi, QOverload::of(&QComboBox::currentIndexChanged), this, &AbiWidget::mainComboBoxChanged); d->m_architectureComboBox = new QComboBox(this); @@ -93,7 +93,7 @@ AbiWidget::AbiWidget(QWidget *parent) : QWidget(parent), for (int i = 0; i <= static_cast(Abi::UnknownArchitecture); ++i) d->m_architectureComboBox->addItem(Abi::toString(static_cast(i)), i); d->m_architectureComboBox->setCurrentIndex(static_cast(Abi::UnknownArchitecture)); - connect(d->m_architectureComboBox, static_cast(&QComboBox::currentIndexChanged), + connect(d->m_architectureComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &AbiWidget::customComboBoxesChanged); QLabel *separator1 = new QLabel(this); @@ -106,7 +106,7 @@ AbiWidget::AbiWidget(QWidget *parent) : QWidget(parent), for (int i = 0; i <= static_cast(Abi::UnknownOS); ++i) d->m_osComboBox->addItem(Abi::toString(static_cast(i)), i); d->m_osComboBox->setCurrentIndex(static_cast(Abi::UnknownOS)); - connect(d->m_osComboBox, static_cast(&QComboBox::currentIndexChanged), + connect(d->m_osComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &AbiWidget::customOsComboBoxChanged); QLabel *separator2 = new QLabel(this); @@ -116,7 +116,7 @@ AbiWidget::AbiWidget(QWidget *parent) : QWidget(parent), d->m_osFlavorComboBox = new QComboBox(this); layout->addWidget(d->m_osFlavorComboBox); - connect(d->m_osFlavorComboBox, static_cast(&QComboBox::currentIndexChanged), + connect(d->m_osFlavorComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &AbiWidget::customComboBoxesChanged); QLabel *separator3 = new QLabel(this); @@ -129,7 +129,7 @@ AbiWidget::AbiWidget(QWidget *parent) : QWidget(parent), for (int i = 0; i <= static_cast(Abi::UnknownFormat); ++i) d->m_binaryFormatComboBox->addItem(Abi::toString(static_cast(i)), i); d->m_binaryFormatComboBox->setCurrentIndex(static_cast(Abi::UnknownFormat)); - connect(d->m_binaryFormatComboBox, static_cast(&QComboBox::currentIndexChanged), + connect(d->m_binaryFormatComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &AbiWidget::customComboBoxesChanged); QLabel *separator4 = new QLabel(this); @@ -144,7 +144,7 @@ AbiWidget::AbiWidget(QWidget *parent) : QWidget(parent), d->m_wordWidthComboBox->addItem(Abi::toString(64), 64); d->m_wordWidthComboBox->addItem(Abi::toString(0), 0); d->m_wordWidthComboBox->setCurrentIndex(2); - connect(d->m_wordWidthComboBox, static_cast(&QComboBox::currentIndexChanged), + connect(d->m_wordWidthComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &AbiWidget::customComboBoxesChanged); layout->setStretchFactor(d->m_abi, 1); diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index e85a9648ec7..d2c0ba87aab 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -237,7 +237,7 @@ void AbstractProcessStep::doRun() this, &AbstractProcessStep::processReadyReadStdOutput); connect(d->m_process.get(), &QProcess::readyReadStandardError, this, &AbstractProcessStep::processReadyReadStdError); - connect(d->m_process.get(), static_cast(&QProcess::finished), + connect(d->m_process.get(), QOverload::of(&QProcess::finished), this, &AbstractProcessStep::slotProcessFinished); d->m_process->start(); diff --git a/src/plugins/projectexplorer/applicationlauncher.cpp b/src/plugins/projectexplorer/applicationlauncher.cpp index 3aef28f0903..79f093d0985 100644 --- a/src/plugins/projectexplorer/applicationlauncher.cpp +++ b/src/plugins/projectexplorer/applicationlauncher.cpp @@ -137,7 +137,7 @@ ApplicationLauncherPrivate::ApplicationLauncherPrivate(ApplicationLauncher *pare this, &ApplicationLauncherPrivate::readLocalStandardOutput); connect(&m_guiProcess, &QProcess::errorOccurred, this, &ApplicationLauncherPrivate::localGuiProcessError); - connect(&m_guiProcess, static_cast(&QProcess::finished), + connect(&m_guiProcess, QOverload::of(&QProcess::finished), this, &ApplicationLauncherPrivate::localProcessDone); connect(&m_guiProcess, &QProcess::started, this, &ApplicationLauncherPrivate::handleProcessStarted); @@ -152,8 +152,7 @@ ApplicationLauncherPrivate::ApplicationLauncherPrivate(ApplicationLauncher *pare this, &ApplicationLauncherPrivate::localConsoleProcessError); connect(&m_consoleProcess, &ConsoleProcess::processStopped, this, &ApplicationLauncherPrivate::localProcessDone); - connect(&m_consoleProcess, - static_cast(&ConsoleProcess::error), + connect(&m_consoleProcess, QOverload::of(&ConsoleProcess::error), q, &ApplicationLauncher::error); #ifdef Q_OS_WIN diff --git a/src/plugins/projectexplorer/buildsettingspropertiespage.cpp b/src/plugins/projectexplorer/buildsettingspropertiespage.cpp index 772740abd21..481c37eef0e 100644 --- a/src/plugins/projectexplorer/buildsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/buildsettingspropertiespage.cpp @@ -119,7 +119,7 @@ BuildSettingsWidget::BuildSettingsWidget(Target *target) : updateAddButtonMenu(); updateBuildSettings(); - connect(m_buildConfigurationComboBox, static_cast(&QComboBox::currentIndexChanged), + connect(m_buildConfigurationComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &BuildSettingsWidget::currentIndexChanged); connect(m_removeButton, &QAbstractButton::clicked, diff --git a/src/plugins/projectexplorer/codestylesettingspropertiespage.cpp b/src/plugins/projectexplorer/codestylesettingspropertiespage.cpp index 9410c499316..5c25cb83d8e 100644 --- a/src/plugins/projectexplorer/codestylesettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/codestylesettingspropertiespage.cpp @@ -56,7 +56,7 @@ CodeStyleSettingsWidget::CodeStyleSettingsWidget(Project *project) : QWidget(), m_ui.languageComboBox->addItem(factory->displayName()); } - connect(m_ui.languageComboBox, static_cast(&QComboBox::currentIndexChanged), + connect(m_ui.languageComboBox, QOverload::of(&QComboBox::currentIndexChanged), m_ui.stackedWidget, &QStackedWidget::setCurrentIndex); } diff --git a/src/plugins/projectexplorer/customparserconfigdialog.cpp b/src/plugins/projectexplorer/customparserconfigdialog.cpp index b688e8aca10..061d1814ed4 100644 --- a/src/plugins/projectexplorer/customparserconfigdialog.cpp +++ b/src/plugins/projectexplorer/customparserconfigdialog.cpp @@ -42,20 +42,20 @@ CustomParserConfigDialog::CustomParserConfigDialog(QDialog *parent) : connect(ui->errorPattern, &QLineEdit::textChanged, this, &CustomParserConfigDialog::changed); connect(ui->errorOutputMessage, &QLineEdit::textChanged, this, &CustomParserConfigDialog::changed); - connect(ui->errorFileNameCap, static_cast(&QSpinBox::valueChanged), + connect(ui->errorFileNameCap, QOverload::of(&QSpinBox::valueChanged), this, &CustomParserConfigDialog::changed); - connect(ui->errorLineNumberCap, static_cast(&QSpinBox::valueChanged), + connect(ui->errorLineNumberCap, QOverload::of(&QSpinBox::valueChanged), this, &CustomParserConfigDialog::changed); - connect(ui->errorMessageCap, static_cast(&QSpinBox::valueChanged), + connect(ui->errorMessageCap, QOverload::of(&QSpinBox::valueChanged), this, &CustomParserConfigDialog::changed); connect(ui->warningPattern, &QLineEdit::textChanged, this, &CustomParserConfigDialog::changed); connect(ui->warningOutputMessage, &QLineEdit::textChanged, this, &CustomParserConfigDialog::changed); - connect(ui->warningFileNameCap, static_cast(&QSpinBox::valueChanged), + connect(ui->warningFileNameCap, QOverload::of(&QSpinBox::valueChanged), this, &CustomParserConfigDialog::changed); - connect(ui->warningLineNumberCap, static_cast(&QSpinBox::valueChanged), + connect(ui->warningLineNumberCap, QOverload::of(&QSpinBox::valueChanged), this, &CustomParserConfigDialog::changed); - connect(ui->warningMessageCap, static_cast(&QSpinBox::valueChanged), + connect(ui->warningMessageCap, QOverload::of(&QSpinBox::valueChanged), this, &CustomParserConfigDialog::changed); changed(); diff --git a/src/plugins/projectexplorer/customtoolchain.cpp b/src/plugins/projectexplorer/customtoolchain.cpp index 1833875102c..0a1a2e5b050 100644 --- a/src/plugins/projectexplorer/customtoolchain.cpp +++ b/src/plugins/projectexplorer/customtoolchain.cpp @@ -566,7 +566,7 @@ CustomToolChainConfigWidget::CustomToolChainConfigWidget(CustomToolChain *tc) : this, &CustomToolChainConfigWidget::updateSummaries); connect(m_cxx11Flags, &QLineEdit::textChanged, this, &ToolChainConfigWidget::dirty); connect(m_mkspecs, &QLineEdit::textChanged, this, &ToolChainConfigWidget::dirty); - connect(m_errorParserComboBox, static_cast(&QComboBox::currentIndexChanged), + connect(m_errorParserComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &CustomToolChainConfigWidget::errorParserChanged); connect(m_customParserSettingsButton, &QAbstractButton::clicked, this, &CustomToolChainConfigWidget::openCustomParserSettingsDialog); diff --git a/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp b/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp index 8e68d6b21b9..fee481461ef 100644 --- a/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp +++ b/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp @@ -185,14 +185,10 @@ DeviceProcessesDialogPrivate::DeviceProcessesDialogPrivate(KitChooser *chooser, proxyModel.setFilterRegExp(processFilterLineEdit->text()); - connect(processFilterLineEdit, - static_cast(&FancyLineEdit::textChanged), - &proxyModel, - static_cast( - &ProcessListFilterModel::setFilterRegExp)); - connect(procView->selectionModel(), - &QItemSelectionModel::selectionChanged, - this, &DeviceProcessesDialogPrivate::updateButtons); + connect(processFilterLineEdit, QOverload::of(&FancyLineEdit::textChanged), + &proxyModel, QOverload::of(&ProcessListFilterModel::setFilterRegExp)); + connect(procView->selectionModel(), &QItemSelectionModel::selectionChanged, + this, &DeviceProcessesDialogPrivate::updateButtons); connect(updateListButton, &QAbstractButton::clicked, this, &DeviceProcessesDialogPrivate::updateProcessList); connect(kitChooser, &KitChooser::currentIndexChanged, diff --git a/src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp b/src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp index 5cb6623f1c2..af425896222 100644 --- a/src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp @@ -122,7 +122,7 @@ void DeviceSettingsWidget::initGui() lastIndex = 0; if (lastIndex < m_ui->configurationComboBox->count()) m_ui->configurationComboBox->setCurrentIndex(lastIndex); - connect(m_ui->configurationComboBox, static_cast(&QComboBox::currentIndexChanged), + connect(m_ui->configurationComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &DeviceSettingsWidget::currentDeviceChanged); currentDeviceChanged(currentIndex()); connect(m_ui->defaultDeviceButton, &QAbstractButton::clicked, diff --git a/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp b/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp index f094cb14732..67e30354ef3 100644 --- a/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp +++ b/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp @@ -195,8 +195,7 @@ void SshDeviceProcess::handleConnected() if (runInTerminal()) { d->process->requestTerminal(); const QStringList cmdLine = d->process->fullLocalCommandLine(); - connect(&d->consoleProcess, - static_cast(&ConsoleProcess::error), + connect(&d->consoleProcess, QOverload::of(&ConsoleProcess::error), this, &DeviceProcess::error); connect(&d->consoleProcess, &ConsoleProcess::processStarted, this, &SshDeviceProcess::handleProcessStarted); diff --git a/src/plugins/projectexplorer/editorsettingspropertiespage.cpp b/src/plugins/projectexplorer/editorsettingspropertiespage.cpp index 83fc49dcea0..ba76cb078eb 100644 --- a/src/plugins/projectexplorer/editorsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/editorsettingspropertiespage.cpp @@ -43,14 +43,14 @@ EditorSettingsWidget::EditorSettingsWidget(Project *project) : QWidget(), m_proj globalSettingsActivated(config->useGlobalSettings() ? 0 : 1); - connect(m_ui.globalSelector, static_cast(&QComboBox::activated), + connect(m_ui.globalSelector, QOverload::of(&QComboBox::activated), this, &EditorSettingsWidget::globalSettingsActivated); connect(m_ui.restoreButton, &QAbstractButton::clicked, this, &EditorSettingsWidget::restoreDefaultValues); connect(m_ui.showWrapColumn, &QAbstractButton::toggled, config, &EditorConfiguration::setShowWrapColumn); - connect(m_ui.wrapColumn, static_cast(&QSpinBox::valueChanged), + connect(m_ui.wrapColumn, QOverload::of(&QSpinBox::valueChanged), config, &EditorConfiguration::setWrapColumn); connect(m_ui.behaviorSettingsWidget, &TextEditor::BehaviorSettingsWidget::typingSettingsChanged, diff --git a/src/plugins/projectexplorer/environmentaspectwidget.cpp b/src/plugins/projectexplorer/environmentaspectwidget.cpp index 7b5c9e5e5f4..ed74e3b8fef 100644 --- a/src/plugins/projectexplorer/environmentaspectwidget.cpp +++ b/src/plugins/projectexplorer/environmentaspectwidget.cpp @@ -71,7 +71,7 @@ EnvironmentAspectWidget::EnvironmentAspectWidget(EnvironmentAspect *aspect, QWid if (m_baseEnvironmentComboBox->count() == 1) m_baseEnvironmentComboBox->setEnabled(false); - connect(m_baseEnvironmentComboBox, static_cast(&QComboBox::currentIndexChanged), + connect(m_baseEnvironmentComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &EnvironmentAspectWidget::baseEnvironmentSelected); baseLayout->addWidget(m_baseEnvironmentComboBox); diff --git a/src/plugins/projectexplorer/foldernavigationwidget.cpp b/src/plugins/projectexplorer/foldernavigationwidget.cpp index 04948cb219c..0275b166d12 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.cpp +++ b/src/plugins/projectexplorer/foldernavigationwidget.cpp @@ -418,7 +418,7 @@ FolderNavigationWidget::FolderNavigationWidget(QWidget *parent) : QWidget(parent connect(m_toggleRootSync, &QAbstractButton::clicked, this, [this]() { setRootAutoSynchronization(!m_rootAutoSync); }); connect(m_rootSelector, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, [this](int index) { const auto directory = m_rootSelector->itemData(index).value(); diff --git a/src/plugins/projectexplorer/kitchooser.cpp b/src/plugins/projectexplorer/kitchooser.cpp index 55e6e8cda4b..b0b779122e8 100644 --- a/src/plugins/projectexplorer/kitchooser.cpp +++ b/src/plugins/projectexplorer/kitchooser.cpp @@ -59,9 +59,9 @@ KitChooser::KitChooser(QWidget *parent) : layout->addWidget(m_manageButton); setFocusProxy(m_manageButton); - connect(m_chooser, static_cast(&QComboBox::currentIndexChanged), + connect(m_chooser, QOverload::of(&QComboBox::currentIndexChanged), this, &KitChooser::onCurrentIndexChanged); - connect(m_chooser, static_cast(&QComboBox::activated), + connect(m_chooser, QOverload::of(&QComboBox::activated), this, &KitChooser::onActivated); connect(m_manageButton, &QAbstractButton::clicked, this, &KitChooser::onManageButtonClicked); connect(KitManager::instance(), &KitManager::kitsChanged, this, &KitChooser::populate); diff --git a/src/plugins/projectexplorer/kitinformation.cpp b/src/plugins/projectexplorer/kitinformation.cpp index ddf2d8c6d4b..7879b034b87 100644 --- a/src/plugins/projectexplorer/kitinformation.cpp +++ b/src/plugins/projectexplorer/kitinformation.cpp @@ -249,7 +249,7 @@ public: layout->addWidget(cb, row, 1); ++row; - connect(cb, static_cast(&QComboBox::currentIndexChanged), + connect(cb, QOverload::of(&QComboBox::currentIndexChanged), this, [this, l](int idx) { currentToolChainChanged(l, idx); }); } @@ -770,7 +770,7 @@ public: m_comboBox->addItem(factory->displayName(), factory->deviceType().toSetting()); m_comboBox->setToolTip(ki->description()); refresh(); - connect(m_comboBox, static_cast(&QComboBox::currentIndexChanged), + connect(m_comboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &DeviceTypeKitAspectWidget::currentTypeChanged); } @@ -895,7 +895,7 @@ public: this, &DeviceKitAspectWidget::modelAboutToReset); connect(m_model, &QAbstractItemModel::modelReset, this, &DeviceKitAspectWidget::modelReset); - connect(m_comboBox, static_cast(&QComboBox::currentIndexChanged), + connect(m_comboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &DeviceKitAspectWidget::currentDeviceChanged); connect(m_manageButton, &QAbstractButton::clicked, this, &DeviceKitAspectWidget::manageDevices); diff --git a/src/plugins/projectexplorer/projectconfigurationaspects.cpp b/src/plugins/projectexplorer/projectconfigurationaspects.cpp index c6f9ad95522..9c613a26501 100644 --- a/src/plugins/projectexplorer/projectconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/projectconfigurationaspects.cpp @@ -404,7 +404,7 @@ void BaseIntegerAspect::addToConfigurationLayout(QFormLayout *layout) if (d->m_maximumValue.isValid() && d->m_maximumValue.isValid()) d->m_spinBox->setRange(d->m_minimumValue.toInt(), d->m_maximumValue.toInt()); layout->addRow(d->m_label, d->m_spinBox); - connect(d->m_spinBox.data(), static_cast(&QSpinBox::valueChanged), + connect(d->m_spinBox.data(), QOverload::of(&QSpinBox::valueChanged), this, [this](int value) { d->m_value = value; emit changed(); diff --git a/src/plugins/projectexplorer/projectexplorersettingspage.cpp b/src/plugins/projectexplorer/projectexplorersettingspage.cpp index d7e506021c0..9ae2ced5222 100644 --- a/src/plugins/projectexplorer/projectexplorersettingspage.cpp +++ b/src/plugins/projectexplorer/projectexplorersettingspage.cpp @@ -79,7 +79,7 @@ ProjectExplorerSettingsWidget::ProjectExplorerSettingsWidget(QWidget *parent) : m_ui.directoryButtonGroup->setId(m_ui.currentDirectoryRadioButton, UseCurrentDirectory); m_ui.directoryButtonGroup->setId(m_ui.directoryRadioButton, UseProjectDirectory); - connect(m_ui.directoryButtonGroup, static_cast(&QButtonGroup::buttonClicked), + connect(m_ui.directoryButtonGroup, QOverload::of(&QButtonGroup::buttonClicked), this, &ProjectExplorerSettingsWidget::slotDirectoryButtonGroupChanged); connect(m_ui.buildDirectoryResetButton, &QAbstractButton::clicked, this, &ProjectExplorerSettingsWidget::resetBuildDirectoryTemplate); diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index 289d913bb00..ae0c72bdd2f 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -489,9 +489,7 @@ public: m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(valid); }); targetDirLayout->addWidget(m_targetDirChooser); - connect(m_buttonGroup, - static_cast(&QButtonGroup::buttonClicked), - this, [this] { + connect(m_buttonGroup, QOverload::of(&QButtonGroup::buttonClicked), this, [this] { switch (dropAction()) { case DropAction::CopyWithFiles: case DropAction::MoveWithFiles: diff --git a/src/plugins/projectexplorer/projectwizardpage.cpp b/src/plugins/projectexplorer/projectwizardpage.cpp index 500a13a4fcc..ab0fcd4dc4b 100644 --- a/src/plugins/projectexplorer/projectwizardpage.cpp +++ b/src/plugins/projectexplorer/projectwizardpage.cpp @@ -284,9 +284,9 @@ ProjectWizardPage::ProjectWizardPage(QWidget *parent) : WizardPage(parent), { m_ui->setupUi(this); m_ui->vcsManageButton->setText(ICore::msgShowOptionsDialog()); - connect(m_ui->projectComboBox, static_cast(&QComboBox::currentIndexChanged), + connect(m_ui->projectComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &ProjectWizardPage::projectChanged); - connect(m_ui->addToVersionControlComboBox, static_cast(&QComboBox::currentIndexChanged), + connect(m_ui->addToVersionControlComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &ProjectWizardPage::versionControlChanged); connect(m_ui->vcsManageButton, &QAbstractButton::clicked, this, &ProjectWizardPage::manageVcs); setProperty(SHORT_TITLE_PROPERTY, tr("Summary")); @@ -299,7 +299,7 @@ ProjectWizardPage::ProjectWizardPage(QWidget *parent) : WizardPage(parent), ProjectWizardPage::~ProjectWizardPage() { - disconnect(m_ui->projectComboBox, static_cast(&QComboBox::currentIndexChanged), + disconnect(m_ui->projectComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &ProjectWizardPage::projectChanged); delete m_ui; } diff --git a/src/plugins/projectexplorer/runsettingspropertiespage.cpp b/src/plugins/projectexplorer/runsettingspropertiespage.cpp index 59cfd94dd38..39b2f01af6a 100644 --- a/src/plugins/projectexplorer/runsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/runsettingspropertiespage.cpp @@ -162,7 +162,7 @@ RunSettingsWidget::RunSettingsWidget(Target *target) : connect(m_addDeployMenu, &QMenu::aboutToShow, this, &RunSettingsWidget::aboutToShowDeployMenu); - connect(m_deployConfigurationCombo, static_cast(&QComboBox::currentIndexChanged), + connect(m_deployConfigurationCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &RunSettingsWidget::currentDeployConfigurationChanged); connect(m_removeDeployToolButton, &QAbstractButton::clicked, this, &RunSettingsWidget::removeDeployConfiguration); @@ -201,7 +201,7 @@ RunSettingsWidget::RunSettingsWidget(Target *target) : connect(m_addRunToolButton, &QAbstractButton::clicked, this, &RunSettingsWidget::showAddRunConfigDialog); - connect(m_runConfigurationCombo, static_cast(&QComboBox::currentIndexChanged), + connect(m_runConfigurationCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &RunSettingsWidget::currentRunConfigurationChanged); connect(m_removeRunToolButton, &QAbstractButton::clicked, this, &RunSettingsWidget::removeRunConfiguration); diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index 7ce52bddef3..70d17909206 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -553,11 +553,11 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) : m_ui->qmlDebuggingWarningIcon->setPixmap(Utils::Icons::WARNING.pixmap()); connect(m_ui->buildVariantComboBox, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, &QbsBuildStepConfigWidget::changeBuildVariant); connect(m_ui->keepGoingCheckBox, &QAbstractButton::toggled, this, &QbsBuildStepConfigWidget::changeKeepGoing); - connect(m_ui->jobSpinBox, static_cast(&QSpinBox::valueChanged), + connect(m_ui->jobSpinBox, QOverload::of(&QSpinBox::valueChanged), this, &QbsBuildStepConfigWidget::changeJobCount); connect(m_ui->showCommandLinesCheckBox, &QCheckBox::toggled, this, &QbsBuildStepConfigWidget::changeShowCommandLines); diff --git a/src/plugins/qbsprojectmanager/qbsprofilessettingspage.cpp b/src/plugins/qbsprojectmanager/qbsprofilessettingspage.cpp index 418f30e2117..5a79d420624 100644 --- a/src/plugins/qbsprojectmanager/qbsprofilessettingspage.cpp +++ b/src/plugins/qbsprojectmanager/qbsprofilessettingspage.cpp @@ -152,7 +152,7 @@ void QbsProfilesSettingsWidget::refreshKitsList() m_ui.kitsComboBox->setCurrentIndex(0); displayCurrentProfile(); connect(m_ui.kitsComboBox, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, &QbsProfilesSettingsWidget::displayCurrentProfile); } diff --git a/src/plugins/qmakeprojectmanager/externaleditors.cpp b/src/plugins/qmakeprojectmanager/externaleditors.cpp index 5924afb6a03..76f617ec5e6 100644 --- a/src/plugins/qmakeprojectmanager/externaleditors.cpp +++ b/src/plugins/qmakeprojectmanager/externaleditors.cpp @@ -288,8 +288,7 @@ bool DesignerExternalEditor::startEditor(const QString &fileName, QString *error m_processCache.insert(binary, socket); auto mapSlot = [this, binary] { processTerminated(binary); }; connect(socket, &QAbstractSocket::disconnected, this, mapSlot); - connect(socket, - static_cast(&QAbstractSocket::error), + connect(socket, QOverload::of(&QAbstractSocket::error), this, mapSlot); } return true; diff --git a/src/plugins/qmakeprojectmanager/librarydetailscontroller.cpp b/src/plugins/qmakeprojectmanager/librarydetailscontroller.cpp index 1d3509f8130..2a26e6716e1 100644 --- a/src/plugins/qmakeprojectmanager/librarydetailscontroller.cpp +++ b/src/plugins/qmakeprojectmanager/librarydetailscontroller.cpp @@ -947,7 +947,7 @@ InternalLibraryDetailsController::InternalLibraryDetailsController( libraryDetailsWidget()->useSubfoldersCheckBox->setEnabled(true); connect(libraryDetailsWidget()->libraryComboBox, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, &InternalLibraryDetailsController::slotCurrentLibraryChanged); updateProFile(); diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index 35a05d8f544..3a135440799 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -561,7 +561,7 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step) connect(m_ui->qmakeAdditonalArgumentsLineEdit, &QLineEdit::textEdited, this, &QMakeStepConfigWidget::qmakeArgumentsLineEdited); connect(m_ui->buildConfigurationComboBox, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, &QMakeStepConfigWidget::buildConfigurationSelected); connect(m_ui->qmlDebuggingLibraryCheckBox, &QCheckBox::toggled, this, &QMakeStepConfigWidget::linkQmlDebuggingLibraryChecked); diff --git a/src/plugins/qmldesigner/components/componentcore/changestyleaction.cpp b/src/plugins/qmldesigner/components/componentcore/changestyleaction.cpp index fa77acccb9e..c607499b66d 100644 --- a/src/plugins/qmldesigner/components/componentcore/changestyleaction.cpp +++ b/src/plugins/qmldesigner/components/componentcore/changestyleaction.cpp @@ -90,7 +90,7 @@ QWidget *ChangeStyleWidgetAction::createWidget(QWidget *parent) }); connect(comboBox, - static_cast(&QComboBox::activated), + QOverload::of(&QComboBox::activated), this, [this](const QString &style) { diff --git a/src/plugins/qmldesigner/components/formeditor/backgroundaction.cpp b/src/plugins/qmldesigner/components/formeditor/backgroundaction.cpp index 356fbf4f32b..6d3cef0fbda 100644 --- a/src/plugins/qmldesigner/components/formeditor/backgroundaction.cpp +++ b/src/plugins/qmldesigner/components/formeditor/backgroundaction.cpp @@ -64,7 +64,7 @@ QWidget *BackgroundAction::createWidget(QWidget *parent) } comboBox->setCurrentIndex(0); - connect(comboBox, static_cast(&QComboBox::currentIndexChanged), + connect(comboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &BackgroundAction::emitBackgroundChanged); comboBox->setProperty("hideborder", true); diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp index 609db1fe952..c0723bf751b 100644 --- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp +++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp @@ -143,17 +143,17 @@ NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceV const int second = 1000; const int waitConstant = 8 * second; if (m_qmlPuppetEditorProcess->waitForStarted(waitConstant)) { - connect(m_qmlPuppetEditorProcess.data(), static_cast(&QProcess::finished), + connect(m_qmlPuppetEditorProcess.data(), QOverload::of(&QProcess::finished), m_qmlPuppetEditorProcess.data(), &QProcess::deleteLater); qCInfo(instanceViewBenchmark) << "puppets started:" << m_benchmarkTimer.elapsed(); if (runModus == NormalModus) { m_qmlPuppetPreviewProcess->waitForStarted(waitConstant / 2); - connect(m_qmlPuppetPreviewProcess.data(), static_cast(&QProcess::finished), + connect(m_qmlPuppetPreviewProcess.data(), QOverload::of(&QProcess::finished), m_qmlPuppetPreviewProcess.data(), &QProcess::deleteLater); m_qmlPuppetRenderProcess->waitForStarted(waitConstant / 2); - connect(m_qmlPuppetRenderProcess.data(), static_cast(&QProcess::finished), + connect(m_qmlPuppetRenderProcess.data(), QOverload::of(&QProcess::finished), m_qmlPuppetRenderProcess.data(), &QProcess::deleteLater); } diff --git a/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/delegates.cpp b/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/delegates.cpp index 1a9958f9164..555f4488582 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/delegates.cpp +++ b/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/delegates.cpp @@ -167,7 +167,7 @@ QWidget *BindingDelegate::createEditor(QWidget *parent, const QStyleOptionViewIt default: qWarning() << "BindingDelegate::createEditor column" << index.column(); } - connect(bindingComboBox, static_cast(&QComboBox::activated), this, [=]() { + connect(bindingComboBox, QOverload::of(&QComboBox::activated), this, [=]() { auto delegate = const_cast(this); emit delegate->commitData(bindingComboBox); }); @@ -214,7 +214,7 @@ QWidget *DynamicPropertiesDelegate::createEditor(QWidget *parent, const QStyleOp case DynamicPropertiesModel::PropertyTypeRow: { auto dynamicPropertiesComboBox = new PropertiesComboBox(parent); - connect(dynamicPropertiesComboBox, static_cast(&QComboBox::activated), this, [=]() { + connect(dynamicPropertiesComboBox, QOverload::of(&QComboBox::activated), this, [=]() { auto delegate = const_cast(this); emit delegate->commitData(dynamicPropertiesComboBox); }); @@ -308,7 +308,7 @@ QWidget *ConnectionDelegate::createEditor(QWidget *parent, const QStyleOptionVie default: qWarning() << "ConnectionDelegate::createEditor column" << index.column(); } - connect(connectionComboBox, static_cast(&QComboBox::activated), this, [=]() { + connect(connectionComboBox, QOverload::of(&QComboBox::activated), this, [=]() { auto delegate = const_cast(this); emit delegate->commitData(connectionComboBox); }); @@ -335,7 +335,7 @@ QWidget *BackendDelegate::createEditor(QWidget *parent, const QStyleOptionViewIt case BackendModel::TypeNameColumn: { auto backendComboBox = new PropertiesComboBox(parent); backendComboBox->addItems(model->possibleCppTypes()); - connect(backendComboBox, static_cast(&QComboBox::activated), this, [=]() { + connect(backendComboBox, QOverload::of(&QComboBox::activated), this, [=]() { auto delegate = const_cast(this); emit delegate->commitData(backendComboBox); }); diff --git a/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/canvasstyledialog.cpp b/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/canvasstyledialog.cpp index 2a0f5fb4177..88d78615ca7 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/canvasstyledialog.cpp +++ b/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/canvasstyledialog.cpp @@ -100,7 +100,7 @@ CanvasStyleDialog::CanvasStyleDialog(const CanvasStyle &style, QWidget *parent) emit styleChanged(out); }; - auto doubleValueChanged = static_cast( + auto doubleValueChanged = QOverload::of( &QDoubleSpinBox::valueChanged); auto colorValueChanged = &ColorControl::valueChanged; diff --git a/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/easingcurvedialog.cpp b/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/easingcurvedialog.cpp index 5d6d66a472a..844be8e12fa 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/easingcurvedialog.cpp +++ b/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/easingcurvedialog.cpp @@ -146,7 +146,7 @@ EasingCurveDialog::EasingCurveDialog(const QList &frames, QWidget *pa connect(m_presets, &PresetEditor::presetChanged, m_splineEditor, &SplineEditor::setEasingCurve); connect(durationEdit, - static_cast(&QSpinBox::valueChanged), + QOverload::of(&QSpinBox::valueChanged), m_splineEditor, &SplineEditor::setDuration); diff --git a/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/timelineanimationform.cpp b/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/timelineanimationform.cpp index e78078fd7b7..7fc378f2ea2 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/timelineanimationform.cpp +++ b/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/timelineanimationform.cpp @@ -56,7 +56,7 @@ TimelineAnimationForm::TimelineAnimationForm(QWidget *parent) connectSpinBox(ui->startFrame, "from"); connectSpinBox(ui->endFrame, "to"); - connect(ui->loops, static_cast(&QSpinBox::valueChanged), [this]() { + connect(ui->loops, QOverload::of(&QSpinBox::valueChanged), [this]() { ui->continuous->setChecked(ui->loops->value() == -1); }); @@ -106,7 +106,7 @@ TimelineAnimationForm::TimelineAnimationForm(QWidget *parent) }); connect(ui->transitionToState, - static_cast(&QComboBox::activated), + QOverload::of(&QComboBox::activated), [this](int index) { if (!m_animation.isValid()) return; diff --git a/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/timelinesettingsmodel.cpp b/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/timelinesettingsmodel.cpp index 5eaee4e791e..6ce3731222e 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/timelinesettingsmodel.cpp +++ b/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/timelinesettingsmodel.cpp @@ -126,7 +126,7 @@ QWidget *TimelineEditorDelegate::createEditor(QWidget *parent, } if (comboBox) { - connect(comboBox, static_cast(&QComboBox::activated), this, [=]() { + connect(comboBox, QOverload::of(&QComboBox::activated), this, [=]() { auto delegate = const_cast(this); emit delegate->commitData(comboBox); }); diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index 458cb55b6ef..61576372ea1 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -119,7 +119,7 @@ void QmlJSEditorWidget::finalizeInitialization() m_updateUsesTimer.setSingleShot(true); connect(&m_updateUsesTimer, &QTimer::timeout, this, &QmlJSEditorWidget::updateUses); connect(this, &QPlainTextEdit::cursorPositionChanged, - &m_updateUsesTimer, static_cast(&QTimer::start)); + &m_updateUsesTimer, QOverload<>::of(&QTimer::start)); m_updateOutlineIndexTimer.setInterval(UPDATE_OUTLINE_INTERVAL); m_updateOutlineIndexTimer.setSingleShot(true); @@ -138,7 +138,7 @@ void QmlJSEditorWidget::finalizeInitialization() connect(&m_contextPaneTimer, &QTimer::timeout, this, &QmlJSEditorWidget::updateContextPane); if (m_contextPane) { connect(this, &QmlJSEditorWidget::cursorPositionChanged, - &m_contextPaneTimer, static_cast(&QTimer::start)); + &m_contextPaneTimer, QOverload<>::of(&QTimer::start)); connect(m_contextPane, &IContextPane::closed, this, &QmlJSEditorWidget::showTextMarker); } @@ -520,13 +520,13 @@ void QmlJSEditorWidget::createToolBar() policy.setHorizontalPolicy(QSizePolicy::Expanding); m_outlineCombo->setSizePolicy(policy); - connect(m_outlineCombo, static_cast(&QComboBox::activated), + connect(m_outlineCombo, QOverload::of(&QComboBox::activated), this, &QmlJSEditorWidget::jumpToOutlineElement); connect(m_qmlJsEditorDocument->outlineModel(), &QmlOutlineModel::updated, static_cast(m_outlineCombo->view()), &QTreeView::expandAll); connect(this, &QmlJSEditorWidget::cursorPositionChanged, - &m_updateOutlineIndexTimer, static_cast(&QTimer::start)); + &m_updateOutlineIndexTimer, QOverload<>::of(&QTimer::start)); insertExtraToolBarWidget(TextEditorWidget::Left, m_outlineCombo); } diff --git a/src/plugins/qmljseditor/qmljseditordocument.cpp b/src/plugins/qmljseditor/qmljseditordocument.cpp index 2f30f324cb9..18348907f46 100644 --- a/src/plugins/qmljseditor/qmljseditordocument.cpp +++ b/src/plugins/qmljseditor/qmljseditordocument.cpp @@ -459,7 +459,7 @@ QmlJSEditorDocumentPrivate::QmlJSEditorDocumentPrivate(QmlJSEditorDocument *pare m_updateDocumentTimer.setInterval(UPDATE_DOCUMENT_DEFAULT_INTERVAL); m_updateDocumentTimer.setSingleShot(true); connect(q->document(), &QTextDocument::contentsChanged, - &m_updateDocumentTimer, static_cast(&QTimer::start)); + &m_updateDocumentTimer, QOverload<>::of(&QTimer::start)); connect(&m_updateDocumentTimer, &QTimer::timeout, this, &QmlJSEditorDocumentPrivate::reparseDocument); connect(modelManager, &ModelManagerInterface::documentUpdated, @@ -477,7 +477,7 @@ QmlJSEditorDocumentPrivate::QmlJSEditorDocumentPrivate(QmlJSEditorDocument *pare connect(&m_reupdateSemanticInfoTimer, &QTimer::timeout, this, &QmlJSEditorDocumentPrivate::reupdateSemanticInfo); connect(modelManager, &ModelManagerInterface::libraryInfoUpdated, - &m_reupdateSemanticInfoTimer, static_cast(&QTimer::start)); + &m_reupdateSemanticInfoTimer, QOverload<>::of(&QTimer::start)); // outline model m_updateOutlineModelTimer.setInterval(UPDATE_OUTLINE_INTERVAL); diff --git a/src/plugins/qmlprofiler/qmlprofilerconfigwidget.cpp b/src/plugins/qmlprofiler/qmlprofilerconfigwidget.cpp index 8a83eb64daf..37994fd4369 100644 --- a/src/plugins/qmlprofiler/qmlprofilerconfigwidget.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerconfigwidget.cpp @@ -38,7 +38,7 @@ QmlProfilerConfigWidget::QmlProfilerConfigWidget(QmlProfilerSettings *settings, connect(m_ui->flushEnabled, &QCheckBox::toggled, m_settings, &QmlProfilerSettings::setFlushEnabled); - connect(m_ui->flushInterval, static_cast(&QSpinBox::valueChanged), + connect(m_ui->flushInterval, QOverload::of(&QSpinBox::valueChanged), m_settings, &QmlProfilerSettings::setFlushInterval); connect(m_ui->aggregateTraces, &QCheckBox::toggled, diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index 27aadb2de18..c11b9597a0a 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -125,7 +125,7 @@ void MainQmlFileAspect::addToConfigurationLayout(QFormLayout *layout) connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::fileListChanged, this, &MainQmlFileAspect::updateFileComboBox); - connect(m_fileListCombo, static_cast(&QComboBox::activated), + connect(m_fileListCombo, QOverload::of(&QComboBox::activated), this, &MainQmlFileAspect::setMainScript); layout->addRow(QmlProjectRunConfiguration::tr("Main QML file:"), m_fileListCombo); diff --git a/src/plugins/qtsupport/qtkitinformation.cpp b/src/plugins/qtsupport/qtkitinformation.cpp index 64eb3b5ca0b..dbeb446385a 100644 --- a/src/plugins/qtsupport/qtkitinformation.cpp +++ b/src/plugins/qtsupport/qtkitinformation.cpp @@ -66,7 +66,7 @@ public: refresh(); m_combo->setToolTip(ki->description()); - connect(m_combo, static_cast(&QComboBox::currentIndexChanged), + connect(m_combo, QOverload::of(&QComboBox::currentIndexChanged), this, &QtKitAspectWidget::currentWasChanged); connect(QtVersionManager::instance(), &QtVersionManager::qtVersionsChanged, diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index fe4fce618db..a0d62e129d8 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -138,7 +138,7 @@ void QtVersionManager::triggerQtVersionRestore() if (configFileName.exists()) { m_configFileWatcher = new FileSystemWatcher(m_instance); connect(m_configFileWatcher, &FileSystemWatcher::fileChanged, - m_fileWatcherTimer, static_cast(&QTimer::start)); + m_fileWatcherTimer, QOverload<>::of(&QTimer::start)); m_configFileWatcher->addFile(configFileName.toString(), FileSystemWatcher::WatchModifiedDate); } // exists diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp index 5957ac428b4..4f7eaf229d1 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp @@ -56,11 +56,11 @@ GenericLinuxDeviceConfigurationWidget::GenericLinuxDeviceConfigurationWidget( this, &GenericLinuxDeviceConfigurationWidget::authenticationTypeChanged); connect(m_ui->timeoutSpinBox, &QAbstractSpinBox::editingFinished, this, &GenericLinuxDeviceConfigurationWidget::timeoutEditingFinished); - connect(m_ui->timeoutSpinBox, static_cast(&QSpinBox::valueChanged), + connect(m_ui->timeoutSpinBox, QOverload::of(&QSpinBox::valueChanged), this, &GenericLinuxDeviceConfigurationWidget::timeoutEditingFinished); connect(m_ui->sshPortSpinBox, &QAbstractSpinBox::editingFinished, this, &GenericLinuxDeviceConfigurationWidget::sshPortEditingFinished); - connect(m_ui->sshPortSpinBox, static_cast(&QSpinBox::valueChanged), + connect(m_ui->sshPortSpinBox, QOverload::of(&QSpinBox::valueChanged), this, &GenericLinuxDeviceConfigurationWidget::sshPortEditingFinished); connect(m_ui->portsLineEdit, &QLineEdit::editingFinished, this, &GenericLinuxDeviceConfigurationWidget::handleFreePortsChanged); diff --git a/src/plugins/remotelinux/linuxdevicetester.cpp b/src/plugins/remotelinux/linuxdevicetester.cpp index a555c22e861..348f41d6e5d 100644 --- a/src/plugins/remotelinux/linuxdevicetester.cpp +++ b/src/plugins/remotelinux/linuxdevicetester.cpp @@ -226,8 +226,8 @@ void GenericLinuxDeviceTester::testRsync() if (d->rsyncProcess.error() == QProcess::FailedToStart) handleRsyncFinished(); }); - connect(&d->rsyncProcess, static_cast(&QProcess::finished), - [this] { + connect(&d->rsyncProcess, QOverload::of(&QProcess::finished), + this, [this] { handleRsyncFinished(); }); const RsyncCommandLine cmdLine = RsyncDeployStep::rsyncCommand(*d->connection); diff --git a/src/plugins/remotelinux/remotelinuxcheckforfreediskspacestep.cpp b/src/plugins/remotelinux/remotelinuxcheckforfreediskspacestep.cpp index 457e64292fb..9dbb2317069 100644 --- a/src/plugins/remotelinux/remotelinuxcheckforfreediskspacestep.cpp +++ b/src/plugins/remotelinux/remotelinuxcheckforfreediskspacestep.cpp @@ -60,8 +60,7 @@ public: connect(m_ui.pathLineEdit, &QLineEdit::textChanged, this, &RemoteLinuxCheckForFreeDiskSpaceStepWidget::handlePathChanged); - connect(m_ui.requiredSpaceSpinBox, - static_cast(&QSpinBox::valueChanged), + connect(m_ui.requiredSpaceSpinBox, QOverload::of(&QSpinBox::valueChanged), this, &RemoteLinuxCheckForFreeDiskSpaceStepWidget::handleRequiredSpaceChanged); } diff --git a/src/plugins/remotelinux/rsyncdeploystep.cpp b/src/plugins/remotelinux/rsyncdeploystep.cpp index ba013bb6491..96747de16c9 100644 --- a/src/plugins/remotelinux/rsyncdeploystep.cpp +++ b/src/plugins/remotelinux/rsyncdeploystep.cpp @@ -132,7 +132,7 @@ void RsyncDeployService::deployFiles() setFinished(); } }); - connect(&m_rsync, static_cast(&QProcess::finished), this, [this] { + connect(&m_rsync, QOverload::of(&QProcess::finished), this, [this] { if (m_rsync.exitStatus() == QProcess::CrashExit) { emit errorMessage(tr("rsync crashed.")); setFinished(); diff --git a/src/plugins/scxmleditor/common/colorsettings.cpp b/src/plugins/scxmleditor/common/colorsettings.cpp index cb3f1cee179..8b952c253b5 100644 --- a/src/plugins/scxmleditor/common/colorsettings.cpp +++ b/src/plugins/scxmleditor/common/colorsettings.cpp @@ -39,7 +39,8 @@ ColorSettings::ColorSettings(QWidget *parent) m_ui.setupUi(this); m_ui.m_colorThemeView->setEnabled(false); - connect(m_ui.m_comboColorThemes, static_cast(&QComboBox::currentIndexChanged), this, &ColorSettings::selectTheme); + connect(m_ui.m_comboColorThemes, QOverload::of(&QComboBox::currentIndexChanged), + this, &ColorSettings::selectTheme); connect(m_ui.m_colorThemeView, &ColorThemeView::colorChanged, this, &ColorSettings::updateCurrentColors); connect(m_ui.m_addColorTheme, &QToolButton::clicked, this, &ColorSettings::createTheme); connect(m_ui.m_removeColorTheme, &QToolButton::clicked, this, &ColorSettings::removeTheme); diff --git a/src/plugins/scxmleditor/common/stateproperties.cpp b/src/plugins/scxmleditor/common/stateproperties.cpp index 8a9d0aa3b27..b9797aeed30 100644 --- a/src/plugins/scxmleditor/common/stateproperties.cpp +++ b/src/plugins/scxmleditor/common/stateproperties.cpp @@ -50,7 +50,7 @@ StateProperties::StateProperties(QWidget *parent) m_contentTimer.setInterval(500); m_contentTimer.setSingleShot(true); - connect(m_contentEdit, &QPlainTextEdit::textChanged, &m_contentTimer, static_cast(&QTimer::start)); + connect(m_contentEdit, &QPlainTextEdit::textChanged, &m_contentTimer, QOverload<>::of(&QTimer::start)); connect(&m_contentTimer, &QTimer::timeout, this, &StateProperties::timerTimeout); } diff --git a/src/plugins/serialterminal/serialoutputpane.cpp b/src/plugins/serialterminal/serialoutputpane.cpp index cf3a9a2f147..befc7e51a5e 100644 --- a/src/plugins/serialterminal/serialoutputpane.cpp +++ b/src/plugins/serialterminal/serialoutputpane.cpp @@ -169,7 +169,7 @@ SerialOutputPane::SerialOutputPane(Settings &settings) : updateLineEndingsComboBox(); inputLayout->addWidget(m_lineEndingsSelection); - connect(m_lineEndingsSelection, static_cast(&QComboBox::currentIndexChanged), + connect(m_lineEndingsSelection, QOverload::of(&QComboBox::currentIndexChanged), this, &SerialOutputPane::defaultLineEndingChanged); layout->addLayout(inputLayout); @@ -393,7 +393,7 @@ void SerialOutputPane::createToolButtons() m_portsSelection->setModel(m_devicesModel); updatePortsList(); connect(m_portsSelection, &ComboBox::opened, this, &SerialOutputPane::updatePortsList); - connect(m_portsSelection, static_cast(&ComboBox::currentIndexChanged), + connect(m_portsSelection, QOverload::of(&ComboBox::currentIndexChanged), this, &SerialOutputPane::activePortNameChanged); // TODO: the ports are not updated with the box opened (if the user wait for it) -> add a timer? @@ -402,7 +402,7 @@ void SerialOutputPane::createToolButtons() m_baudRateSelection = new ComboBox; m_baudRateSelection->setSizeAdjustPolicy(QComboBox::AdjustToContents); m_baudRateSelection->addItems(m_devicesModel->baudRates()); - connect(m_baudRateSelection, static_cast(&ComboBox::currentIndexChanged), + connect(m_baudRateSelection, QOverload::of(&ComboBox::currentIndexChanged), this, &SerialOutputPane::activeBaudRateChanged); if (m_settings.baudRate > 0) diff --git a/src/plugins/texteditor/behaviorsettingswidget.cpp b/src/plugins/texteditor/behaviorsettingswidget.cpp index 65bb8d5717b..e528a23812a 100644 --- a/src/plugins/texteditor/behaviorsettingswidget.cpp +++ b/src/plugins/texteditor/behaviorsettingswidget.cpp @@ -81,7 +81,7 @@ BehaviorSettingsWidget::BehaviorSettingsWidget(QWidget *parent) d->m_codecs.prepend(QTextCodec::codecForLocale()); } - auto currentIndexChanged = static_cast(&QComboBox::currentIndexChanged); + auto currentIndexChanged = QOverload::of(&QComboBox::currentIndexChanged); connect(d->m_ui.autoIndent, &QAbstractButton::toggled, this, &BehaviorSettingsWidget::slotTypingSettingsChanged); connect(d->m_ui.smartBackspaceBehavior, currentIndexChanged, diff --git a/src/plugins/texteditor/codeassist/genericproposalwidget.cpp b/src/plugins/texteditor/codeassist/genericproposalwidget.cpp index a821538a22d..3b8d8963fc6 100644 --- a/src/plugins/texteditor/codeassist/genericproposalwidget.cpp +++ b/src/plugins/texteditor/codeassist/genericproposalwidget.cpp @@ -395,7 +395,7 @@ void GenericProposalWidget::setModel(ProposalModelPtr model) d->m_completionListView->setModel(new ModelAdapter(d->m_model, d->m_completionListView)); connect(d->m_completionListView->selectionModel(), &QItemSelectionModel::currentChanged, - &d->m_infoTimer, static_cast(&QTimer::start)); + &d->m_infoTimer, QOverload<>::of(&QTimer::start)); } void GenericProposalWidget::setDisplayRect(const QRect &rect) diff --git a/src/plugins/texteditor/codestyleselectorwidget.cpp b/src/plugins/texteditor/codestyleselectorwidget.cpp index 26a11effdd9..1e76b1fc2c0 100644 --- a/src/plugins/texteditor/codestyleselectorwidget.cpp +++ b/src/plugins/texteditor/codestyleselectorwidget.cpp @@ -162,7 +162,7 @@ CodeStyleSelectorWidget::CodeStyleSelectorWidget(ICodeStylePreferencesFactory *f m_ui->importButton->setEnabled(false); m_ui->exportButton->setEnabled(false); - connect(m_ui->delegateComboBox, static_cast(&QComboBox::activated), + connect(m_ui->delegateComboBox, QOverload::of(&QComboBox::activated), this, &CodeStyleSelectorWidget::slotComboBoxActivated); connect(m_ui->copyButton, &QAbstractButton::clicked, this, &CodeStyleSelectorWidget::slotCopyClicked); diff --git a/src/plugins/texteditor/colorschemeedit.cpp b/src/plugins/texteditor/colorschemeedit.cpp index 5f999835c53..193b0564e8a 100644 --- a/src/plugins/texteditor/colorschemeedit.cpp +++ b/src/plugins/texteditor/colorschemeedit.cpp @@ -168,13 +168,13 @@ ColorSchemeEdit::ColorSchemeEdit(QWidget *parent) : this, &ColorSchemeEdit::eraseBackColor); connect(m_ui->eraseForegroundToolButton, &QAbstractButton::clicked, this, &ColorSchemeEdit::eraseForeColor); - connect(m_ui->foregroundSaturationSpinBox, static_cast(&QDoubleSpinBox::valueChanged), + connect(m_ui->foregroundSaturationSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &ColorSchemeEdit::changeRelativeForeColor); - connect(m_ui->foregroundLightnessSpinBox, static_cast(&QDoubleSpinBox::valueChanged), + connect(m_ui->foregroundLightnessSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &ColorSchemeEdit::changeRelativeForeColor); - connect(m_ui->backgroundSaturationSpinBox, static_cast(&QDoubleSpinBox::valueChanged), + connect(m_ui->backgroundSaturationSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &ColorSchemeEdit::changeRelativeBackColor); - connect(m_ui->backgroundLightnessSpinBox, static_cast(&QDoubleSpinBox::valueChanged), + connect(m_ui->backgroundLightnessSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &ColorSchemeEdit::changeRelativeBackColor); connect(m_ui->boldCheckBox, &QAbstractButton::toggled, this, &ColorSchemeEdit::checkCheckBoxes); @@ -184,7 +184,7 @@ ColorSchemeEdit::ColorSchemeEdit(QWidget *parent) : this, &ColorSchemeEdit::changeUnderlineColor); connect(m_ui->eraseUnderlineColorToolButton, &QToolButton::clicked, this, &ColorSchemeEdit::eraseUnderlineColor); - connect(m_ui->underlineComboBox, static_cast(&QComboBox::currentIndexChanged), + connect(m_ui->underlineComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &ColorSchemeEdit::changeUnderlineStyle); } diff --git a/src/plugins/texteditor/findinfiles.cpp b/src/plugins/texteditor/findinfiles.cpp index 9c61d769222..38da20910f3 100644 --- a/src/plugins/texteditor/findinfiles.cpp +++ b/src/plugins/texteditor/findinfiles.cpp @@ -151,7 +151,7 @@ QWidget *FindInFiles::createConfigWidget() auto searchEngineLabel = new QLabel(tr("Search engine:")); gridLayout->addWidget(searchEngineLabel, row, 0, Qt::AlignRight); m_searchEngineCombo = new QComboBox; - auto cc = static_cast(&QComboBox::currentIndexChanged); + auto cc = QOverload::of(&QComboBox::currentIndexChanged); connect(m_searchEngineCombo, cc, this, &FindInFiles::searchEnginesSelectionChanged); searchEngineLabel->setBuddy(m_searchEngineCombo); gridLayout->addWidget(m_searchEngineCombo, row, 1); diff --git a/src/plugins/texteditor/fontsettingspage.cpp b/src/plugins/texteditor/fontsettingspage.cpp index 1a6235789e2..ed79d3a4e67 100644 --- a/src/plugins/texteditor/fontsettingspage.cpp +++ b/src/plugins/texteditor/fontsettingspage.cpp @@ -365,15 +365,14 @@ QWidget *FontSettingsPage::widget() connect(d_ptr->m_ui->fontComboBox, &QFontComboBox::currentFontChanged, this, &FontSettingsPage::fontSelected); connect(d_ptr->m_ui->sizeComboBox, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, &FontSettingsPage::fontSizeSelected); - connect(d_ptr->m_ui->zoomSpinBox, - static_cast(&QSpinBox::valueChanged), + connect(d_ptr->m_ui->zoomSpinBox, QOverload::of(&QSpinBox::valueChanged), this, &FontSettingsPage::fontZoomChanged); connect(d_ptr->m_ui->antialias, &QCheckBox::toggled, this, &FontSettingsPage::antialiasChanged); connect(d_ptr->m_ui->schemeComboBox, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, &FontSettingsPage::colorSchemeSelected); connect(d_ptr->m_ui->copyButton, &QPushButton::clicked, this, &FontSettingsPage::openCopyColorSchemeDialog); diff --git a/src/plugins/texteditor/snippets/snippetssettingspage.cpp b/src/plugins/texteditor/snippets/snippetssettingspage.cpp index 32daaa503b7..c90a13c976b 100644 --- a/src/plugins/texteditor/snippets/snippetssettingspage.cpp +++ b/src/plugins/texteditor/snippets/snippetssettingspage.cpp @@ -364,7 +364,7 @@ void SnippetsSettingsPagePrivate::configureUi(QWidget *w) connect(m_model, &QAbstractItemModel::modelReset, this, &SnippetsSettingsPagePrivate::markSnippetsCollection); - connect(m_ui.groupCombo, static_cast(&QComboBox::currentIndexChanged), + connect(m_ui.groupCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &SnippetsSettingsPagePrivate::loadSnippetGroup); connect(m_ui.addButton, &QAbstractButton::clicked, this, &SnippetsSettingsPagePrivate::addSnippet); diff --git a/src/plugins/texteditor/tabsettingswidget.cpp b/src/plugins/texteditor/tabsettingswidget.cpp index 08dd90e7108..fd4ddb29890 100644 --- a/src/plugins/texteditor/tabsettingswidget.cpp +++ b/src/plugins/texteditor/tabsettingswidget.cpp @@ -38,8 +38,8 @@ TabSettingsWidget::TabSettingsWidget(QWidget *parent) : ui->setupUi(this); ui->codingStyleWarning->setVisible(false); - auto comboIndexChanged = static_cast(&QComboBox::currentIndexChanged); - auto spinValueChanged = static_cast(&QSpinBox::valueChanged); + auto comboIndexChanged = QOverload::of(&QComboBox::currentIndexChanged); + auto spinValueChanged = QOverload::of(&QSpinBox::valueChanged); connect(ui->codingStyleWarning, &QLabel::linkActivated, this, &TabSettingsWidget::codingStyleLinkActivated); connect(ui->tabPolicy, comboIndexChanged, diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 0eadd070e33..559617ac2d8 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -1009,8 +1009,8 @@ void TextEditorWidgetPrivate::ctor(const QSharedPointer &doc) QObject::connect(q, &QPlainTextEdit::blockCountChanged, this, &TextEditorWidgetPrivate::slotUpdateExtraAreaWidth); - QObject::connect(q, &QPlainTextEdit::modificationChanged, m_extraArea, - static_cast(&QWidget::update)); + QObject::connect(q, &QPlainTextEdit::modificationChanged, + m_extraArea, QOverload<>::of(&QWidget::update)); QObject::connect(q, &QPlainTextEdit::cursorPositionChanged, q, &TextEditorWidget::slotCursorPositionChanged); @@ -1046,8 +1046,8 @@ void TextEditorWidgetPrivate::ctor(const QSharedPointer &doc) q->setFrameStyle(QFrame::NoFrame); m_delayedUpdateTimer.setSingleShot(true); - QObject::connect(&m_delayedUpdateTimer, &QTimer::timeout, q->viewport(), - static_cast(&QWidget::update)); + QObject::connect(&m_delayedUpdateTimer, &QTimer::timeout, + q->viewport(), QOverload<>::of(&QWidget::update)); m_moveLineUndoHack = false; @@ -3454,7 +3454,7 @@ void TextEditorWidgetPrivate::setupDocumentSignals() this, &TextEditorWidgetPrivate::slotUpdateBlockNotify); QObject::connect(documentLayout, &TextDocumentLayout::updateExtraArea, - m_extraArea, static_cast(&QWidget::update)); + m_extraArea, QOverload<>::of(&QWidget::update)); QObject::connect(q, &TextEditorWidget::requestBlockUpdate, documentLayout, &QPlainTextDocumentLayout::updateBlock); diff --git a/src/plugins/todo/todooutputpane.cpp b/src/plugins/todo/todooutputpane.cpp index 0becced031b..13eccae4b9d 100644 --- a/src/plugins/todo/todooutputpane.cpp +++ b/src/plugins/todo/todooutputpane.cpp @@ -271,7 +271,7 @@ void TodoOutputPane::createScopeButtons() m_scopeButtons->addButton(m_wholeProjectButton); m_scopeButtons->addButton(m_currentFileButton); m_scopeButtons->addButton(m_subProjectButton); - connect(m_scopeButtons, static_cast(&QButtonGroup::buttonClicked), + connect(m_scopeButtons, QOverload::of(&QButtonGroup::buttonClicked), this, &TodoOutputPane::scopeButtonClicked); m_spacer = new QWidget; diff --git a/src/plugins/updateinfo/settingspage.cpp b/src/plugins/updateinfo/settingspage.cpp index c1423753835..82a9cf48de9 100644 --- a/src/plugins/updateinfo/settingspage.cpp +++ b/src/plugins/updateinfo/settingspage.cpp @@ -73,7 +73,7 @@ QWidget *SettingsPage::widget() connect(m_ui.m_checkNowButton, &QPushButton::clicked, m_plugin, &UpdateInfoPlugin::startCheckForUpdates); connect(m_ui.m_checkIntervalComboBox, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, &SettingsPage::updateNextCheckDate); connect(m_plugin, &UpdateInfoPlugin::lastCheckDateChanged, this, &SettingsPage::updateLastCheckDate); diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index b9a83bc42ba..ab018d98286 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -431,7 +431,7 @@ CallgrindTool::CallgrindTool() // event selection m_eventCombo = new QComboBox; m_eventCombo->setToolTip(tr("Selects which events from the profiling data are shown and visualized.")); - connect(m_eventCombo, static_cast(&QComboBox::currentIndexChanged), + connect(m_eventCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &CallgrindTool::setCostEvent); updateEventCombo(); diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index c32a2a1ab78..d2d723027ef 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -1215,7 +1215,7 @@ HeobDialog::HeobDialog(QWidget *parent) : m_handleExceptionCombo->addItem(tr("On")); m_handleExceptionCombo->addItem(tr("Only")); m_handleExceptionCombo->setCurrentIndex(handleException); - connect(m_handleExceptionCombo, static_cast(&QComboBox::currentIndexChanged), + connect(m_handleExceptionCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &HeobDialog::updateEnabled); handleExceptionLayout->addWidget(m_handleExceptionCombo); layout->addLayout(handleExceptionLayout); @@ -1228,7 +1228,7 @@ HeobDialog::HeobDialog(QWidget *parent) : m_pageProtectionCombo->addItem(tr("After")); m_pageProtectionCombo->addItem(tr("Before")); m_pageProtectionCombo->setCurrentIndex(pageProtection); - connect(m_pageProtectionCombo, static_cast(&QComboBox::currentIndexChanged), + connect(m_pageProtectionCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &HeobDialog::updateEnabled); pageProtectionLayout->addWidget(m_pageProtectionCombo); layout->addLayout(pageProtectionLayout); @@ -1252,7 +1252,7 @@ HeobDialog::HeobDialog(QWidget *parent) : m_leakDetailCombo->addItem(tr("Fuzzy Detect Leak Types")); m_leakDetailCombo->addItem(tr("Fuzzy Detect Leak Types (Show Reachable)")); m_leakDetailCombo->setCurrentIndex(leakDetail); - connect(m_leakDetailCombo, static_cast(&QComboBox::currentIndexChanged), + connect(m_leakDetailCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &HeobDialog::updateEnabled); leakDetailLayout->addWidget(m_leakDetailCombo); layout->addLayout(leakDetailLayout); diff --git a/src/plugins/valgrind/valgrindconfigwidget.cpp b/src/plugins/valgrind/valgrindconfigwidget.cpp index 7abb0e97d7e..85bcba75900 100644 --- a/src/plugins/valgrind/valgrindconfigwidget.cpp +++ b/src/plugins/valgrind/valgrindconfigwidget.cpp @@ -60,7 +60,7 @@ ValgrindConfigWidget::ValgrindConfigWidget(ValgrindBaseSettings *settings, bool connect(m_ui->valgrindExeChooser, &Utils::PathChooser::rawPathChanged, m_settings, &ValgrindBaseSettings::setValgrindExecutable); - connect(m_ui->smcDetectionComboBox, static_cast(&QComboBox::currentIndexChanged), + connect(m_ui->smcDetectionComboBox, QOverload::of(&QComboBox::currentIndexChanged), m_settings, &ValgrindBaseSettings::setSelfModifyingCodeDetection); if (Utils::HostOsInfo::isWindowsHost()) { @@ -102,12 +102,12 @@ ValgrindConfigWidget::ValgrindConfigWidget(ValgrindBaseSettings *settings, bool connect(m_settings, &ValgrindBaseSettings::enableEventToolTipsChanged, m_ui->enableEventToolTips, &QGroupBox::setChecked); - connect(m_ui->minimumInclusiveCostRatio, static_cast(&QDoubleSpinBox::valueChanged), + connect(m_ui->minimumInclusiveCostRatio, QOverload::of(&QDoubleSpinBox::valueChanged), m_settings, &ValgrindBaseSettings::setMinimumInclusiveCostRatio); connect(m_settings, &ValgrindBaseSettings::minimumInclusiveCostRatioChanged, m_ui->minimumInclusiveCostRatio, &QDoubleSpinBox::setValue); - connect(m_ui->visualisationMinimumInclusiveCostRatio, static_cast(&QDoubleSpinBox::valueChanged), + connect(m_ui->visualisationMinimumInclusiveCostRatio, QOverload::of(&QDoubleSpinBox::valueChanged), m_settings, &ValgrindBaseSettings::setVisualisationMinimumInclusiveCostRatio); connect(m_settings, &ValgrindBaseSettings::visualisationMinimumInclusiveCostRatioChanged, m_ui->visualisationMinimumInclusiveCostRatio, &QDoubleSpinBox::setValue); @@ -121,12 +121,12 @@ ValgrindConfigWidget::ValgrindConfigWidget(ValgrindBaseSettings *settings, bool connect(m_ui->addSuppression, &QPushButton::clicked, this, &ValgrindConfigWidget::slotAddSuppression); connect(m_ui->removeSuppression, &QPushButton::clicked, this, &ValgrindConfigWidget::slotRemoveSuppression); - connect(m_ui->numCallers, static_cast(&QSpinBox::valueChanged), + connect(m_ui->numCallers, QOverload::of(&QSpinBox::valueChanged), m_settings, &ValgrindBaseSettings::setNumCallers); connect(m_settings, &ValgrindBaseSettings::numCallersChanged, m_ui->numCallers, &QSpinBox::setValue); - connect(m_ui->leakCheckOnFinish, static_cast(&QComboBox::currentIndexChanged), + connect(m_ui->leakCheckOnFinish, QOverload::of(&QComboBox::currentIndexChanged), m_settings, &ValgrindBaseSettings::setLeakCheckOnFinish); connect(m_settings, &ValgrindBaseSettings::leakCheckOnFinishChanged, m_ui->leakCheckOnFinish, &QComboBox::setCurrentIndex); diff --git a/src/plugins/vcsbase/submitfieldwidget.cpp b/src/plugins/vcsbase/submitfieldwidget.cpp index 000ba51426f..b92579be437 100644 --- a/src/plugins/vcsbase/submitfieldwidget.cpp +++ b/src/plugins/vcsbase/submitfieldwidget.cpp @@ -286,7 +286,7 @@ void SubmitFieldWidget::createField(const QString &f) if (d->completer) fe.lineEdit->setCompleter(d->completer); - connect(fe.combo, static_cast(&QComboBox::currentIndexChanged), + connect(fe.combo, QOverload::of(&QComboBox::currentIndexChanged), this, &SubmitFieldWidget::slotComboIndexChanged); connect(fe.clearButton, &QAbstractButton::clicked, this, &SubmitFieldWidget::slotRemove); diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index 6fcfd09eae0..f8d2a87a066 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -724,7 +724,7 @@ void VcsBaseEditorWidget::init() case OtherContent: break; case LogOutput: - connect(d->entriesComboBox(), static_cast(&QComboBox::activated), + connect(d->entriesComboBox(), QOverload::of(&QComboBox::activated), this, &VcsBaseEditorWidget::slotJumpToEntry); connect(this, &QPlainTextEdit::textChanged, this, &VcsBaseEditorWidget::slotPopulateLogBrowser); @@ -737,7 +737,7 @@ void VcsBaseEditorWidget::init() break; case DiffOutput: // Diff: set up diff file browsing - connect(d->entriesComboBox(), static_cast(&QComboBox::activated), + connect(d->entriesComboBox(), QOverload::of(&QComboBox::activated), this, &VcsBaseEditorWidget::slotJumpToEntry); connect(this, &QPlainTextEdit::textChanged, this, &VcsBaseEditorWidget::slotPopulateDiffBrowser); diff --git a/src/plugins/vcsbase/vcsbaseeditorconfig.cpp b/src/plugins/vcsbase/vcsbaseeditorconfig.cpp index f3f96e3b3fb..ee40e2649a0 100644 --- a/src/plugins/vcsbase/vcsbaseeditorconfig.cpp +++ b/src/plugins/vcsbase/vcsbaseeditorconfig.cpp @@ -175,7 +175,7 @@ QComboBox *VcsBaseEditorConfig::addComboBox(const QStringList &options, auto cb = new QComboBox; foreach (const ComboBoxItem &item, items) cb->addItem(item.displayText, item.value); - connect(cb, static_cast(&QComboBox::currentIndexChanged), + connect(cb, QOverload::of(&QComboBox::currentIndexChanged), this, &VcsBaseEditorConfig::argumentsChanged); d->m_toolBar->addWidget(cb); d->m_optionMappings.append(OptionMapping(options, cb)); diff --git a/src/plugins/winrt/winrtdevice.cpp b/src/plugins/winrt/winrtdevice.cpp index 809ab115688..fd29189c7b9 100644 --- a/src/plugins/winrt/winrtdevice.cpp +++ b/src/plugins/winrt/winrtdevice.cpp @@ -160,8 +160,7 @@ void WinRtDeviceFactory::autoDetect() qCDebug(winrtDeviceLog) << __FUNCTION__ << "Creating process"; m_process = new Utils::QtcProcess(this); connect(m_process, &QProcess::errorOccurred, this, &WinRtDeviceFactory::onProcessError); - connect(m_process, - static_cast(&QProcess::finished), + connect(m_process, QOverload::of(&QProcess::finished), this, &WinRtDeviceFactory::onProcessFinished); } diff --git a/src/plugins/winrt/winrtrunnerhelper.cpp b/src/plugins/winrt/winrtrunnerhelper.cpp index 061dd0ca579..491abfc57fb 100644 --- a/src/plugins/winrt/winrtrunnerhelper.cpp +++ b/src/plugins/winrt/winrtrunnerhelper.cpp @@ -215,8 +215,7 @@ void WinRtRunnerHelper::startWinRtRunner(const RunConf &conf) if (connectProcess) { connect(process, &QProcess::started, this, &WinRtRunnerHelper::started); - connect(process, - static_cast(&QProcess::finished), + connect(process, QOverload::of(&QProcess::finished), this, &WinRtRunnerHelper::onProcessFinished); connect(process, &QProcess::errorOccurred, this, &WinRtRunnerHelper::onProcessError); connect(process, &QProcess::readyReadStandardOutput, this, &WinRtRunnerHelper::onProcessReadyReadStdOut); diff --git a/src/shared/help/bookmarkmanager.cpp b/src/shared/help/bookmarkmanager.cpp index 979ca7c5bf2..dc19b8e92ad 100644 --- a/src/shared/help/bookmarkmanager.cpp +++ b/src/shared/help/bookmarkmanager.cpp @@ -96,7 +96,7 @@ BookmarkDialog::BookmarkDialog(BookmarkManager *manager, const QString &title, this, &BookmarkDialog::itemChanged); connect(ui.bookmarkFolders, - static_cast(&QComboBox::currentIndexChanged), + QOverload::of(&QComboBox::currentIndexChanged), this, &BookmarkDialog::selectBookmarkFolder); connect(ui.treeView, &TreeView::customContextMenuRequested, diff --git a/src/tools/iostool/main.cpp b/src/tools/iostool/main.cpp index e99fe0dcb5d..f62c0c61809 100644 --- a/src/tools/iostool/main.cpp +++ b/src/tools/iostool/main.cpp @@ -227,7 +227,7 @@ void Relayer::setClientSocket(QTcpSocket *clientSocket) m_clientSocket = clientSocket; if (m_clientSocket) { connect(m_clientSocket, - static_cast(&QAbstractSocket::error), + QOverload::of(&QAbstractSocket::error), this, &Relayer::handleClientHasError); connect(m_clientSocket, &QAbstractSocket::disconnected, this, [this](){server()->removeRelayConnection(this);}); diff --git a/src/tools/qtcreatorcrashhandler/backtracecollector.cpp b/src/tools/qtcreatorcrashhandler/backtracecollector.cpp index f4c49ba919a..b3bc1939f7f 100644 --- a/src/tools/qtcreatorcrashhandler/backtracecollector.cpp +++ b/src/tools/qtcreatorcrashhandler/backtracecollector.cpp @@ -49,10 +49,10 @@ public: BacktraceCollector::BacktraceCollector(QObject *parent) : QObject(parent), d(new BacktraceCollectorPrivate) { - connect(&d->debugger, - static_cast(&QProcess::finished), + connect(&d->debugger, QOverload::of(&QProcess::finished), this, &BacktraceCollector::onDebuggerFinished); - connect(&d->debugger, &QProcess::errorOccurred, this, &BacktraceCollector::onDebuggerError); + connect(&d->debugger, &QProcess::errorOccurred, + this, &BacktraceCollector::onDebuggerError); connect(&d->debugger, &QIODevice::readyRead, this, &BacktraceCollector::onDebuggerOutputAvailable); d->debugger.setProcessChannelMode(QProcess::MergedChannels);