Commit dc79f681 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment