diff --git a/src/plugins/vcsbase/basecheckoutwizard.cpp b/src/plugins/vcsbase/basecheckoutwizard.cpp index 7ea0b44e9cf..1d48b588af5 100644 --- a/src/plugins/vcsbase/basecheckoutwizard.cpp +++ b/src/plugins/vcsbase/basecheckoutwizard.cpp @@ -51,8 +51,9 @@ BaseCheckoutWizard::BaseCheckoutWizard(const Utils::FileName &path, QWidget *par m_progressPageId(-1) { Q_UNUSED(path); - connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotPageChanged(int))); - connect(m_progressPage, SIGNAL(terminated(bool)), this, SLOT(slotTerminated(bool))); + connect(this, &QWizard::currentIdChanged, this, &BaseCheckoutWizard::slotPageChanged); + connect(m_progressPage, &Internal::CheckoutProgressWizardPage::terminated, + this, &BaseCheckoutWizard::slotTerminated); setOption(QWizard::NoBackButtonOnLastPage); } diff --git a/src/plugins/vcsbase/basecheckoutwizardpage.cpp b/src/plugins/vcsbase/basecheckoutwizardpage.cpp index d92b9a3eac8..d92e7a4fd15 100644 --- a/src/plugins/vcsbase/basecheckoutwizardpage.cpp +++ b/src/plugins/vcsbase/basecheckoutwizardpage.cpp @@ -68,21 +68,27 @@ BaseCheckoutWizardPage::BaseCheckoutWizardPage(QWidget *parent) : { d->ui.setupUi(this); - connect(d->ui.repositoryLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotRepositoryChanged(QString))); + connect(d->ui.repositoryLineEdit, &QLineEdit::textChanged, + this, &BaseCheckoutWizardPage::slotRepositoryChanged); - connect(d->ui.checkoutDirectoryLineEdit, SIGNAL(textChanged(QString)), - this, SLOT(slotChanged())); - connect(d->ui.checkoutDirectoryLineEdit, SIGNAL(textEdited(QString)), this, SLOT(slotDirectoryEdited())); - connect(d->ui.branchComboBox, SIGNAL(currentIndexChanged(int)), - this, SLOT(slotChanged())); + connect(d->ui.checkoutDirectoryLineEdit, &QLineEdit::textChanged, + this, &BaseCheckoutWizardPage::slotChanged); + connect(d->ui.checkoutDirectoryLineEdit, &QLineEdit::textEdited, + this, &BaseCheckoutWizardPage::slotDirectoryEdited); + connect(d->ui.branchComboBox, + static_cast(&QComboBox::currentIndexChanged), + this, &BaseCheckoutWizardPage::slotChanged); d->ui.pathChooser->setExpectedKind(Utils::PathChooser::ExistingDirectory); d->ui.pathChooser->setHistoryCompleter(QLatin1String("Vcs.CheckoutDir.History")); - connect(d->ui.pathChooser, SIGNAL(validChanged()), this, SLOT(slotChanged())); + connect(d->ui.pathChooser, + static_cast(&Utils::PathChooser::validChanged), + this, &BaseCheckoutWizardPage::slotChanged); d->ui.branchComboBox->setEnabled(false); d->ui.branchRefreshToolButton->setIcon(QIcon(QLatin1String(":/locator/images/reload.png"))); - connect(d->ui.branchRefreshToolButton, SIGNAL(clicked()), this, SLOT(slotRefreshBranches())); + connect(d->ui.branchRefreshToolButton, &QAbstractButton::clicked, + this, &BaseCheckoutWizardPage::slotRefreshBranches); } BaseCheckoutWizardPage::~BaseCheckoutWizardPage() diff --git a/src/plugins/vcsbase/cleandialog.cpp b/src/plugins/vcsbase/cleandialog.cpp index aa8c5ef1038..b6d05d17620 100644 --- a/src/plugins/vcsbase/cleandialog.cpp +++ b/src/plugins/vcsbase/cleandialog.cpp @@ -169,10 +169,12 @@ CleanDialog::CleanDialog(QWidget *parent) : d->ui.filesTreeView->setSelectionMode(QAbstractItemView::NoSelection); d->ui.filesTreeView->setAllColumnsShowFocus(true); d->ui.filesTreeView->setRootIsDecorated(false); - connect(d->ui.filesTreeView, SIGNAL(doubleClicked(QModelIndex)), - this, SLOT(slotDoubleClicked(QModelIndex))); - connect(d->ui.selectAllCheckBox, SIGNAL(clicked(bool)), this, SLOT(selectAllItems(bool))); - connect(d->ui.filesTreeView, SIGNAL(clicked(QModelIndex)), this, SLOT(updateSelectAllCheckBox())); + connect(d->ui.filesTreeView, &QAbstractItemView::doubleClicked, + this, &CleanDialog::slotDoubleClicked); + connect(d->ui.selectAllCheckBox, &QAbstractButton::clicked, + this, &CleanDialog::selectAllItems); + connect(d->ui.filesTreeView, &QAbstractItemView::clicked, + this, &CleanDialog::updateSelectAllCheckBox); } CleanDialog::~CleanDialog() @@ -262,8 +264,8 @@ bool CleanDialog::promptToDelete() // Remove in background auto cleanTask = new Internal::CleanFilesTask(d->m_workingDirectory, selectedFiles); - connect(cleanTask, SIGNAL(error(QString)), - VcsOutputWindow::instance(), SLOT(appendSilently(QString)), + connect(cleanTask, &Internal::CleanFilesTask::error, + VcsOutputWindow::instance(), &VcsOutputWindow::appendSilently, Qt::QueuedConnection); QFuture task = QtConcurrent::run(cleanTask, &Internal::CleanFilesTask::run); diff --git a/src/plugins/vcsbase/commonsettingspage.cpp b/src/plugins/vcsbase/commonsettingspage.cpp index 1db5bc379ef..bbdb2094868 100644 --- a/src/plugins/vcsbase/commonsettingspage.cpp +++ b/src/plugins/vcsbase/commonsettingspage.cpp @@ -34,6 +34,7 @@ #include "ui_commonsettingspage.h" #include +#include #include #include @@ -62,8 +63,8 @@ CommonSettingsWidget::CommonSettingsWidget(QWidget *parent) : updatePath(); - connect(Core::VcsManager::instance(), SIGNAL(configurationChanged(const IVersionControl*)), - this, SLOT(updatePath())); + connect(Core::VcsManager::instance(), &Core::VcsManager::configurationChanged, + this, &CommonSettingsWidget::updatePath); } CommonSettingsWidget::~CommonSettingsWidget() diff --git a/src/plugins/vcsbase/nicknamedialog.cpp b/src/plugins/vcsbase/nicknamedialog.cpp index d28c0226db7..56060866664 100644 --- a/src/plugins/vcsbase/nicknamedialog.cpp +++ b/src/plugins/vcsbase/nicknamedialog.cpp @@ -189,12 +189,12 @@ NickNameDialog::NickNameDialog(QStandardItemModel *model, QWidget *parent) : } m_ui->filterTreeView->setMinimumWidth(treeWidth + 20); m_ui->filterLineEdit->setFiltering(true); - connect(m_ui->filterTreeView, SIGNAL(activated(QModelIndex)), this, - SLOT(slotActivated(QModelIndex))); - connect(m_ui->filterTreeView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), - this, SLOT(slotCurrentItemChanged(QModelIndex))); - connect(m_ui->filterLineEdit, SIGNAL(filterChanged(QString)), - m_filterModel, SLOT(setFilterFixedString(QString))); + connect(m_ui->filterTreeView, &QAbstractItemView::activated, this, + &NickNameDialog::slotActivated); + connect(m_ui->filterTreeView->selectionModel(), &QItemSelectionModel::currentRowChanged, + this, &NickNameDialog::slotCurrentItemChanged); + connect(m_ui->filterLineEdit, &Utils::FancyLineEdit::filterChanged, + m_filterModel, &QSortFilterProxyModel::setFilterFixedString); } NickNameDialog::~NickNameDialog() diff --git a/src/plugins/vcsbase/submitfieldwidget.cpp b/src/plugins/vcsbase/submitfieldwidget.cpp index 5ee062c5a83..d17c5bd27a6 100644 --- a/src/plugins/vcsbase/submitfieldwidget.cpp +++ b/src/plugins/vcsbase/submitfieldwidget.cpp @@ -298,17 +298,17 @@ void SubmitFieldWidget::createField(const QString &f) } } - connect(fe.browseButton, SIGNAL(clicked()), this, SLOT(slotBrowseButtonClicked())); + connect(fe.browseButton, &QAbstractButton::clicked, this, &SubmitFieldWidget::slotBrowseButtonClicked); if (!d->hasBrowseButton) fe.browseButton->setVisible(false); if (d->completer) fe.lineEdit->setCompleter(d->completer); - connect(fe.combo, SIGNAL(currentIndexChanged(int)), - this, SLOT(slotComboIndexChanged(int))); - connect(fe.clearButton, SIGNAL(clicked()), - this, SLOT(slotRemove())); + connect(fe.combo, static_cast(&QComboBox::currentIndexChanged), + this, &SubmitFieldWidget::slotComboIndexChanged); + connect(fe.clearButton, &QAbstractButton::clicked, + this, &SubmitFieldWidget::slotRemove); d->layout->addLayout(fe.layout); d->fieldEntries.push_back(fe); } diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index f3fc5e62f1f..868741f6acd 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -346,7 +346,7 @@ void ChangeTextCursorHandler::slotCopyRevision() QAction *ChangeTextCursorHandler::createDescribeAction(const QString &change) const { auto a = new QAction(VcsBaseEditorWidget::tr("Describe Change %1").arg(change), 0); - connect(a, SIGNAL(triggered()), this, SLOT(slotDescribe())); + connect(a, &QAction::triggered, this, &ChangeTextCursorHandler::slotDescribe); return a; } @@ -359,7 +359,7 @@ QAction *ChangeTextCursorHandler::createAnnotateAction(const QString &change, bo editorWidget()->annotateRevisionTextFormat(); auto a = new QAction(format.arg(change), 0); a->setData(change); - connect(a, SIGNAL(triggered()), editorWidget(), SLOT(slotAnnotateRevision())); + connect(a, &QAction::triggered, editorWidget(), &VcsBaseEditorWidget::slotAnnotateRevision); return a; } @@ -367,7 +367,7 @@ QAction *ChangeTextCursorHandler::createCopyRevisionAction(const QString &change { auto a = new QAction(editorWidget()->copyRevisionTextFormat().arg(change), 0); a->setData(change); - connect(a, SIGNAL(triggered()), this, SLOT(slotCopyRevision())); + connect(a, &QAction::triggered, this, &ChangeTextCursorHandler::slotCopyRevision); return a; } @@ -499,7 +499,7 @@ QAction *UrlTextCursorHandler::createOpenUrlAction(const QString &text) const { auto a = new QAction(text, 0); a->setData(m_urlData.url); - connect(a, SIGNAL(triggered()), this, SLOT(slotOpenUrl())); + connect(a, &QAction::triggered, this, &UrlTextCursorHandler::slotOpenUrl); return a; } @@ -507,7 +507,7 @@ QAction *UrlTextCursorHandler::createCopyUrlAction(const QString &text) const { auto a = new QAction(text, 0); a->setData(m_urlData.url); - connect(a, SIGNAL(triggered()), this, SLOT(slotCopyUrl())); + connect(a, &QAction::triggered, this, &UrlTextCursorHandler::slotCopyUrl); return a; } @@ -714,19 +714,25 @@ void VcsBaseEditorWidget::init() case OtherContent: break; case LogOutput: - connect(d->entriesComboBox(), SIGNAL(activated(int)), this, SLOT(slotJumpToEntry(int))); - connect(this, SIGNAL(textChanged()), this, SLOT(slotPopulateLogBrowser())); - connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(slotCursorPositionChanged())); + connect(d->entriesComboBox(), static_cast(&QComboBox::activated), + this, &VcsBaseEditorWidget::slotJumpToEntry); + connect(this, &QPlainTextEdit::textChanged, + this, &VcsBaseEditorWidget::slotPopulateLogBrowser); + connect(this, &QPlainTextEdit::cursorPositionChanged, + this, &VcsBaseEditorWidget::slotCursorPositionChanged); break; case AnnotateOutput: // Annotation highlighting depends on contents, which is set later on - connect(this, SIGNAL(textChanged()), this, SLOT(slotActivateAnnotation())); + connect(this, &QPlainTextEdit::textChanged, this, &VcsBaseEditorWidget::slotActivateAnnotation); break; case DiffOutput: // Diff: set up diff file browsing - connect(d->entriesComboBox(), SIGNAL(activated(int)), this, SLOT(slotJumpToEntry(int))); - connect(this, SIGNAL(textChanged()), this, SLOT(slotPopulateDiffBrowser())); - connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(slotCursorPositionChanged())); + connect(d->entriesComboBox(), static_cast(&QComboBox::activated), + this, &VcsBaseEditorWidget::slotJumpToEntry); + connect(this, &QPlainTextEdit::textChanged, + this, &VcsBaseEditorWidget::slotPopulateDiffBrowser); + connect(this, &QPlainTextEdit::cursorPositionChanged, + this, &VcsBaseEditorWidget::slotCursorPositionChanged); break; } if (hasDiff()) { @@ -948,8 +954,8 @@ void VcsBaseEditorWidget::contextMenuEvent(QContextMenuEvent *e) case LogOutput: // log might have diff case DiffOutput: { menu->addSeparator(); - connect(menu->addAction(tr("Send to CodePaster...")), SIGNAL(triggered()), - this, SLOT(slotPaste())); + connect(menu->addAction(tr("Send to CodePaster...")), &QAction::triggered, + this, &VcsBaseEditorWidget::slotPaste); menu->addSeparator(); // Apply/revert diff chunk. const DiffChunk chunk = diffChunk(cursorForPosition(e->pos())); @@ -962,11 +968,11 @@ void VcsBaseEditorWidget::contextMenuEvent(QContextMenuEvent *e) // fileNameFromDiffSpecification() works. QAction *applyAction = menu->addAction(tr("Apply Chunk...")); applyAction->setData(qVariantFromValue(Internal::DiffChunkAction(chunk, false))); - connect(applyAction, SIGNAL(triggered()), this, SLOT(slotApplyDiffChunk())); + connect(applyAction, &QAction::triggered, this, &VcsBaseEditorWidget::slotApplyDiffChunk); // Revert a chunk from a VCS diff, which might be linked to reloading the diff. QAction *revertAction = menu->addAction(tr("Revert Chunk...")); revertAction->setData(qVariantFromValue(Internal::DiffChunkAction(chunk, true))); - connect(revertAction, SIGNAL(triggered()), this, SLOT(slotApplyDiffChunk())); + connect(revertAction, &QAction::triggered, this, &VcsBaseEditorWidget::slotApplyDiffChunk); // Custom diff actions addDiffActions(menu, chunk); break; @@ -974,7 +980,7 @@ void VcsBaseEditorWidget::contextMenuEvent(QContextMenuEvent *e) default: break; } - connect(this, SIGNAL(destroyed()), menu, SLOT(deleteLater())); + connect(this, &QObject::destroyed, menu, &QObject::deleteLater); menu->exec(e->globalPos()); delete menu; } @@ -1058,7 +1064,7 @@ void VcsBaseEditorWidget::slotActivateAnnotation() if (changes.isEmpty()) return; - disconnect(this, SIGNAL(textChanged()), this, SLOT(slotActivateAnnotation())); + disconnect(this, &QPlainTextEdit::textChanged, this, &VcsBaseEditorWidget::slotActivateAnnotation); if (BaseAnnotationHighlighter *ah = qobject_cast(textDocument()->syntaxHighlighter())) { ah->setChangeNumbers(changes); diff --git a/src/plugins/vcsbase/vcsplugin.cpp b/src/plugins/vcsbase/vcsplugin.cpp index 433835d8223..e6fc52782fb 100644 --- a/src/plugins/vcsbase/vcsplugin.cpp +++ b/src/plugins/vcsbase/vcsplugin.cpp @@ -86,10 +86,10 @@ bool VcsPlugin::initialize(const QStringList &arguments, QString *errorMessage) m_settingsPage = new CommonOptionsPage; addAutoReleasedObject(m_settingsPage); addAutoReleasedObject(VcsOutputWindow::instance()); - connect(m_settingsPage, SIGNAL(settingsChanged(VcsBase::Internal::CommonVcsSettings)), - this, SIGNAL(settingsChanged(VcsBase::Internal::CommonVcsSettings))); - connect(m_settingsPage, SIGNAL(settingsChanged(VcsBase::Internal::CommonVcsSettings)), - this, SLOT(slotSettingsChanged())); + connect(m_settingsPage, &CommonOptionsPage::settingsChanged, + this, &VcsPlugin::settingsChanged); + connect(m_settingsPage, &CommonOptionsPage::settingsChanged, + this, &VcsPlugin::slotSettingsChanged); slotSettingsChanged(); JsonWizardFactory::registerPageFactory(new Internal::VcsConfigurationPageFactory); diff --git a/src/plugins/vcsbase/wizard/vcsconfigurationpage.cpp b/src/plugins/vcsbase/wizard/vcsconfigurationpage.cpp index d0f88bfa5f3..98137c1bd5a 100644 --- a/src/plugins/vcsbase/wizard/vcsconfigurationpage.cpp +++ b/src/plugins/vcsbase/wizard/vcsconfigurationpage.cpp @@ -116,8 +116,10 @@ VcsConfigurationPage::VcsConfigurationPage() : d(new Internal::VcsConfigurationP auto verticalLayout = new QVBoxLayout(this); verticalLayout->addWidget(d->m_configureButton); - connect(d->m_versionControl, SIGNAL(configurationChanged()), SIGNAL(completeChanged())); - connect(d->m_configureButton, SIGNAL(clicked()), SLOT(openConfiguration())); + connect(d->m_versionControl, &IVersionControl::configurationChanged, + this, &QWizardPage::completeChanged); + connect(d->m_configureButton, &QAbstractButton::clicked, + this, &VcsConfigurationPage::openConfiguration); } VcsConfigurationPage::~VcsConfigurationPage()