Use QOverload

parent 9680ec8a
......@@ -68,7 +68,7 @@ BreakpointDetails::BreakpointDetails(QWidget *parent)
d->ignore = new QSpinBox(this);
hitsLayout->addWidget(d->ignore, 2, 1);
d->ignore->setRange(0, 99999);
connect(d->ignore, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &BreakpointDetails::setIgnoreHits);
connect(d->ignore, QOverload<int>::of(&QSpinBox::valueChanged), this, &BreakpointDetails::setIgnoreHits);
QLabel *l3 = new QLabel(i18n("next hits"), this);
hitsLayout->addWidget(l3, 2, 2);
......
......@@ -88,7 +88,7 @@ VariableWidget::VariableWidget(IDebugController* controller, QWidget *parent)
topLayout->addWidget(m_watchVarEditor);
topLayout->setMargin(0);
connect(m_watchVarEditor, static_cast<void(KHistoryComboBox::*)(const QString&)>(&KHistoryComboBox::returnPressed),
connect(m_watchVarEditor, QOverload<const QString&>::of(&KHistoryComboBox::returnPressed),
this, &VariableWidget::slotAddWatch);
//TODO
......
......@@ -106,7 +106,7 @@ void DocumentationView::setupActions()
/* vertical size policy should be left to the style. */
mIdentifiers->setSizePolicy(QSizePolicy::Expanding, mIdentifiers->sizePolicy().verticalPolicy());
connect(mIdentifiers->completer(), static_cast<void(QCompleter::*)(const QModelIndex&)>(&QCompleter::activated),
connect(mIdentifiers->completer(), QOverload<const QModelIndex&>::of(&QCompleter::activated),
this, &DocumentationView::changedSelection);
connect(mIdentifiers, &QLineEdit::returnPressed, this, &DocumentationView::returnPressed);
auto identifiersAction = new QWidgetAction(this);
......@@ -131,7 +131,7 @@ void DocumentationView::setupActions()
void DocumentationView::initialize()
{
mProviders->setModel(mProvidersModel);
connect(mProviders, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &DocumentationView::changedProvider);
connect(mProviders, QOverload<int>::of(&QComboBox::activated), this, &DocumentationView::changedProvider);
connect(mProvidersModel, &ProvidersModel::providersChanged, this, &DocumentationView::emptyHistory);
const bool hasProviders = (mProviders->count() > 0);
......
......@@ -81,8 +81,7 @@ public:
&CodeCompletionModel::foundDeclarations, Qt::QueuedConnection);
connect(m_model, &CodeCompletionModel::completionsNeeded, m_worker,
static_cast<void ( CodeCompletionWorker::* )(const DUChainPointer<KDevelop::DUContext>&, const Cursor&,
View*)>(&CodeCompletionWorker::computeCompletions),
QOverload<const DUChainPointer<KDevelop::DUContext>&, const Cursor&, View*>::of(&CodeCompletionWorker::computeCompletions),
Qt::QueuedConnection);
connect(m_model, &CodeCompletionModel::doSpecialProcessingInBackground, m_worker,
&CodeCompletionWorker::doSpecialProcessing);
......
......@@ -88,7 +88,7 @@ OutputExecuteJob::OutputExecuteJob( QObject* parent, OutputJob::OutputJobVerbosi
{
d->m_process->setOutputChannelMode( KProcess::SeparateChannels );
connect( d->m_process, static_cast<void(KProcess::*)(int,QProcess::ExitStatus)>(&KProcess::finished),
connect( d->m_process, QOverload<int,QProcess::ExitStatus>::of(&QProcess::finished),
this, &OutputExecuteJob::childProcessExited );
connect( d->m_process, &QProcess::errorOccurred,
this, &OutputExecuteJob::childProcessError );
......
......@@ -1213,7 +1213,7 @@ void DocumentController::vcsAnnotateCurrentDocument()
auto* iface = project->versionControlPlugin()->extension<IBasicVersionControl>();
auto helper = new VcsPluginHelper(project->versionControlPlugin(), iface);
connect(doc->textDocument(), &KTextEditor::Document::aboutToClose,
helper, static_cast<void(VcsPluginHelper::*)(KTextEditor::Document*)>(&VcsPluginHelper::disposeEventually));
helper, QOverload<KTextEditor::Document*>::of(&VcsPluginHelper::disposeEventually));
Q_ASSERT(qobject_cast<KTextEditor::AnnotationViewInterface*>(doc->activeTextView()));
// can't use new signal slot syntax here, AnnotationViewInterface is not a QObject
connect(doc->activeTextView(), SIGNAL(annotationBorderVisibilityChanged(View*,bool)),
......
......@@ -187,12 +187,14 @@ LaunchConfigurationDialog::LaunchConfigurationDialog(QWidget* parent)
messageWidget->setText( i18n("No launch configurations available. (Is any of the Execute plugins loaded?)") );
messageWidget->setVisible( m->isEmpty() );
connect(debugger, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &LaunchConfigurationDialog::launchModeChanged);
connect(debugger, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &LaunchConfigurationDialog::launchModeChanged);
connect(buttonBox, &QDialogButtonBox::accepted, this, &LaunchConfigurationDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &LaunchConfigurationDialog::reject);
connect(buttonBox->button(QDialogButtonBox::Ok), &QPushButton::clicked, this, static_cast<void(LaunchConfigurationDialog::*)()>(&LaunchConfigurationDialog::saveConfig) );
connect(buttonBox->button(QDialogButtonBox::Apply), &QPushButton::clicked, this, static_cast<void(LaunchConfigurationDialog::*)()>(&LaunchConfigurationDialog::saveConfig) );
connect(buttonBox->button(QDialogButtonBox::Ok), &QPushButton::clicked,
this, QOverload<>::of(&LaunchConfigurationDialog::saveConfig));
connect(buttonBox->button(QDialogButtonBox::Apply), &QPushButton::clicked,
this, QOverload<>::of(&LaunchConfigurationDialog::saveConfig));
mainLayout->addWidget(buttonBox);
resize( QSize(qMax(1200, sizeHint().width()), qMax(500, sizeHint().height())) );
......
......@@ -50,7 +50,8 @@ OpenProjectPage::OpenProjectPage( const QUrl& startUrl, const QStringList& filte
// Emitted when clicking on a file in the fileview area
connect( fileWidget, &KFileWidget::fileHighlighted, this, &OpenProjectPage::highlightFile );
connect( fileWidget->dirOperator()->dirLister(), static_cast<void(KDirLister::*)(const QUrl&)>(&KDirLister::completed), this, &OpenProjectPage::dirChanged);
connect(fileWidget->dirOperator()->dirLister(), QOverload<const QUrl&>::of(&KDirLister::completed),
this, &OpenProjectPage::dirChanged);
connect( fileWidget, &KFileWidget::accepted, this, &OpenProjectPage::accepted);
}
......
......@@ -23,7 +23,7 @@ ProjectInfoPage::ProjectInfoPage( QWidget* parent )
page_ui->setupUi( this );
connect( page_ui->nameEdit, &QLineEdit::textEdited,
this, &ProjectInfoPage::projectNameChanged );
connect( page_ui->managerCombo, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated),
connect( page_ui->managerCombo, QOverload<int>::of(&QComboBox::activated),
this, &ProjectInfoPage::changeProjectManager );
}
......
......@@ -86,7 +86,8 @@ ProjectSourcePage::ProjectSourcePage(const QUrl& initial, const QUrl& repoUrl, I
// during setup and due to a bug will ignore any but the first call
// Only fixed for KF5 5.32
connect(m_ui->workingDir, &KUrlRequester::textChanged, this, &ProjectSourcePage::reevaluateCorrection);
connect(m_ui->sources, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &ProjectSourcePage::setSourceIndex);
connect(m_ui->sources, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &ProjectSourcePage::setSourceIndex);
connect(m_ui->get, &QPushButton::clicked, this, &ProjectSourcePage::checkoutVcsProject);
}
......
......@@ -108,7 +108,7 @@ EnvironmentWidget::EnvironmentWidget( QWidget *parent )
connect(ui.addProfileButton, &QPushButton::clicked, this, &EnvironmentWidget::addProfile);
connect(ui.removeProfileButton, &QPushButton::clicked, this, &EnvironmentWidget::removeSelectedProfile);
connect(ui.setAsDefaultProfileButton, &QPushButton::clicked, this, &EnvironmentWidget::setSelectedProfileAsDefault);
connect(ui.profileSelect, static_cast<void(KComboBox::*)(int)>(&KComboBox::currentIndexChanged),
connect(ui.profileSelect, QOverload<int>::of(&KComboBox::currentIndexChanged),
this, &EnvironmentWidget::onSelectedProfileChanged);
connect(m_environmentProfileListModel, &EnvironmentProfileListModel::defaultProfileChanged,
......
......@@ -146,7 +146,8 @@ SourceFormatterController::SourceFormatterController(QObject *parent)
d->formatFilesAction->setToolTip(i18n("Format file(s) using the current theme"));
d->formatFilesAction->setWhatsThis(i18n("Formatting functionality using <b>astyle</b> library."));
d->formatFilesAction->setEnabled(false);
connect(d->formatFilesAction, &QAction::triggered, this, static_cast<void(SourceFormatterController::*)()>(&SourceFormatterController::formatFiles));
connect(d->formatFilesAction, &QAction::triggered,
this, QOverload<>::of(&SourceFormatterController::formatFiles));
connect(Core::self()->pluginController(), &IPluginController::pluginLoaded,
......
......@@ -85,9 +85,9 @@ SourceFormatterSelectionEdit::SourceFormatterSelectionEdit(QWidget* parent)
{
d->ui.setupUi(this);
connect(d->ui.cbLanguages, static_cast<void(KComboBox::*)(int)>(&KComboBox::currentIndexChanged),
connect(d->ui.cbLanguages, QOverload<int>::of(&KComboBox::currentIndexChanged),
this, &SourceFormatterSelectionEdit::selectLanguage);
connect(d->ui.cbFormatters, static_cast<void(KComboBox::*)(int)>(&KComboBox::currentIndexChanged),
connect(d->ui.cbFormatters, QOverload<int>::of(&KComboBox::currentIndexChanged),
this, &SourceFormatterSelectionEdit::selectFormatter);
connect(d->ui.styleList, &QListWidget::currentRowChanged, this, &SourceFormatterSelectionEdit::selectStyle);
connect(d->ui.btnDelStyle, &QPushButton::clicked, this, &SourceFormatterSelectionEdit::deleteStyle);
......
......@@ -282,7 +282,8 @@ QWidget *TextDocument::createViewWidget(QWidget *parent)
// Connect to the first text changed signal, it occurs before the completed() signal
connect(d->document.data(), &KTextEditor::Document::textChanged, this, &TextDocument::slotDocumentLoaded);
// Also connect to the completed signal, sometimes the first text changed signal is missed because the part loads too quickly (? TODO - confirm this is necessary)
connect(d->document.data(), static_cast<void(KTextEditor::Document::*)()>(&KTextEditor::Document::completed), this, &TextDocument::slotDocumentLoaded);
connect(d->document.data(), QOverload<>::of(&KTextEditor::Document::completed),
this, &TextDocument::slotDocumentLoaded);
// force a reparse when a document gets reloaded
connect(d->document.data(), &KTextEditor::Document::reloaded,
......
......@@ -712,7 +712,7 @@ Sublime::View* UiController::addToolViewToArea(IToolViewFactory* factory,
p == Sublime::AllPositions ? Sublime::dockAreaToPosition(factory->defaultPosition()) : p);
connect(view, &Sublime::View::raise,
this, static_cast<void(UiController::*)(Sublime::View*)>(&UiController::raiseToolView));
this, QOverload<Sublime::View*>::of(&UiController::raiseToolView));
factory->viewCreated(view);
return view;
......
......@@ -187,7 +187,7 @@ void WorkingSetController::showGlobalToolTip()
connect(m_hideToolTipTimer, &QTimer::timeout, m_tooltip.data(), &ActiveToolTip::deleteLater);
m_hideToolTipTimer->start();
connect(m_tooltip.data(), &ActiveToolTip::mouseIn, m_hideToolTipTimer, &QTimer::stop);
connect(m_tooltip.data(), &ActiveToolTip::mouseOut, m_hideToolTipTimer, static_cast<void(QTimer::*)()>(&QTimer::start));
connect(m_tooltip.data(), &ActiveToolTip::mouseOut, m_hideToolTipTimer, QOverload<>::of(&QTimer::start));
}
WorkingSetToolTipWidget* WorkingSetController::workingSetToolTip()
......
......@@ -353,7 +353,7 @@ Container::Container(QWidget *parent)
l->addWidget(d->stack);
connect(d->tabBar, &ContainerTabBar::currentChanged, this, &Container::widgetActivated);
connect(d->tabBar, &ContainerTabBar::tabCloseRequested, this, static_cast<void(Container::*)(int)>(&Container::requestClose));
connect(d->tabBar, &ContainerTabBar::tabCloseRequested, this, QOverload<int>::of(&Container::requestClose));
connect(d->tabBar, &ContainerTabBar::newTabRequested, this, &Container::newTabRequested);
connect(d->tabBar, &ContainerTabBar::tabMoved, this, &Container::tabMoved);
connect(d->tabBar, &ContainerTabBar::customContextMenuRequested, this, &Container::contextMenu);
......
......@@ -180,7 +180,7 @@ void IdealButtonBarWidget::addAction(QAction* qaction)
Q_ASSERT(action->dockWidget());
connect(action, &QAction::toggled, this, static_cast<void(IdealButtonBarWidget::*)(bool)>(&IdealButtonBarWidget::showWidget));
connect(action, &QAction::toggled, this, QOverload<bool>::of(&IdealButtonBarWidget::showWidget));
connect(button, &IdealToolButton::customContextMenuRequested,
action->dockWidget(), &IdealDockWidget::contextMenuRequested);
......
......@@ -43,7 +43,7 @@ namespace Sublime {
MainWindow::MainWindow(Controller *controller, Qt::WindowFlags flags)
: KParts::MainWindow(nullptr, flags), d(new MainWindowPrivate(this, controller))
{
connect(this, &MainWindow::destroyed, controller, static_cast<void(Controller::*)()>(&Controller::areaReleased));
connect(this, &MainWindow::destroyed, controller, QOverload<>::of(&Controller::areaReleased));
loadGeometry(KSharedConfig::openConfig()->group("Main Window"));
......
......@@ -381,7 +381,7 @@ Area::WalkerMode MainWindowPrivate::ViewCreator::operator() (AreaIndex *index)
d->m_mainWindow, &MainWindow::tabContextMenuRequested);
connect(container, &Container::tabToolTipRequested,
d->m_mainWindow, &MainWindow::tabToolTipRequested);
connect(container, static_cast<void(Container::*)(QWidget*)>(&Container::requestClose),
connect(container, QOverload<QWidget*>::of(&Container::requestClose),
d, &MainWindowPrivate::widgetCloseRequest, Qt::QueuedConnection);
connect(container, &Container::newTabRequested,
d->m_mainWindow, &MainWindow::newTabRequested);
......
......@@ -76,7 +76,7 @@ CommandExecutor::CommandExecutor(const QString& command, QObject* parent)
this, [&](QProcess::ProcessError error) {
d->procError(error);
});
connect(d->m_process, static_cast<void (KProcess::*)(int, QProcess::ExitStatus)>(&KProcess::finished),
connect(d->m_process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
this, [&](int code, QProcess::ExitStatus status) {
d->procFinished(code, status);
});
......
......@@ -41,8 +41,8 @@ FocusedTreeView::FocusedTreeView(QWidget* parent)
d->timer.setSingleShot(true);
connect(&d->timer, &QTimer::timeout, this, &FocusedTreeView::delayedAutoScrollAndResize);
connect(verticalScrollBar(), &QScrollBar::valueChanged, &d->timer,
static_cast<void ( QTimer::* )()>(&QTimer::start));
connect(verticalScrollBar(), &QScrollBar::valueChanged,
&d->timer, QOverload<>::of(&QTimer::start));
}
FocusedTreeView::~FocusedTreeView()
......
......@@ -75,7 +75,7 @@ DVcsJob::DVcsJob(const QDir& workingDir, IPlugin* parent, OutputJob::OutputJobVe
setModel(d->model);
setCapabilities(Killable);
connect(d->childproc, static_cast<void(KProcess::*)(int,QProcess::ExitStatus)>(&KProcess::finished),
connect(d->childproc, QOverload<int,QProcess::ExitStatus>::of(&QProcess::finished),
this, &DVcsJob::slotProcessExited);
connect(d->childproc, &QProcess::errorOccurred,
this, &DVcsJob::slotProcessError);
......
......@@ -104,7 +104,7 @@ public:
QObject::connect(revertAction, &QAction::triggered, parent, &VcsPluginHelper::revert);
QObject::connect(historyAction, &QAction::triggered, parent, [=] { parent->history(); });
QObject::connect(annotationAction, &QAction::triggered, parent, &VcsPluginHelper::annotation);
QObject::connect(diffForRevAction, &QAction::triggered, parent, static_cast<void(VcsPluginHelper::*)()>(&VcsPluginHelper::diffForRev));
QObject::connect(diffForRevAction, &QAction::triggered, parent, QOverload<>::of(&VcsPluginHelper::diffForRev));
QObject::connect(diffForRevGlobalAction, &QAction::triggered, parent, &VcsPluginHelper::diffForRevGlobal);
QObject::connect(pullAction, &QAction::triggered, parent, &VcsPluginHelper::pull);
QObject::connect(pushAction, &QAction::triggered, parent, &VcsPluginHelper::push);
......
......@@ -67,7 +67,8 @@ VCSCommitDiffPatchSource::VCSCommitDiffPatchSource(VCSDiffUpdater* updater)
m_oldMessages->addItem(message, message);
m_oldMessages->setMaximumWidth(200);
connect(m_oldMessages, static_cast<void(KComboBox::*)(const QString&)>(&KComboBox::currentIndexChanged), this, &VCSCommitDiffPatchSource::oldMessageChanged);
connect(m_oldMessages, QOverload<const QString&>::of(&KComboBox::currentIndexChanged),
this, &VCSCommitDiffPatchSource::oldMessageChanged);
titleLayout->addWidget(m_oldMessages);
......
......@@ -62,7 +62,7 @@ ProjectSelectionPage::ProjectSelectionPage(ProjectTemplatesModel *templatesModel
connect (ui->listView, &MultiLevelListView::currentIndexChanged, this, &ProjectSelectionPage::typeChanged);
typeChanged(ui->listView->currentIndex());
connect( ui->templateType, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
connect( ui->templateType, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &ProjectSelectionPage::templateChanged );
QPushButton* getMoreButton = new QPushButton(i18n("Get More Templates"), ui->listView);
......
......@@ -66,9 +66,9 @@ ProjectVcsPage::ProjectVcsPage( KDevelop::IPluginController* controller, QWidget
}
}
}
connect( m_ui->vcsTypes, static_cast<void(KComboBox::*)(int)>(&KComboBox::activated),
connect( m_ui->vcsTypes, QOverload<int>::of(&KComboBox::activated),
m_ui->vcsImportOptions, &QStackedWidget::setCurrentIndex );
connect( m_ui->vcsTypes, static_cast<void(KComboBox::*)(int)>(&KComboBox::activated),
connect( m_ui->vcsTypes, QOverload<int>::of(&KComboBox::activated),
this, &ProjectVcsPage::vcsTypeChanged );
vcsTypeChanged(m_ui->vcsTypes->currentIndex());
}
......
......@@ -96,32 +96,32 @@ void AStylePreferences::init()
connect(tabWidget, &QTabWidget::currentChanged, this, &AStylePreferences::currentTabChanged);
connect(cbIndentType, static_cast<void(KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &AStylePreferences::indentChanged);
connect(inpNuberSpaces, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &AStylePreferences::indentChanged);
connect(cbIndentType, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &AStylePreferences::indentChanged);
connect(inpNuberSpaces, QOverload<int>::of(&QSpinBox::valueChanged), this, &AStylePreferences::indentChanged);
connect(chkConvertTabs, &QCheckBox::stateChanged, this, &AStylePreferences::indentChanged);
connect(chkFillEmptyLines, &QCheckBox::stateChanged, this, &AStylePreferences::indentChanged);
connect(listIdentObjects, &QListWidget::itemChanged,
this, &AStylePreferences::indentObjectsChanged);
connect(inpMaxStatement, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &AStylePreferences::minMaxValuesChanged);
connect(inpMinConditional, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &AStylePreferences::minMaxValuesChanged);
connect(inpMaxStatement, QOverload<int>::of(&QSpinBox::valueChanged), this, &AStylePreferences::minMaxValuesChanged);
connect(inpMinConditional, QOverload<int>::of(&QSpinBox::valueChanged), this, &AStylePreferences::minMaxValuesChanged);
connect(cbBrackets, static_cast<void(KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &AStylePreferences::bracketsChanged);
connect(cbBrackets, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &AStylePreferences::bracketsChanged);
connect(chkBracketsCloseHeaders, &QCheckBox::stateChanged, this, &AStylePreferences::bracketsChanged);
connect(chkBlockBreak, &QCheckBox::stateChanged, this, &AStylePreferences::blocksChanged);
connect(chkBlockBreakAll, &QCheckBox::stateChanged, this, &AStylePreferences::blocksChanged);
connect(chkBlockIfElse, &QCheckBox::stateChanged, this, &AStylePreferences::blocksChanged);
connect(cbParenthesisPadding, static_cast<void(KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &AStylePreferences::paddingChanged);
connect(cbParenthesisPadding, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &AStylePreferences::paddingChanged);
connect(chkPadParenthesisHeader, &QCheckBox::stateChanged, this, &AStylePreferences::paddingChanged);
connect(chkPadOperators, &QCheckBox::stateChanged, this, &AStylePreferences::paddingChanged);
connect(chkKeepStatements, &QCheckBox::stateChanged, this, &AStylePreferences::onelinersChanged);
connect(chkKeepBlocks, &QCheckBox::stateChanged, this, &AStylePreferences::onelinersChanged);
connect(cbPointerAlign, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
connect(cbPointerAlign, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &AStylePreferences::pointerAlignChanged);
}
......
......@@ -42,7 +42,7 @@ CheckListFilterProxySearchLine::CheckListFilterProxySearchLine(QWidget *parent)
connect(m_delayTimer, &QTimer::timeout,
this, &CheckListFilterProxySearchLine::updateFilter);
connect(this, &CheckListFilterProxySearchLine::textChanged,
m_delayTimer, static_cast<void(QTimer::*)()>(&QTimer::start));
m_delayTimer, QOverload<>::of(&QTimer::start));
}
......
......@@ -64,9 +64,11 @@ CMakeBuildDirChooser::CMakeBuildDirChooser(QWidget* parent)
m_extraArgumentsHistory = new CMakeExtraArgumentsHistory(m_chooserUi->extraArguments);
connect(m_chooserUi->buildFolder, &KUrlRequester::textChanged, this, &CMakeBuildDirChooser::updated);
connect(m_chooserUi->buildType, static_cast<void(QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged), this, &CMakeBuildDirChooser::updated);
connect(m_chooserUi->buildType, QOverload<const QString&>::of(&QComboBox::currentIndexChanged),
this, &CMakeBuildDirChooser::updated);
connect(m_chooserUi->extraArguments, &KComboBox::editTextChanged, this, &CMakeBuildDirChooser::updated);
connect(m_chooserUi->availableBuildDirs, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &CMakeBuildDirChooser::adoptPreviousBuildDirectory);
connect(m_chooserUi->availableBuildDirs, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &CMakeBuildDirChooser::adoptPreviousBuildDirectory);
updated();
}
......
......@@ -49,7 +49,7 @@ CMakeCommandsContents::CMakeCommandsContents(QObject* parent)
process->setArguments(params);
KDevelop::ICore::self()->runtimeController()->currentRuntime()->startProcess(process);
connect(process, static_cast<void(QProcess::*)(int)>(&QProcess::finished), this, &CMakeCommandsContents::processOutput);
connect(process, QOverload<int>::of(&QProcess::finished), this, &CMakeCommandsContents::processOutput);
}
}
......
......@@ -39,8 +39,8 @@ CMakeExtraArgumentsHistory::CMakeExtraArgumentsHistory(KComboBox* widget)
m_arguments->addItems(lastExtraArguments);
m_arguments->setInsertPolicy(QComboBox::InsertAtTop);
KCompletion *comp = m_arguments->completionObject();
KComboBox::connect(m_arguments, static_cast<void(KComboBox::*)(const QString&)>(&KComboBox::returnPressed),
comp, static_cast<void(KCompletion::*)(const QString&)>(&KCompletion::addItem));
QObject::connect(m_arguments, QOverload<const QString&>::of(&KComboBox::returnPressed),
comp, QOverload<const QString&>::of(&KCompletion::addItem));
comp->insertItems(lastExtraArguments);
} else {
qFatal("CMakeExtraArgumentsHistory initialised with invalid widget");
......
......@@ -61,13 +61,13 @@ CMakeServer::CMakeServer(QObject* parent)
this, [this, path](QProcess::ProcessError error) {
qCWarning(CMAKE) << "cmake server error:" << error << path << m_process.readAllStandardError() << m_process.readAllStandardOutput();
});
connect(&m_process, static_cast<void(QProcess::*)(int)>(&QProcess::finished), this, [](int code){
connect(&m_process, QOverload<int>::of(&QProcess::finished), this, [](int code){
qCDebug(CMAKE) << "cmake server finished with code" << code;
});
connect(&m_process, static_cast<void(QProcess::*)(int)>(&QProcess::finished), this, &CMakeServer::finished);
connect(&m_process, QOverload<int>::of(&QProcess::finished), this, &CMakeServer::finished);
connect(m_localSocket, &QIODevice::readyRead, this, &CMakeServer::processOutput);
connect(m_localSocket, static_cast<void(QLocalSocket::*)(QLocalSocket::LocalSocketError)>(&QLocalSocket::error), this, [this, path](QLocalSocket::LocalSocketError socketError) {
connect(m_localSocket, QOverload<QLocalSocket::LocalSocketError>::of(&QLocalSocket::error), this, [this, path](QLocalSocket::LocalSocketError socketError) {
qCWarning(CMAKE) << "cmake server socket error:" << socketError << path;
setConnected(false);
});
......
......@@ -63,7 +63,7 @@ CMakePreferences::CMakePreferences(IPlugin* plugin, const ProjectConfigOptions&
m_prefsUi->extraArguments->setMinimumWidth(static_cast<QComboBox*>(m_prefsUi->extraArguments)->minimumSizeHint().width());
m_extraArgumentsHistory = new CMakeExtraArgumentsHistory(m_prefsUi->extraArguments);
connect(m_prefsUi->buildDirs, static_cast<void(KComboBox::*)(int)>(&KComboBox::currentIndexChanged),
connect(m_prefsUi->buildDirs, QOverload<int>::of(&KComboBox::currentIndexChanged),
this, &CMakePreferences::buildDirChanged);
connect(m_prefsUi->showInternal, &QCheckBox::stateChanged,
this, &CMakePreferences::showInternal);
......@@ -77,7 +77,7 @@ CMakePreferences::CMakePreferences(IPlugin* plugin, const ProjectConfigOptions&
connect(m_prefsUi->installationPrefix, &KUrlRequester::textChanged,
this, &CMakePreferences::changed);
connect(m_prefsUi->buildType, static_cast<void(QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged),
connect(m_prefsUi->buildType, QOverload<const QString&>::of(&QComboBox::currentIndexChanged),
this, &CMakePreferences::changed);
connect(m_prefsUi->buildType, &QComboBox::currentTextChanged,
this, &CMakePreferences::changed);
......
......@@ -41,15 +41,15 @@ ConfigWidget::ConfigWidget( QWidget* parent )
ui->buildAction->insertItem( CustomBuildSystemTool::Clean, i18n("Clean"), QVariant() );
ui->buildAction->insertItem( CustomBuildSystemTool::Prune, i18n("Prune"), QVariant() );
connect( ui->buildAction, static_cast<void(KComboBox::*)(int)>(&KComboBox::activated), this, &ConfigWidget::changeAction );
connect( ui->buildAction, QOverload<int>::of(&KComboBox::activated), this, &ConfigWidget::changeAction );
connect( ui->enableAction, &QCheckBox::toggled, this, &ConfigWidget::toggleActionEnablement );
connect( ui->actionArguments, &QLineEdit::textEdited, this, &ConfigWidget::actionArgumentsEdited );
connect( ui->actionEnvironment, &EnvironmentSelectionWidget::currentProfileChanged, this, &ConfigWidget::actionEnvironmentChanged );
connect( ui->buildDir, &KUrlRequester::urlSelected, this, static_cast<void(ConfigWidget::*)()>(&ConfigWidget::changed) );
connect( ui->buildDir->lineEdit(), &KLineEdit::textEdited, this, static_cast<void(ConfigWidget::*)()>(&ConfigWidget::changed) );
connect( ui->actionExecutable, &KUrlRequester::urlSelected, this, static_cast<void(ConfigWidget::*)(const QUrl&)>(&ConfigWidget::actionExecutableChanged) );
connect( ui->actionExecutable->lineEdit(), &KLineEdit::textEdited, this, static_cast<void(ConfigWidget::*)(const QString&)>(&ConfigWidget::actionExecutableChanged) );
connect( ui->buildDir, &KUrlRequester::urlSelected, this, QOverload<>::of(&ConfigWidget::changed) );
connect( ui->buildDir->lineEdit(), &KLineEdit::textEdited, this, QOverload<>::of(&ConfigWidget::changed) );
connect( ui->actionExecutable, &KUrlRequester::urlSelected, this, QOverload<const QUrl&>::of(&ConfigWidget::actionExecutableChanged) );
connect( ui->actionExecutable->lineEdit(), &KLineEdit::textEdited, this, QOverload<const QString&>::of(&ConfigWidget::actionExecutableChanged) );
}
CustomBuildSystemConfig ConfigWidget::config() const
......
......@@ -58,7 +58,7 @@ CustomBuildSystemConfigWidget::CustomBuildSystemConfigWidget( QWidget* parent )
ui->addConfig->setFixedHeight( ui->currentConfig->sizeHint().height() );
ui->removeConfig->setFixedHeight( ui->currentConfig->sizeHint().height() );
connect( ui->currentConfig, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated), this, &CustomBuildSystemConfigWidget::changeCurrentConfig);
connect( ui->currentConfig, QOverload<int>::of(&QComboBox::activated), this, &CustomBuildSystemConfigWidget::changeCurrentConfig);
connect( ui->configWidget, &ConfigWidget::changed, this, &CustomBuildSystemConfigWidget::configChanged );
connect( ui->addConfig, &QPushButton::clicked, this, &CustomBuildSystemConfigWidget::addConfig);
......
......@@ -34,9 +34,9 @@ DefinesWidget::DefinesWidget( QWidget* parent )
ui->setupUi( this );
ui->defines->setModel( definesModel );
ui->defines->horizontalHeader()->setSectionResizeMode( QHeaderView::Stretch );
connect( definesModel, &DefinesModel::dataChanged, this, static_cast<void(DefinesWidget::*)()>(&DefinesWidget::definesChanged) );
connect( definesModel, &DefinesModel::rowsInserted, this, static_cast<void(DefinesWidget::*)()>(&DefinesWidget::definesChanged) );
connect( definesModel, &DefinesModel::rowsRemoved, this, static_cast<void(DefinesWidget::*)()>(&DefinesWidget::definesChanged) );
connect(definesModel, &DefinesModel::dataChanged, this, QOverload<>::of(&DefinesWidget::definesChanged));
connect(definesModel, &DefinesModel::rowsInserted, this, QOverload<>::of(&DefinesWidget::definesChanged));
connect(definesModel, &DefinesModel::rowsRemoved, this, QOverload<>::of(&DefinesWidget::definesChanged));
QAction* delDefAction = new QAction( i18n("Delete Define"), this );
delDefAction->setShortcut( QKeySequence(Qt::Key_Delete) );
......
......@@ -54,9 +54,9 @@ IncludesWidget::IncludesWidget( QWidget* parent )
connect( ui->includePaths->selectionModel(), &QItemSelectionModel::currentChanged, this, &IncludesWidget::includePathSelected );
connect( ui->includePathRequester, &KUrlRequester::textChanged, this, &IncludesWidget::includePathEdited );
connect( ui->includePathRequester, &KUrlRequester::urlSelected, this, &IncludesWidget::includePathUrlSelected );
connect( includesModel, &IncludesModel::dataChanged, this, static_cast<void(IncludesWidget::*)()>(&IncludesWidget::includesChanged) );
connect( includesModel, &IncludesModel::rowsInserted, this, static_cast<void(IncludesWidget::*)()>(&IncludesWidget::includesChanged) );
connect( includesModel, &IncludesModel::rowsRemoved, this, static_cast<void(IncludesWidget::*)()>(&IncludesWidget::includesChanged) );
connect(includesModel, &IncludesModel::dataChanged, this, QOverload<>::of(&IncludesWidget::includesChanged));
connect(includesModel, &IncludesModel::rowsInserted, this, QOverload<>::of(&IncludesWidget::includesChanged));
connect(includesModel, &IncludesModel::rowsRemoved, this, QOverload<>::of(&IncludesWidget::includesChanged));
QAction* delIncAction = new QAction( i18n("Delete Include Path"), this );
delIncAction->setShortcut( QKeySequence( Qt::Key_Delete ) );
......
......@@ -95,13 +95,13 @@ ParserWidget::ParserWidget(QWidget* parent)
connect(m_ui->parserOptionsOpenCl, &QLineEdit::textEdited, this, &ParserWidget::textEdited);
connect(m_ui->parserOptionsCuda, &QLineEdit::textEdited, this, &ParserWidget::textEdited);
connect(m_ui->parseHeadersInPlainC, &QCheckBox::stateChanged, this, &ParserWidget::textEdited);
connect(m_ui->languageStandardsC, static_cast<void(QComboBox::*)(const QString&)>(&QComboBox::activated),
connect(m_ui->languageStandardsC, QOverload<const QString&>::of(&QComboBox::activated),
this, &ParserWidget::languageStandardChangedC);
connect(m_ui->languageStandardsCpp, static_cast<void(QComboBox::*)(const QString&)>(&QComboBox::activated),
connect(m_ui->languageStandardsCpp, QOverload<const QString&>::of(&QComboBox::activated),
this, &ParserWidget::languageStandardChangedCpp);
connect(m_ui->languageStandardsOpenCl, static_cast<void(QComboBox::*)(const QString&)>(&QComboBox::activated),
connect(m_ui->languageStandardsOpenCl, QOverload<const QString&>::of(&QComboBox::activated),
this, &ParserWidget::languageStandardChangedOpenCl);
connect(m_ui->languageStandardsCuda, static_cast<void(QComboBox::*)(const QString&)>(&QComboBox::activated),
connect(m_ui->languageStandardsCuda, QOverload<const QString&>::of(&QComboBox::activated),
this, &ParserWidget::languageStandardChangedCuda);
updateEnablements();
......
......@@ -64,15 +64,15 @@ ProjectPathsWidget::ProjectPathsWidget( QWidget* parent )
connect( ui->batchEdit, &QPushButton::clicked, this, &ProjectPathsWidget::batchEdit );
ui->projectPaths->setModel( pathsModel );
connect( ui->projectPaths, static_cast<void(KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &ProjectPathsWidget::projectPathSelected );
connect( ui->projectPaths, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &ProjectPathsWidget::projectPathSelected );
connect( pathsModel, &ProjectPathsModel::dataChanged, this, &ProjectPathsWidget::changed );
connect( pathsModel, &ProjectPathsModel::rowsInserted, this, &ProjectPathsWidget::changed );
connect( pathsModel, &ProjectPathsModel::rowsRemoved, this, &ProjectPathsWidget::changed );
connect( ui->compiler, static_cast<void(QComboBox::*)(const QString&)>(&QComboBox::activated), this, &ProjectPathsWidget::changed );
connect( ui->compiler, static_cast<void(QComboBox::*)(const QString&)>(&QComboBox::activated), this, &ProjectPathsWidget::changeCompilerForPath );
connect( ui->compiler, QOverload<const QString&>::of(&QComboBox::activated), this, &ProjectPathsWidget::changed );
connect( ui->compiler, QOverload<const QString&>::of(&QComboBox::activated), this, &ProjectPathsWidget::changeCompilerForPath );
connect( ui->includesWidget, static_cast<void(IncludesWidget::*)(const QStringList&)>(&IncludesWidget::includesChanged), this, &ProjectPathsWidget::includesChanged );
connect( ui->definesWidget, static_cast<void(DefinesWidget::*)(const KDevelop::Defines&)>(&DefinesWidget::definesChanged), this, &ProjectPathsWidget::definesChanged );
connect( ui->includesWidget, QOverload<const QStringList&>::of(&IncludesWidget::includesChanged), this, &ProjectPathsWidget::includesChanged );
connect( ui->definesWidget, QOverload<const KDevelop::Defines&>::of(&DefinesWidget::definesChanged), this, &ProjectPathsWidget::definesChanged );
connect(ui->languageParameters, &QTabWidget::currentChanged, this, &ProjectPathsWidget::tabChanged);
......
......@@ -523,7 +523,7 @@ CustomScriptPreferences::CustomScriptPreferences()
"If you add <b>$TMPFILE</b> into the command, then <br />"
"a temporary file is used for transferring the code."));
connect(m_commandEdit, &QLineEdit::textEdited,
m_updateTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
m_updateTimer, QOverload<>::of(&QTimer::start));
m_vLayout->addSpacing(10);
......
......@@ -57,8 +57,7 @@ MIDebugger::MIDebugger(QObject* parent)
this, &MIDebugger::readyReadStandardOutput);
connect(m_process, &KProcess::readyReadStandardError,
this, &MIDebugger::readyReadStandardError);
connect(m_process,
static_cast<void(KProcess::*)(int,QProcess::ExitStatus)>(&KProcess::finished),
connect(m_process, QOverload<int,QProcess::ExitStatus>::of(&QProcess::finished),
this, &MIDebugger::processFinished);
connect(m_process, &QProcess::errorOccurred,
this, &MIDebugger::processErrored);
......
......@@ -145,8 +145,7 @@ void DebuggerConsoleView::setupUi()
m_cmdEditor = new KHistoryComboBox(this);
m_cmdEditor->setDuplicatesEnabled(false);
connect(m_cmdEditor,
static_cast<void(KHistoryComboBox::*)(const QString&)>(&KHistoryComboBox::returnPressed),
connect(m_cmdEditor, QOverload<const QString&>::of(&KHistoryComboBox::returnPressed),
this, &DebuggerConsoleView::trySendCommand);
auto label = new QLabel(i18n("&Command:"), this);
......