diff --git a/src/plugins/cpptools/cppcodestylepreferences.cpp b/src/plugins/cpptools/cppcodestylepreferences.cpp index b339c83d8a3b923f6da13d158d83e1c45f7c4bc5..fa3961a5da50a31650dc31fe02f5ecd119a6c9b8 100644 --- a/src/plugins/cpptools/cppcodestylepreferences.cpp +++ b/src/plugins/cpptools/cppcodestylepreferences.cpp @@ -37,8 +37,8 @@ static const char settingsSuffixKey[] = "CodeStyleSettings"; CppCodeStylePreferences::CppCodeStylePreferences(QObject *parent) : ICodeStylePreferences(parent) { - connect(this, SIGNAL(currentValueChanged(QVariant)), - this, SLOT(slotCurrentValueChanged(QVariant))); + connect(this, &CppCodeStylePreferences::currentValueChanged, + this, &CppCodeStylePreferences::slotCurrentValueChanged); } QVariant CppCodeStylePreferences::value() const diff --git a/src/plugins/cpptools/cppcodestylesettingspage.cpp b/src/plugins/cpptools/cppcodestylesettingspage.cpp index 63fb494d1c9fca8d073577c242f33119c00c9bb3..787963a3fb190b185f4023e19f31dd144177a227 100644 --- a/src/plugins/cpptools/cppcodestylesettingspage.cpp +++ b/src/plugins/cpptools/cppcodestylesettingspage.cpp @@ -282,48 +282,48 @@ CppCodeStylePreferencesWidget::CppCodeStylePreferencesWidget(QWidget *parent) setVisualizeWhitespace(true); - connect(m_ui->tabSettingsWidget, SIGNAL(settingsChanged(TextEditor::TabSettings)), - this, SLOT(slotTabSettingsChanged(TextEditor::TabSettings))); - connect(m_ui->indentBlockBraces, SIGNAL(toggled(bool)), - this, SLOT(slotCodeStyleSettingsChanged())); - connect(m_ui->indentBlockBody, SIGNAL(toggled(bool)), - this, SLOT(slotCodeStyleSettingsChanged())); - connect(m_ui->indentClassBraces, SIGNAL(toggled(bool)), - this, SLOT(slotCodeStyleSettingsChanged())); - connect(m_ui->indentNamespaceBraces, SIGNAL(toggled(bool)), - this, SLOT(slotCodeStyleSettingsChanged())); - connect(m_ui->indentEnumBraces, SIGNAL(toggled(bool)), - this, SLOT(slotCodeStyleSettingsChanged())); - connect(m_ui->indentNamespaceBody, SIGNAL(toggled(bool)), - this, SLOT(slotCodeStyleSettingsChanged())); - connect(m_ui->indentSwitchLabels, SIGNAL(toggled(bool)), - this, SLOT(slotCodeStyleSettingsChanged())); - connect(m_ui->indentCaseStatements, SIGNAL(toggled(bool)), - this, SLOT(slotCodeStyleSettingsChanged())); - connect(m_ui->indentCaseBlocks, SIGNAL(toggled(bool)), - this, SLOT(slotCodeStyleSettingsChanged())); - connect(m_ui->indentCaseBreak, SIGNAL(toggled(bool)), - this, SLOT(slotCodeStyleSettingsChanged())); - connect(m_ui->indentAccessSpecifiers, SIGNAL(toggled(bool)), - this, SLOT(slotCodeStyleSettingsChanged())); - connect(m_ui->indentDeclarationsRelativeToAccessSpecifiers, SIGNAL(toggled(bool)), - this, SLOT(slotCodeStyleSettingsChanged())); - connect(m_ui->indentFunctionBody, SIGNAL(toggled(bool)), - this, SLOT(slotCodeStyleSettingsChanged())); - connect(m_ui->indentFunctionBraces, SIGNAL(toggled(bool)), - this, SLOT(slotCodeStyleSettingsChanged())); - connect(m_ui->extraPaddingConditions, SIGNAL(toggled(bool)), - this, SLOT(slotCodeStyleSettingsChanged())); - connect(m_ui->alignAssignments, SIGNAL(toggled(bool)), - this, SLOT(slotCodeStyleSettingsChanged())); - connect(m_ui->bindStarToIdentifier, SIGNAL(toggled(bool)), - this, SLOT(slotCodeStyleSettingsChanged())); - connect(m_ui->bindStarToTypeName, SIGNAL(toggled(bool)), - this, SLOT(slotCodeStyleSettingsChanged())); - connect(m_ui->bindStarToLeftSpecifier, SIGNAL(toggled(bool)), - this, SLOT(slotCodeStyleSettingsChanged())); - connect(m_ui->bindStarToRightSpecifier, SIGNAL(toggled(bool)), - this, SLOT(slotCodeStyleSettingsChanged())); + connect(m_ui->tabSettingsWidget, &TextEditor::TabSettingsWidget::settingsChanged, + this, &CppCodeStylePreferencesWidget::slotTabSettingsChanged); + connect(m_ui->indentBlockBraces, &QCheckBox::toggled, + this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged); + connect(m_ui->indentBlockBody, &QCheckBox::toggled, + this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged); + connect(m_ui->indentClassBraces, &QCheckBox::toggled, + this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged); + connect(m_ui->indentNamespaceBraces, &QCheckBox::toggled, + this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged); + connect(m_ui->indentEnumBraces, &QCheckBox::toggled, + this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged); + connect(m_ui->indentNamespaceBody, &QCheckBox::toggled, + this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged); + connect(m_ui->indentSwitchLabels, &QCheckBox::toggled, + this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged); + connect(m_ui->indentCaseStatements, &QCheckBox::toggled, + this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged); + connect(m_ui->indentCaseBlocks, &QCheckBox::toggled, + this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged); + connect(m_ui->indentCaseBreak, &QCheckBox::toggled, + this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged); + connect(m_ui->indentAccessSpecifiers, &QCheckBox::toggled, + this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged); + connect(m_ui->indentDeclarationsRelativeToAccessSpecifiers, &QCheckBox::toggled, + this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged); + connect(m_ui->indentFunctionBody, &QCheckBox::toggled, + this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged); + connect(m_ui->indentFunctionBraces, &QCheckBox::toggled, + this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged); + connect(m_ui->extraPaddingConditions, &QCheckBox::toggled, + this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged); + connect(m_ui->alignAssignments, &QCheckBox::toggled, + this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged); + connect(m_ui->bindStarToIdentifier, &QCheckBox::toggled, + this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged); + connect(m_ui->bindStarToTypeName, &QCheckBox::toggled, + this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged); + connect(m_ui->bindStarToLeftSpecifier, &QCheckBox::toggled, + this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged); + connect(m_ui->bindStarToRightSpecifier, &QCheckBox::toggled, + this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged); m_ui->categoryTab->setCurrentIndex(0); @@ -340,8 +340,8 @@ void CppCodeStylePreferencesWidget::setCodeStyle(CppTools::CppCodeStylePreferenc // code preferences m_preferences = codeStylePreferences; - connect(m_preferences, SIGNAL(currentTabSettingsChanged(TextEditor::TabSettings)), - this, SLOT(setTabSettings(TextEditor::TabSettings))); + connect(m_preferences, &CppCodeStylePreferences::currentTabSettingsChanged, + this, &CppCodeStylePreferencesWidget::setTabSettings); connect(m_preferences, SIGNAL(currentCodeStyleSettingsChanged(CppTools::CppCodeStyleSettings)), this, SLOT(setCodeStyleSettings(CppTools::CppCodeStyleSettings))); connect(m_preferences, SIGNAL(currentPreferencesChanged(TextEditor::ICodeStylePreferences*)), diff --git a/src/plugins/cpptools/cppincludesfilter.cpp b/src/plugins/cpptools/cppincludesfilter.cpp index fb5b5647dae067eaa72d82811548506415df8d65..736e4f9c999086733224efd75e9b2a774a787565 100644 --- a/src/plugins/cpptools/cppincludesfilter.cpp +++ b/src/plugins/cpptools/cppincludesfilter.cpp @@ -42,7 +42,7 @@ using namespace Core; using namespace CppTools; using namespace CppTools::Internal; - +using namespace ProjectExplorer; namespace CppTools { namespace Internal { @@ -140,8 +140,7 @@ CppIncludesFilter::CppIncludesFilter() setIncludedByDefault(true); setPriority(ILocatorFilter::Low); - connect(ProjectExplorer::ProjectExplorerPlugin::instance(), - &ProjectExplorer::ProjectExplorerPlugin::fileListChanged, + connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::fileListChanged, this, &CppIncludesFilter::markOutdated); connect(CppModelManager::instance(), &CppModelManager::documentUpdated, this, &CppIncludesFilter::markOutdated); diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp index 532ef6b02a358098c791d83ed8c16d380852fd48..b12170c9d7844d5b99fddf6bff4adc23acfab32a 100644 --- a/src/plugins/cpptools/cpptoolsplugin.cpp +++ b/src/plugins/cpptools/cpptoolsplugin.cpp @@ -152,11 +152,11 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error) JsExpander::registerQObjectForJs(QLatin1String("Cpp"), new CppToolsJsExtension); CppLocatorData *locatorData = new CppLocatorData; - connect(modelManager, SIGNAL(documentUpdated(CPlusPlus::Document::Ptr)), - locatorData, SLOT(onDocumentUpdated(CPlusPlus::Document::Ptr))); + connect(modelManager, &CppModelManager::documentUpdated, + locatorData, &CppLocatorData::onDocumentUpdated); - connect(modelManager, SIGNAL(aboutToRemoveFiles(QStringList)), - locatorData, SLOT(onAboutToRemoveFiles(QStringList))); + connect(modelManager, &CppModelManager::aboutToRemoveFiles, + locatorData, &CppLocatorData::onAboutToRemoveFiles); addAutoReleasedObject(locatorData); addAutoReleasedObject(new CppLocatorFilter(locatorData)); @@ -184,7 +184,8 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error) Command *command = ActionManager::registerAction(switchAction, Constants::SWITCH_HEADER_SOURCE, context, true); command->setDefaultKeySequence(QKeySequence(Qt::Key_F4)); mcpptools->addAction(command); - connect(switchAction, SIGNAL(triggered()), this, SLOT(switchHeaderSource())); + connect(switchAction, &QAction::triggered, + this, &CppToolsPlugin::switchHeaderSource); QAction *openInNextSplitAction = new QAction(tr("Open Corresponding Header/Source in Next Split"), this); command = ActionManager::registerAction(openInNextSplitAction, Constants::OPEN_HEADER_SOURCE_IN_NEXT_SPLIT, context, true); @@ -192,7 +193,8 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error) ? tr("Meta+E, F4") : tr("Ctrl+E, F4"))); mcpptools->addAction(command); - connect(openInNextSplitAction, SIGNAL(triggered()), this, SLOT(switchHeaderSourceInNextSplit())); + connect(openInNextSplitAction, &QAction::triggered, + this, &CppToolsPlugin::switchHeaderSourceInNextSplit); Utils::MacroExpander *expander = Utils::globalMacroExpander(); expander->registerVariable("Cpp:LicenseTemplate", diff --git a/src/plugins/cpptools/modelmanagertesthelper.cpp b/src/plugins/cpptools/modelmanagertesthelper.cpp index 6571aabed71ff07a648053b822d8bf587204ee0e..366a540ed9eb1fb9fe9d4fed38fcf9eb3963d2ae 100644 --- a/src/plugins/cpptools/modelmanagertesthelper.cpp +++ b/src/plugins/cpptools/modelmanagertesthelper.cpp @@ -60,13 +60,14 @@ ModelManagerTestHelper::ModelManagerTestHelper(QObject *parent) : CppModelManager *mm = CppModelManager::instance(); assert(mm); - connect(this, SIGNAL(aboutToRemoveProject(ProjectExplorer::Project*)), - mm, SLOT(onAboutToRemoveProject(ProjectExplorer::Project*))); - connect(this, SIGNAL(projectAdded(ProjectExplorer::Project*)), - mm, SLOT(onProjectAdded(ProjectExplorer::Project*))); - connect(mm, SIGNAL(sourceFilesRefreshed(QSet<QString>)), - this, SLOT(sourceFilesRefreshed(QSet<QString>))); - connect(mm, SIGNAL(gcFinished()), this, SLOT(gcFinished())); + connect(this, &ModelManagerTestHelper::aboutToRemoveProject, + mm, &CppModelManager::onAboutToRemoveProject); + connect(this, &ModelManagerTestHelper::projectAdded, + mm, &CppModelManager::onProjectAdded); + connect(mm, &CppModelManager::sourceFilesRefreshed, + this, &ModelManagerTestHelper::sourceFilesRefreshed); + connect(mm, &CppModelManager::gcFinished, + this, &ModelManagerTestHelper::gcFinished); cleanup(); Tests::VerifyCleanCppModelManager::verify(); diff --git a/src/plugins/cpptools/stringtable.cpp b/src/plugins/cpptools/stringtable.cpp index b6393d5520e60f57fed1ab7c992d7c7b4711d379..11f8d665f63dbffe6ab6c53824178c0f830f5164 100644 --- a/src/plugins/cpptools/stringtable.cpp +++ b/src/plugins/cpptools/stringtable.cpp @@ -53,8 +53,7 @@ StringTable::StringTable() m_gcCountDown.setObjectName(QLatin1String("StringTable::m_gcCountDown")); m_gcCountDown.setSingleShot(true); m_gcCountDown.setInterval(GCTimeOut); - connect(&m_gcCountDown, SIGNAL(timeout()), - this, SLOT(startGC())); + connect(&m_gcCountDown, &QTimer::timeout, this, &StringTable::startGC); } QString StringTable::insert(const QString &string) diff --git a/src/plugins/qmljstools/qmlconsoleitemdelegate.cpp b/src/plugins/qmljstools/qmlconsoleitemdelegate.cpp index 1849b57ee6cb0a237d37d99d0db6d9dcd7dc854d..6454f8243564a006000ad57003d108ce88e1e9bb 100644 --- a/src/plugins/qmljstools/qmlconsoleitemdelegate.cpp +++ b/src/plugins/qmljstools/qmlconsoleitemdelegate.cpp @@ -313,7 +313,8 @@ QWidget *QmlConsoleItemDelegate::createEditor(QWidget *parent, { QmlConsoleEdit *editor = new QmlConsoleEdit(index, parent); - connect(editor, SIGNAL(editingFinished()), this, SLOT(commitAndCloseEditor())); + connect(editor, &QmlConsoleEdit::editingFinished, + this, &QmlConsoleItemDelegate::commitAndCloseEditor); return editor; } diff --git a/src/plugins/qmljstools/qmlconsolepane.cpp b/src/plugins/qmljstools/qmlconsolepane.cpp index f0419be234f536a7a9ab77374bd2b0d92814a1ec..21a4e322d051f98837bdc6ee1b2d6c62c05ed1e0 100644 --- a/src/plugins/qmljstools/qmlconsolepane.cpp +++ b/src/plugins/qmljstools/qmlconsolepane.cpp @@ -73,22 +73,23 @@ QmlConsolePane::QmlConsolePane(QObject *parent) m_proxyModel = new QmlConsoleProxyModel(this); m_proxyModel->setSourceModel(QmlConsoleModel::qmlConsoleItemModel()); connect(QmlConsoleModel::qmlConsoleItemModel(), - SIGNAL(selectEditableRow(QModelIndex,QItemSelectionModel::SelectionFlags)), + &QmlConsoleItemModel::selectEditableRow, m_proxyModel, - SLOT(selectEditableRow(QModelIndex,QItemSelectionModel::SelectionFlags))); + &QmlConsoleProxyModel::selectEditableRow); //Scroll to bottom when rows matching current filter settings are inserted //Not connecting rowsRemoved as the only way to remove rows is to clear the //model which will automatically reset the view. - connect(QmlConsoleModel::qmlConsoleItemModel(), SIGNAL(rowsInserted(QModelIndex,int,int)), - m_proxyModel, SLOT(onRowsInserted(QModelIndex,int,int))); + connect(QmlConsoleModel::qmlConsoleItemModel(), &QAbstractItemModel::rowsInserted, + m_proxyModel, &QmlConsoleProxyModel::onRowsInserted); m_consoleView->setModel(m_proxyModel); connect(m_proxyModel, SIGNAL(setCurrentIndex(QModelIndex,QItemSelectionModel::SelectionFlags)), m_consoleView->selectionModel(), SLOT(setCurrentIndex(QModelIndex,QItemSelectionModel::SelectionFlags))); - connect(m_proxyModel, SIGNAL(scrollToBottom()), m_consoleView, SLOT(onScrollToBottom())); + connect(m_proxyModel, &QmlConsoleProxyModel::scrollToBottom, + m_consoleView, &QmlConsoleView::onScrollToBottom); m_itemDelegate = new QmlConsoleItemDelegate(this); connect(m_consoleView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), @@ -111,7 +112,8 @@ QmlConsolePane::QmlConsolePane(QObject *parent) m_showDebugButtonAction->setToolTip(tr("Show debug, log, and info messages.")); m_showDebugButtonAction->setCheckable(true); m_showDebugButtonAction->setIcon(QIcon(QLatin1String(Core::Constants::ICON_INFO))); - connect(m_showDebugButtonAction, SIGNAL(toggled(bool)), m_proxyModel, SLOT(setShowLogs(bool))); + connect(m_showDebugButtonAction, &Utils::SavedAction::toggled, + m_proxyModel, &QmlConsoleProxyModel::setShowLogs); m_showDebugButton->setDefaultAction(m_showDebugButtonAction); m_showWarningButton = new QToolButton(m_consoleWidget); @@ -123,8 +125,8 @@ QmlConsolePane::QmlConsolePane(QObject *parent) m_showWarningButtonAction->setToolTip(tr("Show warning messages.")); m_showWarningButtonAction->setCheckable(true); m_showWarningButtonAction->setIcon(QIcon(QLatin1String(Core::Constants::ICON_WARNING))); - connect(m_showWarningButtonAction, SIGNAL(toggled(bool)), m_proxyModel, - SLOT(setShowWarnings(bool))); + connect(m_showWarningButtonAction, &Utils::SavedAction::toggled, + m_proxyModel, &QmlConsoleProxyModel::setShowWarnings); m_showWarningButton->setDefaultAction(m_showWarningButtonAction); m_showErrorButton = new QToolButton(m_consoleWidget); @@ -136,8 +138,7 @@ QmlConsolePane::QmlConsolePane(QObject *parent) m_showErrorButtonAction->setToolTip(tr("Show error messages.")); m_showErrorButtonAction->setCheckable(true); m_showErrorButtonAction->setIcon(QIcon(QLatin1String(Core::Constants::ICON_ERROR))); - connect(m_showErrorButtonAction, SIGNAL(toggled(bool)), m_proxyModel, - SLOT(setShowErrors(bool))); + connect(m_showErrorButtonAction, &Utils::SavedAction::toggled, m_proxyModel, &QmlConsoleProxyModel::setShowErrors); m_showErrorButton->setDefaultAction(m_showErrorButtonAction); m_spacer = new QWidget(m_consoleWidget); diff --git a/src/plugins/qmljstools/qmlconsoleview.cpp b/src/plugins/qmljstools/qmlconsoleview.cpp index 9532f84dc5fe26e319029050d51d43996e4b4b04..c70c8ed1eecc6f3ce76f4e8011be5dd7e36c67c7 100644 --- a/src/plugins/qmljstools/qmlconsoleview.cpp +++ b/src/plugins/qmljstools/qmlconsoleview.cpp @@ -129,7 +129,7 @@ QmlConsoleView::QmlConsoleView(QWidget *parent) : horizontalScrollBar()->setSingleStep(20); verticalScrollBar()->setSingleStep(20); - connect(this, SIGNAL(activated(QModelIndex)), SLOT(onRowActivated(QModelIndex))); + connect(this, &QmlConsoleView::activated, this, &QmlConsoleView::onRowActivated); } void QmlConsoleView::onScrollToBottom() diff --git a/src/plugins/qmljstools/qmljscodestylesettingspage.cpp b/src/plugins/qmljstools/qmljscodestylesettingspage.cpp index f59c0811bfa46be52bf7f35a35a5a3d9b004b246..7a755561748715989423defbc57e7f05dc2b7a8f 100644 --- a/src/plugins/qmljstools/qmljscodestylesettingspage.cpp +++ b/src/plugins/qmljstools/qmljscodestylesettingspage.cpp @@ -88,8 +88,8 @@ void QmlJSCodeStylePreferencesWidget::setPreferences(TextEditor::ICodeStylePrefe m_preferences = preferences; m_ui->tabPreferencesWidget->setPreferences(preferences); if (m_preferences) - connect(m_preferences, SIGNAL(currentTabSettingsChanged(TextEditor::TabSettings)), - this, SLOT(slotSettingsChanged())); + connect(m_preferences, &TextEditor::ICodeStylePreferences::currentTabSettingsChanged, + this, &QmlJSCodeStylePreferencesWidget::slotSettingsChanged); updatePreview(); } diff --git a/src/plugins/qmljstools/qmljslocatordata.cpp b/src/plugins/qmljstools/qmljslocatordata.cpp index 73362d175dd1f25a5a7e606be1c1f79eb86b24fa..381c111912cef0ab86013457d9def899954ec9bc 100644 --- a/src/plugins/qmljstools/qmljslocatordata.cpp +++ b/src/plugins/qmljstools/qmljslocatordata.cpp @@ -46,10 +46,10 @@ LocatorData::LocatorData(QObject *parent) { QmlJS::ModelManagerInterface *manager = QmlJS::ModelManagerInterface::instance(); - connect(manager, SIGNAL(documentUpdated(QmlJS::Document::Ptr)), - this, SLOT(onDocumentUpdated(QmlJS::Document::Ptr))); - connect(manager, SIGNAL(aboutToRemoveFiles(QStringList)), - this, SLOT(onAboutToRemoveFiles(QStringList))); + connect(manager, &QmlJS::ModelManagerInterface::documentUpdated, + this, &LocatorData::onDocumentUpdated); + connect(manager, &QmlJS::ModelManagerInterface::aboutToRemoveFiles, + this, &LocatorData::onAboutToRemoveFiles); } LocatorData::~LocatorData() diff --git a/src/plugins/qmljstools/qmljstoolsplugin.cpp b/src/plugins/qmljstools/qmljstoolsplugin.cpp index 306ce1c0c48b06f2f53f6ea861d556ef5d7fc0be..91e94f6fdd6ce4f8fce7b632b25174c2408d9543 100644 --- a/src/plugins/qmljstools/qmljstoolsplugin.cpp +++ b/src/plugins/qmljstools/qmljstoolsplugin.cpp @@ -108,7 +108,8 @@ bool QmlJSToolsPlugin::initialize(const QStringList &arguments, QString *error) Context globalContext(Core::Constants::C_GLOBAL); Command *cmd = ActionManager::registerAction( m_resetCodeModelAction, Constants::RESET_CODEMODEL, globalContext); - connect(m_resetCodeModelAction, SIGNAL(triggered()), m_modelManager, SLOT(resetCodeModel())); + connect(m_resetCodeModelAction, &QAction::triggered, + m_modelManager, &ModelManager::resetCodeModel); mqmljstools->addAction(cmd); // watch task progress diff --git a/src/plugins/qmlprojectmanager/qmlapplicationwizard.cpp b/src/plugins/qmlprojectmanager/qmlapplicationwizard.cpp index 18dce6b03304a10ef92514e186fe47d7b9cfdaa3..be4f324c5c2f25037fb853b459c2ae99460b98e6 100644 --- a/src/plugins/qmlprojectmanager/qmlapplicationwizard.cpp +++ b/src/plugins/qmlprojectmanager/qmlapplicationwizard.cpp @@ -89,8 +89,8 @@ Core::BaseFileWizard *QmlApplicationWizard::create(QWidget *parent, const Wizard { QmlApplicationWizardDialog *wizardDialog = new QmlApplicationWizardDialog(parent, parameters); - connect(wizardDialog, SIGNAL(projectParametersChanged(QString,QString)), m_qmlApp, - SLOT(setProjectNameAndBaseDirectory(QString,QString))); + connect(wizardDialog, &QmlApplicationWizardDialog::projectParametersChanged, + m_qmlApp, &QmlApp::setProjectNameAndBaseDirectory); wizardDialog->setPath(parameters.defaultPath()); diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp index 439a6ec3dbdd93724a3efa88b5f4a02ac231e4e0..d47d483314efa0c46a0528dd2a2341846925a3af 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.cpp +++ b/src/plugins/qmlprojectmanager/qmlproject.cpp @@ -100,7 +100,7 @@ void QmlProject::addedTarget(ProjectExplorer::Target *target) void QmlProject::onActiveTargetChanged(ProjectExplorer::Target *target) { if (m_activeTarget) - disconnect(m_activeTarget, SIGNAL(kitChanged()), this, SLOT(onKitChanged())); + disconnect(m_activeTarget, &ProjectExplorer::Target::kitChanged, this, &QmlProject::onKitChanged); m_activeTarget = target; if (m_activeTarget) connect(target, SIGNAL(kitChanged()), this, SLOT(onKitChanged())); @@ -397,11 +397,9 @@ bool QmlProject::fromMap(const QVariantMap &map) foreach (Target *t, targets()) addedTarget(t); - connect(this, SIGNAL(addedTarget(ProjectExplorer::Target*)), - this, SLOT(addedTarget(ProjectExplorer::Target*))); + connect(this, &QmlProject::addedTarget, this, &QmlProject::addedTarget); - connect(this, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)), - this, SLOT(onActiveTargetChanged(ProjectExplorer::Target*))); + connect(this, &QmlProject::activeTargetChanged, this, &QmlProject::onActiveTargetChanged); onActiveTargetChanged(activeTarget()); diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationwidget.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationwidget.cpp index f5ee8290b27c98c2b1d84ddcb7a1ba7d08e387a7..54f6448ebf258e12eaadf39c597b944c72f70603 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationwidget.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationwidget.cpp @@ -71,13 +71,15 @@ QmlProjectRunConfigurationWidget::QmlProjectRunConfigurationWidget(QmlProjectRun m_fileListCombo = new QComboBox; m_fileListCombo->setModel(m_fileListModel); - connect(m_fileListCombo, SIGNAL(activated(int)), this, SLOT(setMainScript(int))); + connect(m_fileListCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), + this, &QmlProjectRunConfigurationWidget::setMainScript); connect(ProjectExplorer::ProjectExplorerPlugin::instance(), SIGNAL(fileListChanged()), SLOT(updateFileComboBox())); QLineEdit *qmlViewerArgs = new QLineEdit; qmlViewerArgs->setText(rc->m_qmlViewerArgs); - connect(qmlViewerArgs, SIGNAL(textChanged(QString)), this, SLOT(onViewerArgsChanged())); + connect(qmlViewerArgs, &QLineEdit::textChanged, + this, &QmlProjectRunConfigurationWidget::onViewerArgsChanged); form->addRow(tr("Arguments:"), qmlViewerArgs); form->addRow(tr("Main QML file:"), m_fileListCombo); diff --git a/src/plugins/remotelinux/abstractpackagingstep.cpp b/src/plugins/remotelinux/abstractpackagingstep.cpp index 17529946ea65ec4409f9a8fb3ff31c13b3052574..b89de9e99a9c1b6d04a756d2ae5e7884c24a6d23 100644 --- a/src/plugins/remotelinux/abstractpackagingstep.cpp +++ b/src/plugins/remotelinux/abstractpackagingstep.cpp @@ -78,7 +78,8 @@ void AbstractPackagingStep::ctor() connect(target(), SIGNAL(deploymentDataChanged()), SLOT(setDeploymentDataModified())); setDeploymentDataModified(); - connect(this, SIGNAL(unmodifyDeploymentData()), this, SLOT(setDeploymentDataUnmodified())); + connect(this, &AbstractPackagingStep::unmodifyDeploymentData, + this, &AbstractPackagingStep::setDeploymentDataUnmodified); } AbstractPackagingStep::~AbstractPackagingStep() @@ -92,8 +93,8 @@ void AbstractPackagingStep::handleBuildConfigurationChanged() disconnect(d->currentBuildConfiguration, 0, this, 0); d->currentBuildConfiguration = target()->activeBuildConfiguration(); if (d->currentBuildConfiguration) { - connect(d->currentBuildConfiguration, SIGNAL(buildDirectoryChanged()), this, - SIGNAL(packageFilePathChanged())); + connect(d->currentBuildConfiguration, &BuildConfiguration::buildDirectoryChanged, + this, &AbstractPackagingStep::packageFilePathChanged); } emit packageFilePathChanged(); } diff --git a/src/plugins/remotelinux/abstractremotelinuxdeployservice.cpp b/src/plugins/remotelinux/abstractremotelinuxdeployservice.cpp index 639b448856c8e2dbf50146d4cedddd9dc358e8a9..43384ff2cd6f08ae3af5d0c46dc07807cfb73a3d 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeployservice.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxdeployservice.cpp @@ -274,12 +274,13 @@ void AbstractRemoteLinuxDeployService::handleDeviceSetupDone(bool success) d->state = Connecting; d->connection = QSsh::acquireConnection(deviceConfiguration()->sshParameters()); - connect(d->connection, SIGNAL(error(QSsh::SshError)), - SLOT(handleConnectionFailure())); + connect(d->connection, &SshConnection::error, + this, &AbstractRemoteLinuxDeployService::handleConnectionFailure); if (d->connection->state() == SshConnection::Connected) { handleConnected(); } else { - connect(d->connection, SIGNAL(connected()), SLOT(handleConnected())); + connect(d->connection, &SshConnection::connected, + this, &AbstractRemoteLinuxDeployService::handleConnected); emit progressMessage(tr("Connecting to device...")); if (d->connection->state() == SshConnection::Unconnected) d->connection->connectToHost(); diff --git a/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp b/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp index 29b881fb2a408d809be86b369543e94b9fe631b6..be1cf028d407f40f5a868cefa875155f35786456 100644 --- a/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp @@ -97,8 +97,10 @@ void AbstractRemoteLinuxRunSupport::handleRemoteSetupRequested() { QTC_ASSERT(d->state == Inactive, return); d->state = GatheringPorts; - connect(&d->portsGatherer, SIGNAL(error(QString)), SLOT(handlePortsGathererError(QString))); - connect(&d->portsGatherer, SIGNAL(portListReady()), SLOT(handlePortListReady())); + connect(&d->portsGatherer, &DeviceUsedPortsGatherer::error, + this, &AbstractRemoteLinuxRunSupport::handlePortsGathererError); + connect(&d->portsGatherer, &DeviceUsedPortsGatherer::portListReady, + this, &AbstractRemoteLinuxRunSupport::handlePortListReady); d->portsGatherer.start(d->device); } diff --git a/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp b/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp index 54e5a3bb89f4bd52e7badb7c40f2d035ce59bfcc..64d9e26890e943cd5e5b0aa72bc30ba90484c647 100644 --- a/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp +++ b/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp @@ -116,8 +116,10 @@ void AbstractUploadAndInstallPackageService::doDeploy() d->state = Uploading; const QString fileName = Utils::FileName::fromString(packageFilePath()).fileName(); const QString remoteFilePath = uploadDir() + QLatin1Char('/') + fileName; - connect(d->uploader, SIGNAL(progress(QString)), SIGNAL(progressMessage(QString))); - connect(d->uploader, SIGNAL(uploadFinished(QString)), SLOT(handleUploadFinished(QString))); + connect(d->uploader, &PackageUploader::progress, + this, &AbstractUploadAndInstallPackageService::progressMessage); + connect(d->uploader, &PackageUploader::uploadFinished, + this, &AbstractUploadAndInstallPackageService::handleUploadFinished); d->uploader->uploadPackage(connection(), packageFilePath(), remoteFilePath); } diff --git a/src/plugins/remotelinux/linuxdevicetester.cpp b/src/plugins/remotelinux/linuxdevicetester.cpp index 0060e3990479f115c7efe4a186119cb803b8a029..fcbc7a316ba5aeae4bc8d45c2137ea0b035a89ea 100644 --- a/src/plugins/remotelinux/linuxdevicetester.cpp +++ b/src/plugins/remotelinux/linuxdevicetester.cpp @@ -78,9 +78,10 @@ void GenericLinuxDeviceTester::testDevice(const IDevice::ConstPtr &deviceConfigu d->deviceConfiguration = deviceConfiguration; d->connection = new SshConnection(deviceConfiguration->sshParameters(), this); - connect(d->connection, SIGNAL(connected()), SLOT(handleConnected())); - connect(d->connection, SIGNAL(error(QSsh::SshError)), - SLOT(handleConnectionFailure())); + connect(d->connection, &SshConnection::connected, + this, &GenericLinuxDeviceTester::handleConnected); + connect(d->connection, &SshConnection::error, + this, &GenericLinuxDeviceTester::handleConnectionFailure); emit progressMessage(tr("Connecting to host...")); d->state = Connecting; @@ -147,8 +148,10 @@ void GenericLinuxDeviceTester::handleProcessFinished(int exitStatus) emit progressMessage(QString::fromUtf8(d->process->readAllStandardOutput())); } - connect(&d->portsGatherer, SIGNAL(error(QString)), SLOT(handlePortsGatheringError(QString))); - connect(&d->portsGatherer, SIGNAL(portListReady()), SLOT(handlePortListReady())); + connect(&d->portsGatherer, &DeviceUsedPortsGatherer::error, + this, &GenericLinuxDeviceTester::handlePortsGatheringError); + connect(&d->portsGatherer, &DeviceUsedPortsGatherer::portListReady, + this, &GenericLinuxDeviceTester::handlePortListReady); emit progressMessage(tr("Checking if specified ports are available...")); d->state = TestingPorts; diff --git a/src/plugins/remotelinux/packageuploader.cpp b/src/plugins/remotelinux/packageuploader.cpp index 0aa74bf00e7334c7f383d0104ac45b8bce9a83e5..5722fc35711159e51a65ceed40196daa324b5389 100644 --- a/src/plugins/remotelinux/packageuploader.cpp +++ b/src/plugins/remotelinux/packageuploader.cpp @@ -59,7 +59,8 @@ void PackageUploader::uploadPackage(SshConnection *connection, m_localFilePath = localFilePath; m_remoteFilePath = remoteFilePath; m_connection = connection; - connect(m_connection, SIGNAL(error(QSsh::SshError)), SLOT(handleConnectionFailure())); + connect(m_connection, &QSsh::SshConnection::error, + this, &PackageUploader::handleConnectionFailure); m_uploader = m_connection->createSftpChannel(); connect(m_uploader.data(), SIGNAL(initialized()), this, SLOT(handleSftpChannelInitialized())); diff --git a/src/plugins/remotelinux/publickeydeploymentdialog.cpp b/src/plugins/remotelinux/publickeydeploymentdialog.cpp index 1ddfa8ae51bebeda5685f07f8d1ae1ccb78faf02..062b45f1b604102e516966f9ad0e6e16d119a6bf 100644 --- a/src/plugins/remotelinux/publickeydeploymentdialog.cpp +++ b/src/plugins/remotelinux/publickeydeploymentdialog.cpp @@ -75,9 +75,12 @@ PublicKeyDeploymentDialog::PublicKeyDeploymentDialog(const IDevice::ConstPtr &de d->done = false; setLabelText(tr("Deploying...")); setValue(0); - connect(this, SIGNAL(canceled()), SLOT(handleCanceled())); - connect(&d->keyDeployer, SIGNAL(error(QString)), SLOT(handleDeploymentError(QString))); - connect(&d->keyDeployer, SIGNAL(finishedSuccessfully()), SLOT(handleDeploymentSuccess())); + connect(this, &PublicKeyDeploymentDialog::canceled, + this, &PublicKeyDeploymentDialog::handleCanceled); + connect(&d->keyDeployer, &SshKeyDeployer::error, + this, &PublicKeyDeploymentDialog::handleDeploymentError); + connect(&d->keyDeployer, &SshKeyDeployer::finishedSuccessfully, + this, &PublicKeyDeploymentDialog::handleDeploymentSuccess); d->keyDeployer.deployPublicKey(deviceConfig->sshParameters(), publicKeyFileName); } diff --git a/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp b/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp index f2af592388e8b1b94f84d42bd647aa4a305d2303..6e797901cef78cb8d809eda8d16ab5c99debe33e 100644 --- a/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp +++ b/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp @@ -96,8 +96,8 @@ RemoteLinuxAnalyzeSupport::RemoteLinuxAnalyzeSupport(AbstractRemoteLinuxRunConfi { connect(d->runControl, SIGNAL(starting(const Analyzer::AnalyzerRunControl*)), SLOT(handleRemoteSetupRequested())); - connect(&d->outputParser, SIGNAL(waitingForConnectionOnPort(quint16)), - SLOT(remoteIsRunning())); + connect(&d->outputParser, &QmlDebug::QmlOutputParser::waitingForConnectionOnPort, + this, &RemoteLinuxAnalyzeSupport::remoteIsRunning); } RemoteLinuxAnalyzeSupport::~RemoteLinuxAnalyzeSupport() @@ -133,12 +133,18 @@ void RemoteLinuxAnalyzeSupport::startExecution() setState(StartingRunner); DeviceApplicationRunner *runner = appRunner(); - connect(runner, SIGNAL(remoteStderr(QByteArray)), SLOT(handleRemoteErrorOutput(QByteArray))); - connect(runner, SIGNAL(remoteStdout(QByteArray)), SLOT(handleRemoteOutput(QByteArray))); - connect(runner, SIGNAL(remoteProcessStarted()), SLOT(handleRemoteProcessStarted())); - connect(runner, SIGNAL(finished(bool)), SLOT(handleAppRunnerFinished(bool))); - connect(runner, SIGNAL(reportProgress(QString)), SLOT(handleProgressReport(QString))); - connect(runner, SIGNAL(reportError(QString)), SLOT(handleAppRunnerError(QString))); + connect(runner, &DeviceApplicationRunner::remoteStderr, + this, &RemoteLinuxAnalyzeSupport::handleRemoteErrorOutput); + connect(runner, &DeviceApplicationRunner::remoteStdout, + this, &RemoteLinuxAnalyzeSupport::handleRemoteOutput); + connect(runner, &DeviceApplicationRunner::remoteProcessStarted, + this, &RemoteLinuxAnalyzeSupport::handleRemoteProcessStarted); + connect(runner, &DeviceApplicationRunner::finished, + this, &RemoteLinuxAnalyzeSupport::handleAppRunnerFinished); + connect(runner, &DeviceApplicationRunner::reportProgress, + this, &RemoteLinuxAnalyzeSupport::handleProgressReport); + connect(runner, &DeviceApplicationRunner::reportError, + this, &RemoteLinuxAnalyzeSupport::handleAppRunnerError); const QStringList args = arguments() << QString::fromLatin1("-qmljsdebugger=port:%1,block").arg(d->qmlPort); diff --git a/src/plugins/remotelinux/remotelinuxcheckforfreediskspaceservice.cpp b/src/plugins/remotelinux/remotelinuxcheckforfreediskspaceservice.cpp index 74a66f3d7c6fb319d8f09d2e77f0b1f7f02fb865..f8ec06c55293344aa52b9b306b4fcc3b2da42018 100644 --- a/src/plugins/remotelinux/remotelinuxcheckforfreediskspaceservice.cpp +++ b/src/plugins/remotelinux/remotelinuxcheckforfreediskspaceservice.cpp @@ -129,8 +129,10 @@ bool RemoteLinuxCheckForFreeDiskSpaceService::isDeploymentPossible(QString *whyN void RemoteLinuxCheckForFreeDiskSpaceService::doDeploy() { d->processRunner = new QSsh::SshRemoteProcessRunner; - connect(d->processRunner, SIGNAL(processClosed(int)), SLOT(handleProcessFinished())); - connect(d->processRunner, SIGNAL(readyReadStandardError()), SLOT(handleStdErr())); + connect(d->processRunner, &QSsh::SshRemoteProcessRunner::processClosed, + this, &RemoteLinuxCheckForFreeDiskSpaceService::handleProcessFinished); + connect(d->processRunner, &QSsh::SshRemoteProcessRunner::readyReadStandardError, + this, &RemoteLinuxCheckForFreeDiskSpaceService::handleStdErr); const QString command = QString::fromLatin1("df -k %1 |tail -n 1 |sed 's/ */ /g' " "|cut -d ' ' -f 4").arg(d->pathToCheck); d->processRunner->run(command.toUtf8(), deviceConfiguration()->sshParameters()); diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp index d30f90f87eec5190089f9e5c7926000593d79096..f4b6ba6613138f5db05089ea646656272e8c26c6 100644 --- a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp +++ b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp @@ -168,10 +168,13 @@ void LinuxDeviceDebugSupport::startExecution() d->gdbserverOutput.clear(); DeviceApplicationRunner *runner = appRunner(); - connect(runner, SIGNAL(remoteStderr(QByteArray)), SLOT(handleRemoteErrorOutput(QByteArray))); - connect(runner, SIGNAL(remoteStdout(QByteArray)), SLOT(handleRemoteOutput(QByteArray))); + connect(runner, &DeviceApplicationRunner::remoteStderr, + this, &LinuxDeviceDebugSupport::handleRemoteErrorOutput); + connect(runner, &DeviceApplicationRunner::remoteStdout, + this, &LinuxDeviceDebugSupport::handleRemoteOutput); if (d->qmlDebugging && !d->cppDebugging) - connect(runner, SIGNAL(remoteProcessStarted()), SLOT(handleRemoteProcessStarted())); + connect(runner, &DeviceApplicationRunner::remoteProcessStarted, + this, &LinuxDeviceDebugSupport::handleRemoteProcessStarted); QStringList args = arguments(); QString command; @@ -190,9 +193,12 @@ void LinuxDeviceDebugSupport::startExecution() args.append(QString::fromLatin1(":%1").arg(d->gdbServerPort)); } - connect(runner, SIGNAL(finished(bool)), SLOT(handleAppRunnerFinished(bool))); - connect(runner, SIGNAL(reportProgress(QString)), SLOT(handleProgressReport(QString))); - connect(runner, SIGNAL(reportError(QString)), SLOT(handleAppRunnerError(QString))); + connect(runner, &DeviceApplicationRunner::finished, + this, &LinuxDeviceDebugSupport::handleAppRunnerFinished); + connect(runner, &DeviceApplicationRunner::reportProgress, + this, &LinuxDeviceDebugSupport::handleProgressReport); + connect(runner, &DeviceApplicationRunner::reportError, + this, &LinuxDeviceDebugSupport::handleAppRunnerError); runner->setEnvironment(environment()); runner->setWorkingDirectory(workingDirectory()); runner->start(device(), command, args); diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.cpp b/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.cpp index 99b9a5445afab9ec4d8d12ec46250040247860f6..db56751be94bae962d34d54dfeb58da03d53e790 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.cpp +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.cpp @@ -50,9 +50,11 @@ RemoteLinuxEnvironmentAspectWidget::RemoteLinuxEnvironmentAspectWidget(RemoteLin { QPushButton *button = fetchButton(); button->setText(FetchEnvButtonText); - connect(button, SIGNAL(clicked()), this, SLOT(fetchEnvironment())); - connect(deviceEnvReader, SIGNAL(finished()), this, SLOT(fetchEnvironmentFinished())); - connect(deviceEnvReader, SIGNAL(error(QString)), this, SLOT(fetchEnvironmentError(QString))); + connect(button, &QPushButton::clicked, this, &RemoteLinuxEnvironmentAspectWidget::fetchEnvironment); + connect(deviceEnvReader, &Internal::RemoteLinuxEnvironmentReader::finished, + this, &RemoteLinuxEnvironmentAspectWidget::fetchEnvironmentFinished); + connect(deviceEnvReader, &Internal::RemoteLinuxEnvironmentReader::error, + this, &RemoteLinuxEnvironmentAspectWidget::fetchEnvironmentError); } RemoteLinuxEnvironmentAspect *RemoteLinuxEnvironmentAspectWidget::aspect() const @@ -68,8 +70,10 @@ QPushButton *RemoteLinuxEnvironmentAspectWidget::fetchButton() const void RemoteLinuxEnvironmentAspectWidget::fetchEnvironment() { QPushButton *button = fetchButton(); - disconnect(button, SIGNAL(clicked()), this, SLOT(fetchEnvironment())); - connect(button, SIGNAL(clicked()), this, SLOT(stopFetchEnvironment())); + disconnect(button, &QPushButton::clicked, + this, &RemoteLinuxEnvironmentAspectWidget::fetchEnvironment); + connect(button, &QPushButton::clicked, + this, &RemoteLinuxEnvironmentAspectWidget::stopFetchEnvironment); button->setText(tr("Cancel Fetch Operation")); deviceEnvReader->start(); } @@ -77,8 +81,10 @@ void RemoteLinuxEnvironmentAspectWidget::fetchEnvironment() void RemoteLinuxEnvironmentAspectWidget::fetchEnvironmentFinished() { QPushButton *button = fetchButton(); - disconnect(button, SIGNAL(clicked()), this, SLOT(stopFetchEnvironment())); - connect(button, SIGNAL(clicked()), this, SLOT(fetchEnvironment())); + disconnect(button, &QPushButton::clicked, + this, &RemoteLinuxEnvironmentAspectWidget::stopFetchEnvironment); + connect(button, &QPushButton::clicked, + this, &RemoteLinuxEnvironmentAspectWidget::fetchEnvironment); button->setText(FetchEnvButtonText); aspect()->setRemoteEnvironment(deviceEnvReader->remoteEnvironment()); } diff --git a/src/plugins/remotelinux/remotelinuxenvironmentreader.cpp b/src/plugins/remotelinux/remotelinuxenvironmentreader.cpp index e909733cc8d052201bd8ede542c5cf84167940a3..810ca26048aef328c1c97b6102035b8ec7c7c480 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentreader.cpp +++ b/src/plugins/remotelinux/remotelinuxenvironmentreader.cpp @@ -58,8 +58,10 @@ void RemoteLinuxEnvironmentReader::start() return; m_stop = false; m_deviceProcess = device->createProcess(this); - connect(m_deviceProcess, SIGNAL(error(QProcess::ProcessError)), SLOT(handleError())); - connect(m_deviceProcess, SIGNAL(finished()), SLOT(remoteProcessFinished())); + connect(m_deviceProcess, &ProjectExplorer::DeviceProcess::error, + this, &RemoteLinuxEnvironmentReader::handleError); + connect(m_deviceProcess, &ProjectExplorer::DeviceProcess::finished, + this, &RemoteLinuxEnvironmentReader::remoteProcessFinished); m_deviceProcess->start(QLatin1String("env")); } diff --git a/src/plugins/remotelinux/remotelinuxpackageinstaller.cpp b/src/plugins/remotelinux/remotelinuxpackageinstaller.cpp index 8073c85591f20a12715aab4d2d431d6d22ff8ada..d20be3f6acbd2ffa58490c430ac097505ae7a4a6 100644 --- a/src/plugins/remotelinux/remotelinuxpackageinstaller.cpp +++ b/src/plugins/remotelinux/remotelinuxpackageinstaller.cpp @@ -70,10 +70,14 @@ void AbstractRemoteLinuxPackageInstaller::installPackage(const IDevice::ConstPtr prepareInstallation(); if (!d->installer) d->installer = new SshRemoteProcessRunner(this); - connect(d->installer, SIGNAL(connectionError()), SLOT(handleConnectionError())); - connect(d->installer, SIGNAL(readyReadStandardOutput()), SLOT(handleInstallerOutput())); - connect(d->installer, SIGNAL(readyReadStandardError()), SLOT(handleInstallerErrorOutput())); - connect(d->installer, SIGNAL(processClosed(int)), SLOT(handleInstallationFinished(int))); + connect(d->installer, &QSsh::SshRemoteProcessRunner::connectionError, + this, &AbstractRemoteLinuxPackageInstaller::handleConnectionError); + connect(d->installer, &QSsh::SshRemoteProcessRunner::readyReadStandardOutput, + this, &AbstractRemoteLinuxPackageInstaller::handleInstallerOutput); + connect(d->installer, &QSsh::SshRemoteProcessRunner::readyReadStandardError, + this, &AbstractRemoteLinuxPackageInstaller::handleInstallerErrorOutput); + connect(d->installer, &QSsh::SshRemoteProcessRunner::processClosed, + this, &AbstractRemoteLinuxPackageInstaller::handleInstallationFinished); QString cmdLine = installCommandLine(packageFilePath); if (removePackageFile) diff --git a/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.cpp b/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.cpp index acd6bc7755b59d4ffaa7f0c175aea5a6bb193f6b..68aeac90749aaa26bbd12f48983aa16d9cef11b8 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.cpp +++ b/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.cpp @@ -88,8 +88,8 @@ RemoteLinuxRunConfigurationWidget::RemoteLinuxRunConfigurationWidget(RemoteLinux mainLayout->setMargin(0); addGenericWidgets(mainLayout); - connect(d->runConfiguration, SIGNAL(enabledChanged()), - SLOT(runConfigurationEnabledChange())); + connect(d->runConfiguration, &RemoteLinuxRunConfiguration::enabledChanged, + this, &RemoteLinuxRunConfigurationWidget::runConfigurationEnabledChange); runConfigurationEnabledChange(); } @@ -157,16 +157,18 @@ void RemoteLinuxRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayou d->workingDirLineEdit.setText(d->runConfiguration->workingDirectory()); d->genericWidgetsLayout.addRow(tr("Working directory:"), &d->workingDirLineEdit); - connect(&d->argsLineEdit, SIGNAL(textEdited(QString)), SLOT(argumentsEdited(QString))); - connect(d->runConfiguration, SIGNAL(targetInformationChanged()), this, - SLOT(updateTargetInformation())); - connect(d->runConfiguration, SIGNAL(deploySpecsChanged()), SLOT(handleDeploySpecsChanged())); - connect(&d->useAlternateCommandBox, SIGNAL(toggled(bool)), - SLOT(handleUseAlternateCommandChanged())); - connect(&d->alternateCommand, SIGNAL(textEdited(QString)), - SLOT(handleAlternateCommandChanged())); - connect(&d->workingDirLineEdit, SIGNAL(textEdited(QString)), - SLOT(handleWorkingDirectoryChanged())); + connect(&d->argsLineEdit, &QLineEdit::textEdited, + this, &RemoteLinuxRunConfigurationWidget::argumentsEdited); + connect(d->runConfiguration, &RemoteLinuxRunConfiguration::targetInformationChanged, + this, &RemoteLinuxRunConfigurationWidget::updateTargetInformation); + connect(d->runConfiguration, &RemoteLinuxRunConfiguration::deploySpecsChanged, + this, &RemoteLinuxRunConfigurationWidget::handleDeploySpecsChanged); + connect(&d->useAlternateCommandBox, &QCheckBox::toggled, + this, &RemoteLinuxRunConfigurationWidget::handleUseAlternateCommandChanged); + connect(&d->alternateCommand, &QLineEdit::textEdited, + this, &RemoteLinuxRunConfigurationWidget::handleAlternateCommandChanged); + connect(&d->workingDirLineEdit, &QLineEdit::textEdited, + this, &RemoteLinuxRunConfigurationWidget::handleWorkingDirectoryChanged); handleDeploySpecsChanged(); handleUseAlternateCommandChanged(); } diff --git a/src/plugins/remotelinux/remotelinuxruncontrol.cpp b/src/plugins/remotelinux/remotelinuxruncontrol.cpp index 4667d90f792a8c654cf7c01da8ac863b4e45f8c7..ec9a4dec48da36dc4fc5516cfd07fa840a8a90c3 100644 --- a/src/plugins/remotelinux/remotelinuxruncontrol.cpp +++ b/src/plugins/remotelinux/remotelinuxruncontrol.cpp @@ -80,12 +80,16 @@ void RemoteLinuxRunControl::start() d->running = true; emit started(); d->runner.disconnect(this); - connect(&d->runner, SIGNAL(reportError(QString)), SLOT(handleErrorMessage(QString))); - connect(&d->runner, SIGNAL(remoteStderr(QByteArray)), - SLOT(handleRemoteErrorOutput(QByteArray))); - connect(&d->runner, SIGNAL(remoteStdout(QByteArray)), SLOT(handleRemoteOutput(QByteArray))); - connect(&d->runner, SIGNAL(finished(bool)), SLOT(handleRunnerFinished())); - connect(&d->runner, SIGNAL(reportProgress(QString)), SLOT(handleProgressReport(QString))); + connect(&d->runner, &ProjectExplorer::DeviceApplicationRunner::reportError, + this, &RemoteLinuxRunControl::handleErrorMessage); + connect(&d->runner, &ProjectExplorer::DeviceApplicationRunner::remoteStderr, + this, &RemoteLinuxRunControl::handleRemoteErrorOutput); + connect(&d->runner, &ProjectExplorer::DeviceApplicationRunner::remoteStdout, + this, &RemoteLinuxRunControl::handleRemoteOutput); + connect(&d->runner, &ProjectExplorer::DeviceApplicationRunner::finished, + this, &RemoteLinuxRunControl::handleRunnerFinished); + connect(&d->runner, &ProjectExplorer::DeviceApplicationRunner::reportProgress, + this, &RemoteLinuxRunControl::handleProgressReport); d->runner.setEnvironment(d->environment); d->runner.setWorkingDirectory(d->workingDir); d->runner.start(d->device, d->remoteExecutable, d->arguments); diff --git a/src/plugins/remotelinux/remotelinuxsignaloperation.cpp b/src/plugins/remotelinux/remotelinuxsignaloperation.cpp index 8133fe4b89d0691f384a548ada52468c7413f296..bd593f8cef2aa7cb18d4a27d2ed58eb2f99e97f8 100644 --- a/src/plugins/remotelinux/remotelinuxsignaloperation.cpp +++ b/src/plugins/remotelinux/remotelinuxsignaloperation.cpp @@ -47,8 +47,10 @@ RemoteLinuxSignalOperation::RemoteLinuxSignalOperation( RemoteLinuxSignalOperation::~RemoteLinuxSignalOperation() { if (m_runner) { - connect(m_runner, SIGNAL(processClosed(int)), m_runner, SLOT(deleteLater())); - connect(m_runner, SIGNAL(connectionError()), m_runner, SLOT(deleteLater())); + connect(m_runner, &QSsh::SshRemoteProcessRunner::processClosed, + m_runner, &QSsh::SshRemoteProcessRunner::deleteLater); + connect(m_runner, &QSsh::SshRemoteProcessRunner::connectionError, + m_runner, &QSsh::SshRemoteProcessRunner::deleteLater); } } diff --git a/src/plugins/remotelinux/sshkeydeployer.cpp b/src/plugins/remotelinux/sshkeydeployer.cpp index 3d9f28d7be7d9f0f1e99376a2b53d3d61e0efb57..26249d680c37066ebf8de5494a404bf14e90b2c3 100644 --- a/src/plugins/remotelinux/sshkeydeployer.cpp +++ b/src/plugins/remotelinux/sshkeydeployer.cpp @@ -67,8 +67,10 @@ void SshKeyDeployer::deployPublicKey(const SshConnectionParameters &sshParams, return; } - connect(&d->deployProcess, SIGNAL(connectionError()), SLOT(handleConnectionFailure())); - connect(&d->deployProcess, SIGNAL(processClosed(int)), SLOT(handleKeyUploadFinished(int))); + connect(&d->deployProcess, &SshRemoteProcessRunner::connectionError, + this, &SshKeyDeployer::handleConnectionFailure); + connect(&d->deployProcess, &SshRemoteProcessRunner::processClosed, + this, &SshKeyDeployer::handleKeyUploadFinished); const QByteArray command = "test -d .ssh " "|| mkdir .ssh && chmod 0700 .ssh && echo '" + reader.data() + "' >> .ssh/authorized_keys && chmod 0600 .ssh/authorized_keys"; diff --git a/src/plugins/valgrind/callgrindengine.cpp b/src/plugins/valgrind/callgrindengine.cpp index f40bccc2aeabdf7e0bde19d7b432eb9351228395..7b872e0368cc0c6d6d682c36f6d2b541c538b4e8 100644 --- a/src/plugins/valgrind/callgrindengine.cpp +++ b/src/plugins/valgrind/callgrindengine.cpp @@ -48,9 +48,11 @@ CallgrindRunControl::CallgrindRunControl(const AnalyzerStartParameters &sp, : ValgrindRunControl(sp, runConfiguration) , m_markAsPaused(false) { - connect(&m_runner, SIGNAL(finished()), this, SLOT(slotFinished())); + connect(&m_runner, &Valgrind::Callgrind::CallgrindRunner::finished, + this, &CallgrindRunControl::slotFinished); connect(m_runner.parser(), SIGNAL(parserDataReady()), this, SLOT(slotFinished())); - connect(&m_runner, SIGNAL(statusMessage(QString)), SLOT(showStatusMessage(QString))); + connect(&m_runner, &Valgrind::Callgrind::CallgrindRunner::statusMessage, + this, &CallgrindRunControl::showStatusMessage); } void CallgrindRunControl::showStatusMessage(const QString &msg) diff --git a/src/plugins/valgrind/memcheckengine.cpp b/src/plugins/valgrind/memcheckengine.cpp index eb997ec15e83dc176d0aeca2649e3b792148559f..992aed5e40ff64a5a7c7af9f175f84c4cef817c7 100644 --- a/src/plugins/valgrind/memcheckengine.cpp +++ b/src/plugins/valgrind/memcheckengine.cpp @@ -52,12 +52,12 @@ MemcheckRunControl::MemcheckRunControl(const AnalyzerStartParameters &sp, ProjectExplorer::RunConfiguration *runConfiguration) : ValgrindRunControl(sp, runConfiguration) { - connect(&m_parser, SIGNAL(error(Valgrind::XmlProtocol::Error)), - SIGNAL(parserError(Valgrind::XmlProtocol::Error))); - connect(&m_parser, SIGNAL(suppressionCount(QString,qint64)), - SIGNAL(suppressionCount(QString,qint64))); - connect(&m_parser, SIGNAL(internalError(QString)), - SIGNAL(internalParserError(QString))); + connect(&m_parser, &XmlProtocol::ThreadedParser::error, + this, &MemcheckRunControl::parserError); + connect(&m_parser, &XmlProtocol::ThreadedParser::suppressionCount, + this, &MemcheckRunControl::suppressionCount); + connect(&m_parser, &XmlProtocol::ThreadedParser::internalError, + this, &MemcheckRunControl::internalParserError); } QString MemcheckRunControl::progressTitle() const diff --git a/src/plugins/valgrind/memcheckerrorview.cpp b/src/plugins/valgrind/memcheckerrorview.cpp index 7a4ebf57e9879a960bacceb7b8cf90c178f5a8e1..69a0803fbdc7caab87a28749633a719414eae2a5 100644 --- a/src/plugins/valgrind/memcheckerrorview.cpp +++ b/src/plugins/valgrind/memcheckerrorview.cpp @@ -187,8 +187,7 @@ QWidget *MemcheckErrorDelegate::createDetailsWidget(const QFont & font, errorLocation(errorIndex, error, /*link=*/ true, /*absolutePath=*/ false, linkStyle), linkStyle)); - connect(errorLabel, &QLabel::linkActivated, - this, &MemcheckErrorDelegate::openLinkInEditor); + connect(errorLabel, &QLabel::linkActivated, this, &MemcheckErrorDelegate::openLinkInEditor); layout->addWidget(errorLabel); const QVector<Stack> stacks = error.stacks(); @@ -223,8 +222,7 @@ QWidget *MemcheckErrorDelegate::createDetailsWidget(const QFont & font, QFont fixedPitchFont = font; fixedPitchFont.setFixedPitch(true); frameLabel->setFont(fixedPitchFont); - connect(frameLabel, &QLabel::linkActivated, - this, &MemcheckErrorDelegate::openLinkInEditor); + connect(frameLabel, &QLabel::linkActivated, this, &MemcheckErrorDelegate::openLinkInEditor); // pad frameNr to 2 chars since only 50 frames max are supported by valgrind const QString displayText = displayTextTemplate .arg(frameNr++, 2).arg(frameName); diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index e3b3888d6ff6e9e02965fc93d44874bc3f6a5b92..84cc977fe3035c2d0b710e10046ccd1ece41af90 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -250,12 +250,12 @@ void MemcheckTool::updateFromSettings() m_filterProjectAction->setChecked(!m_settings->filterExternalIssues()); m_errorView->settingsChanged(m_settings); - connect(m_settings, SIGNAL(visibleErrorKindsChanged(QList<int>)), - m_errorProxyModel, SLOT(setAcceptedKinds(QList<int>))); + connect(m_settings, &ValgrindBaseSettings::visibleErrorKindsChanged, + m_errorProxyModel, &MemcheckErrorFilterProxyModel::setAcceptedKinds); m_errorProxyModel->setAcceptedKinds(m_settings->visibleErrorKinds()); - connect(m_settings, SIGNAL(filterExternalIssuesChanged(bool)), - m_errorProxyModel, SLOT(setFilterExternalIssues(bool))); + connect(m_settings, &ValgrindBaseSettings::filterExternalIssuesChanged, + m_errorProxyModel, &MemcheckErrorFilterProxyModel::setFilterExternalIssues); m_errorProxyModel->setFilterExternalIssues(m_settings->filterExternalIssues()); } @@ -283,7 +283,7 @@ void MemcheckTool::maybeActiveRunConfigurationChanged() // now make the new settings current, update and connect input widgets m_settings = settings; QTC_ASSERT(m_settings, return); - connect(m_settings, SIGNAL(destroyed(QObject*)), SLOT(settingsDestroyed(QObject*))); + connect(m_settings, &ValgrindBaseSettings::destroyed, this, &MemcheckTool::settingsDestroyed); updateFromSettings(); } @@ -381,7 +381,7 @@ QWidget *MemcheckTool::createWidgets() action = new QAction(this); action->setIcon(QIcon(QLatin1String(Core::Constants::ICON_OPENFILE))); action->setToolTip(tr("Load External XML Log File")); - connect(action, SIGNAL(triggered(bool)), this, SLOT(loadExternalXmlLogFile())); + connect(action, &QAction::triggered, this, &MemcheckTool::loadExternalXmlLogFile); button = new QToolButton; button->setDefaultAction(action); layout->addWidget(button); @@ -421,7 +421,7 @@ QWidget *MemcheckTool::createWidgets() m_filterMenu->addSeparator(); m_filterMenu->addAction(m_filterProjectAction); m_filterMenu->addAction(m_suppressionSeparator); - connect(m_filterMenu, SIGNAL(triggered(QAction*)), SLOT(updateErrorFilter())); + connect(m_filterMenu, &QMenu::triggered, this, &MemcheckTool::updateErrorFilter); filterButton->setMenu(m_filterMenu); layout->addWidget(filterButton); @@ -440,13 +440,10 @@ AnalyzerRunControl *MemcheckTool::createRunControl(const AnalyzerStartParameters MemcheckRunControl *engine = new MemcheckRunControl(sp, runConfiguration); - connect(engine, SIGNAL(starting(const Analyzer::AnalyzerRunControl*)), - this, SLOT(engineStarting(const Analyzer::AnalyzerRunControl*))); - connect(engine, SIGNAL(parserError(Valgrind::XmlProtocol::Error)), - this, SLOT(parserError(Valgrind::XmlProtocol::Error))); - connect(engine, SIGNAL(internalParserError(QString)), - this, SLOT(internalParserError(QString))); - connect(engine, SIGNAL(finished()), this, SLOT(engineFinished())); + connect(engine, &MemcheckRunControl::starting, this, &MemcheckTool::engineStarting); + connect(engine, &MemcheckRunControl::parserError, this, &MemcheckTool::parserError); + connect(engine, &MemcheckRunControl::internalParserError, this, &MemcheckTool::internalParserError); + connect(engine, &MemcheckRunControl::finished, this, &MemcheckTool::engineFinished); return engine; } @@ -470,8 +467,7 @@ void MemcheckTool::engineStarting(const AnalyzerRunControl *engine) QAction *action = m_filterMenu->addAction(Utils::FileName::fromString(file).fileName()); action->setToolTip(file); action->setData(file); - connect(action, SIGNAL(triggered(bool)), - this, SLOT(suppressionActionTriggered())); + connect(action, &QAction::triggered, this, &MemcheckTool::suppressionActionTriggered); m_suppressionActions.append(action); } } @@ -515,12 +511,10 @@ void MemcheckTool::loadExternalXmlLogFile() } ThreadedParser *parser = new ThreadedParser; - connect(parser, SIGNAL(error(Valgrind::XmlProtocol::Error)), - this, SLOT(parserError(Valgrind::XmlProtocol::Error))); - connect(parser, SIGNAL(internalError(QString)), - this, SLOT(internalParserError(QString))); - connect(parser, SIGNAL(finished()), this, SLOT(loadingExternalXmlLogFileFinished())); - connect(parser, SIGNAL(finished()), parser, SLOT(deleteLater())); + connect(parser, &ThreadedParser::error, this, &MemcheckTool::parserError); + connect(parser, &ThreadedParser::internalError, this, &MemcheckTool::internalParserError); + connect(parser, &ThreadedParser::finished, this, &MemcheckTool::loadingExternalXmlLogFileFinished); + connect(parser, &ThreadedParser::finished, parser, &ThreadedParser::deleteLater); parser->parse(logFile); // ThreadedParser owns the file } diff --git a/src/plugins/valgrind/valgrindconfigwidget.cpp b/src/plugins/valgrind/valgrindconfigwidget.cpp index a9e30a9fd32d877ad4892ff7788ad5a6c0189855..918f0673f352f2df71cc1c897b92d153c0ed6fe2 100644 --- a/src/plugins/valgrind/valgrindconfigwidget.cpp +++ b/src/plugins/valgrind/valgrindconfigwidget.cpp @@ -63,14 +63,14 @@ ValgrindConfigWidget::ValgrindConfigWidget(ValgrindBaseSettings *settings, m_ui->valgrindExeChooser->setPromptDialogTitle(tr("Valgrind Command")); updateUi(); - connect(m_settings, SIGNAL(changed()), this, SLOT(updateUi())); + connect(m_settings, &ValgrindBaseSettings::changed, this, &ValgrindConfigWidget::updateUi); - connect(m_ui->valgrindExeChooser, SIGNAL(changed(QString)), - m_settings, SLOT(setValgrindExecutable(QString))); + connect(m_ui->valgrindExeChooser, &Utils::PathChooser::changed, + m_settings, &ValgrindBaseSettings::setValgrindExecutable); connect(m_settings, SIGNAL(valgrindExecutableChanged(QString)), m_ui->valgrindExeChooser, SLOT(setPath(QString))); - connect(m_ui->smcDetectionComboBox, SIGNAL(currentIndexChanged(int)), - m_settings, SLOT(setSelfModifyingCodeDetection(int))); + connect(m_ui->smcDetectionComboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), + m_settings, &ValgrindBaseSettings::setSelfModifyingCodeDetection); if (Utils::HostOsInfo::isWindowsHost()) { // FIXME: On Window we know that we don't have a local valgrind @@ -82,38 +82,38 @@ ValgrindConfigWidget::ValgrindConfigWidget(ValgrindBaseSettings *settings, // // Callgrind // - connect(m_ui->enableCacheSim, SIGNAL(toggled(bool)), - m_settings, SLOT(setEnableCacheSim(bool))); + connect(m_ui->enableCacheSim, &QCheckBox::toggled, + m_settings, &ValgrindBaseSettings::setEnableCacheSim); connect(m_settings, SIGNAL(enableCacheSimChanged(bool)), m_ui->enableCacheSim, SLOT(setChecked(bool))); - connect(m_ui->enableBranchSim, SIGNAL(toggled(bool)), - m_settings, SLOT(setEnableBranchSim(bool))); + connect(m_ui->enableBranchSim, &QCheckBox::toggled, + m_settings, &ValgrindBaseSettings::setEnableBranchSim); connect(m_settings, SIGNAL(enableBranchSimChanged(bool)), m_ui->enableBranchSim, SLOT(setChecked(bool))); - connect(m_ui->collectSystime, SIGNAL(toggled(bool)), - m_settings, SLOT(setCollectSystime(bool))); + connect(m_ui->collectSystime, &QCheckBox::toggled, + m_settings, &ValgrindBaseSettings::setCollectSystime); connect(m_settings, SIGNAL(collectSystimeChanged(bool)), m_ui->collectSystime, SLOT(setChecked(bool))); - connect(m_ui->collectBusEvents, SIGNAL(toggled(bool)), - m_settings, SLOT(setCollectBusEvents(bool))); + connect(m_ui->collectBusEvents, &QCheckBox::toggled, + m_settings, &ValgrindBaseSettings::setCollectBusEvents); connect(m_settings, SIGNAL(collectBusEventsChanged(bool)), m_ui->collectBusEvents, SLOT(setChecked(bool))); - connect(m_ui->enableEventToolTips, SIGNAL(toggled(bool)), - m_settings, SLOT(setEnableEventToolTips(bool))); + connect(m_ui->enableEventToolTips, &QGroupBox::toggled, + m_settings, &ValgrindBaseSettings::setEnableEventToolTips); connect(m_settings, SIGNAL(enableEventToolTipsChanged(bool)), m_ui->enableEventToolTips, SLOT(setChecked(bool))); - connect(m_ui->minimumInclusiveCostRatio, SIGNAL(valueChanged(double)), - m_settings, SLOT(setMinimumInclusiveCostRatio(double))); + connect(m_ui->minimumInclusiveCostRatio, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), + m_settings, &ValgrindBaseSettings::setMinimumInclusiveCostRatio); connect(m_settings, SIGNAL(minimumInclusiveCostRatioChanged(double)), m_ui->minimumInclusiveCostRatio, SLOT(setValue(double))); - connect(m_ui->visualisationMinimumInclusiveCostRatio, SIGNAL(valueChanged(double)), - m_settings, SLOT(setVisualisationMinimumInclusiveCostRatio(double))); + connect(m_ui->visualisationMinimumInclusiveCostRatio, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), + m_settings, &ValgrindBaseSettings::setVisualisationMinimumInclusiveCostRatio); connect(m_settings, SIGNAL(visualisationMinimumInclusiveCostRatioChanged(double)), m_ui->visualisationMinimumInclusiveCostRatio, SLOT(setValue(double))); @@ -123,36 +123,32 @@ ValgrindConfigWidget::ValgrindConfigWidget(ValgrindBaseSettings *settings, m_ui->suppressionList->setModel(m_model); m_ui->suppressionList->setSelectionMode(QAbstractItemView::MultiSelection); - connect(m_ui->addSuppression, SIGNAL(clicked()), - this, SLOT(slotAddSuppression())); - connect(m_ui->removeSuppression, SIGNAL(clicked()), - this, SLOT(slotRemoveSuppression())); + connect(m_ui->addSuppression, &QPushButton::clicked, this, &ValgrindConfigWidget::slotAddSuppression); + connect(m_ui->removeSuppression, &QPushButton::clicked, this, &ValgrindConfigWidget::slotRemoveSuppression); - connect(m_ui->numCallers, SIGNAL(valueChanged(int)), m_settings, SLOT(setNumCallers(int))); + connect(m_ui->numCallers, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), + m_settings, &ValgrindBaseSettings::setNumCallers); connect(m_settings, SIGNAL(numCallersChanged(int)), m_ui->numCallers, SLOT(setValue(int))); - connect(m_ui->leakCheckOnFinish, SIGNAL(currentIndexChanged(int)), - m_settings, SLOT(setLeakCheckOnFinish(int))); + connect(m_ui->leakCheckOnFinish, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), + m_settings, &ValgrindBaseSettings::setLeakCheckOnFinish); connect(m_settings, SIGNAL(leakCheckOnFinishChanged(int)), m_ui->leakCheckOnFinish, SLOT(setCurrentIndex(int))); - connect(m_ui->showReachable, SIGNAL(toggled(bool)), - m_settings, SLOT(setShowReachable(bool))); + connect(m_ui->showReachable, &QCheckBox::toggled, m_settings, &ValgrindBaseSettings::setShowReachable); connect(m_settings, SIGNAL(showReachableChanged(bool)), m_ui->showReachable, SLOT(setChecked(bool))); - connect(m_ui->trackOrigins, SIGNAL(toggled(bool)), - m_settings, SLOT(setTrackOrigins(bool))); + connect(m_ui->trackOrigins, &QCheckBox::toggled, m_settings, &ValgrindBaseSettings::setTrackOrigins); connect(m_settings, SIGNAL(trackOriginsChanged(bool)), m_ui->trackOrigins, SLOT(setChecked(bool))); - connect(m_settings, SIGNAL(suppressionFilesRemoved(QStringList)), - this, SLOT(slotSuppressionsRemoved(QStringList))); - connect(m_settings, SIGNAL(suppressionFilesAdded(QStringList)), - this, SLOT(slotSuppressionsAdded(QStringList))); + connect(m_settings, &ValgrindBaseSettings::suppressionFilesRemoved, + this, &ValgrindConfigWidget::slotSuppressionsRemoved); + connect(m_settings, &ValgrindBaseSettings::suppressionFilesAdded, + this, &ValgrindConfigWidget::slotSuppressionsAdded); - connect(m_ui->suppressionList->selectionModel(), - SIGNAL(selectionChanged(QItemSelection,QItemSelection)), + connect(m_ui->suppressionList->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(slotSuppressionSelectionChanged())); slotSuppressionSelectionChanged(); diff --git a/src/plugins/valgrind/valgrindengine.cpp b/src/plugins/valgrind/valgrindengine.cpp index 9825ff67fcf02739edaf85e2bc2f301c96cb7677..157bc149f8297b5d4b42f1ff3504693c1ccfef3e 100644 --- a/src/plugins/valgrind/valgrindengine.cpp +++ b/src/plugins/valgrind/valgrindengine.cpp @@ -79,8 +79,10 @@ bool ValgrindRunControl::startEngine() FutureProgress *fp = ProgressManager::addTimedTask(m_progress, progressTitle(), "valgrind", 100); fp->setKeepOnFinish(FutureProgress::HideOnFinish); - connect(fp, SIGNAL(canceled()), this, SLOT(handleProgressCanceled())); - connect(fp, SIGNAL(finished()), this, SLOT(handleProgressFinished())); + connect(fp, &FutureProgress::canceled, + this, &ValgrindRunControl::handleProgressCanceled); + connect(fp, &FutureProgress::finished, + this, &ValgrindRunControl::handleProgressFinished); m_progress.reportStarted(); const AnalyzerStartParameters &sp = startParameters(); @@ -101,11 +103,12 @@ bool ValgrindRunControl::startEngine() run->setStartMode(sp.startMode); run->setLocalRunMode(sp.localRunMode); - connect(run, SIGNAL(processOutputReceived(QString,Utils::OutputFormat)), - SLOT(receiveProcessOutput(QString,Utils::OutputFormat))); - connect(run, SIGNAL(processErrorReceived(QString,QProcess::ProcessError)), - SLOT(receiveProcessError(QString,QProcess::ProcessError))); - connect(run, SIGNAL(finished()), SLOT(runnerFinished())); + connect(run, &ValgrindRunner::processOutputReceived, + this, &ValgrindRunControl::receiveProcessOutput); + connect(run, &ValgrindRunner::processErrorReceived, + this, &ValgrindRunControl::receiveProcessError); + connect(run, &ValgrindRunner::finished, + this, &ValgrindRunControl::runnerFinished); if (!run->start()) { m_progress.cancel(); diff --git a/src/plugins/valgrind/valgrindplugin.cpp b/src/plugins/valgrind/valgrindplugin.cpp index d61710892cf04d4fc274c94f65cceb50961726b8..f1932c90efe9169c8616b1eb7909c01bd16fff44 100644 --- a/src/plugins/valgrind/valgrindplugin.cpp +++ b/src/plugins/valgrind/valgrindplugin.cpp @@ -188,7 +188,8 @@ void ValgrindPlugin::extensionsInitialized() QAction *action = new QAction(tr("Profile Costs of This Function and Its Callees"), this); action->setIcon(QIcon(QLatin1String(Analyzer::Constants::ANALYZER_CONTROL_START_ICON))); - connect(action, SIGNAL(triggered()), m_callgrindTool, SLOT(handleShowCostsOfFunction())); + connect(action, &QAction::triggered, m_callgrindTool, + &CallgrindTool::handleShowCostsOfFunction); Command *cmd = ActionManager::registerAction(action, "Analyzer.Callgrind.ShowCostsOfFunction", analyzerContext); editorContextMenu->addAction(cmd);