forked from qt-creator/qt-creator
Drop Qt5: Core: Get rid of QOverload
Change-Id: Ibaebd83304680156e13a9ebc473075ad2a4bfed4 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -496,9 +496,9 @@ ExternalToolConfig::ExternalToolConfig()
|
||||
this, &ExternalToolConfig::updateCurrentItem);
|
||||
connect(m_ui.environmentButton, &QAbstractButton::clicked,
|
||||
this, &ExternalToolConfig::editEnvironmentChanges);
|
||||
connect(m_ui.outputBehavior, QOverload<int>::of(&QComboBox::activated),
|
||||
connect(m_ui.outputBehavior, &QComboBox::activated,
|
||||
this, &ExternalToolConfig::updateCurrentItem);
|
||||
connect(m_ui.errorOutputBehavior, QOverload<int>::of(&QComboBox::activated),
|
||||
connect(m_ui.errorOutputBehavior, &QComboBox::activated,
|
||||
this, &ExternalToolConfig::updateCurrentItem);
|
||||
connect(m_ui.modifiesDocumentCheckbox, &QAbstractButton::clicked,
|
||||
this, &ExternalToolConfig::updateCurrentItem);
|
||||
|
@@ -221,7 +221,7 @@ NewDialogWidget::NewDialogWidget(QWidget *parent) :
|
||||
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &NewDialogWidget::accept);
|
||||
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &NewDialogWidget::reject);
|
||||
|
||||
connect(m_ui->comboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
connect(m_ui->comboBox, &QComboBox::currentIndexChanged,
|
||||
this, &NewDialogWidget::setSelectedPlatform);
|
||||
}
|
||||
|
||||
|
@@ -466,7 +466,7 @@ void ReadOnlyFilesDialogPrivate::initDialog(const FilePaths &filePaths)
|
||||
|
||||
// Also save the buttongroup for every file to get the result for each entry.
|
||||
buttonGroups.append({filePath, radioButtonGroup});
|
||||
QObject::connect(radioButtonGroup, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked),
|
||||
QObject::connect(radioButtonGroup, &QButtonGroup::buttonClicked,
|
||||
[this] { updateSelectAll(); });
|
||||
}
|
||||
|
||||
@@ -525,8 +525,7 @@ void ReadOnlyFilesDialogPrivate::initDialog(const FilePaths &filePaths)
|
||||
ui.setAll->addItem(saveAsText);
|
||||
setAllIndexForOperation[SaveAs] = ui.setAll->count() - 1;
|
||||
}
|
||||
QObject::connect(ui.setAll, QOverload<int>::of(&QComboBox::activated),
|
||||
[this](int index) { setAll(index); });
|
||||
QObject::connect(ui.setAll, &QComboBox::activated, [this](int index) { setAll(index); });
|
||||
|
||||
// Filter which columns should be visible and resize them to content.
|
||||
for (int i = 0; i < NumberOfColumns; ++i) {
|
||||
|
@@ -76,7 +76,7 @@ EditorWindow::EditorWindow(QWidget *parent) :
|
||||
connect(m_area, &EditorArea::windowTitleNeedsUpdate,
|
||||
this, &EditorWindow::updateWindowTitle);
|
||||
// editor area can be deleted by editor manager
|
||||
connect(m_area, &EditorArea::destroyed, this, [this]() {
|
||||
connect(m_area, &EditorArea::destroyed, this, [this] {
|
||||
m_area = nullptr;
|
||||
deleteLater();
|
||||
});
|
||||
|
@@ -187,15 +187,13 @@ EditorToolBar::EditorToolBar(QWidget *parent) :
|
||||
|
||||
// this signal is disconnected for standalone toolbars and replaced with
|
||||
// a private slot connection
|
||||
connect(d->m_editorList, QOverload<int>::of(&QComboBox::activated),
|
||||
this, &EditorToolBar::listSelectionActivated);
|
||||
|
||||
connect(d->m_editorList, &QComboBox::activated, this, &EditorToolBar::listSelectionActivated);
|
||||
connect(d->m_editorList, &QComboBox::customContextMenuRequested, [this](QPoint p) {
|
||||
QMenu menu;
|
||||
fillListContextMenu(&menu);
|
||||
menu.exec(d->m_editorList->mapToGlobal(p));
|
||||
});
|
||||
connect(d->m_dragHandleMenu, &QMenu::aboutToShow, [this]() {
|
||||
connect(d->m_dragHandleMenu, &QMenu::aboutToShow, this, [this] {
|
||||
d->m_dragHandleMenu->clear();
|
||||
fillListContextMenu(d->m_dragHandleMenu);
|
||||
});
|
||||
@@ -300,9 +298,9 @@ void EditorToolBar::setToolbarCreationFlags(ToolbarCreationFlags flags)
|
||||
this,
|
||||
&EditorToolBar::setCurrentEditor);
|
||||
|
||||
disconnect(d->m_editorList, QOverload<int>::of(&QComboBox::activated),
|
||||
disconnect(d->m_editorList, &QComboBox::activated,
|
||||
this, &EditorToolBar::listSelectionActivated);
|
||||
connect(d->m_editorList, QOverload<int>::of(&QComboBox::activated),
|
||||
connect(d->m_editorList, &QComboBox::activated,
|
||||
this, &EditorToolBar::changeActiveEditor);
|
||||
d->m_splitButton->setVisible(false);
|
||||
d->m_closeSplitButton->setVisible(false);
|
||||
|
@@ -221,7 +221,7 @@ void FancyTabBar::mousePressEvent(QMouseEvent *event)
|
||||
m_currentIndex = index;
|
||||
update();
|
||||
// update tab bar before showing widget
|
||||
QMetaObject::invokeMethod(this, [this]() {
|
||||
QMetaObject::invokeMethod(this, [this] {
|
||||
emit currentChanged(m_currentIndex);
|
||||
}, Qt::QueuedConnection);
|
||||
}
|
||||
|
@@ -167,13 +167,13 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind)
|
||||
cmd = ActionManager::registerAction(m_findInDocumentAction, Constants::FIND_IN_DOCUMENT);
|
||||
cmd->setDefaultKeySequence(QKeySequence::Find);
|
||||
mfind->addAction(cmd, Constants::G_FIND_CURRENTDOCUMENT);
|
||||
connect(m_findInDocumentAction, &QAction::triggered, this, [this]() { openFind(); });
|
||||
connect(m_findInDocumentAction, &QAction::triggered, this, [this] { openFind(); });
|
||||
|
||||
// Pressing the find shortcut while focus is in the tool bar should not change the search text,
|
||||
// so register a different find action for the tool bar
|
||||
auto localFindAction = new QAction(this);
|
||||
ActionManager::registerAction(localFindAction, Constants::FIND_IN_DOCUMENT, findcontext);
|
||||
connect(localFindAction, &QAction::triggered, this, [this]() {
|
||||
connect(localFindAction, &QAction::triggered, this, [this] {
|
||||
openFindToolBar(FindToolBar::OpenFlags(UpdateAll & ~UpdateFindText));
|
||||
});
|
||||
|
||||
|
@@ -77,7 +77,7 @@ FindToolWindow::FindToolWindow(QWidget *parent)
|
||||
connect(m_ui.matchCase, &QAbstractButton::toggled, Find::instance(), &Find::setCaseSensitive);
|
||||
connect(m_ui.wholeWords, &QAbstractButton::toggled, Find::instance(), &Find::setWholeWord);
|
||||
connect(m_ui.regExp, &QAbstractButton::toggled, Find::instance(), &Find::setRegularExpression);
|
||||
connect(m_ui.filterList, QOverload<int>::of(&QComboBox::activated),
|
||||
connect(m_ui.filterList, &QComboBox::activated,
|
||||
this, QOverload<int>::of(&FindToolWindow::setCurrentFilter));
|
||||
|
||||
m_findCompleter->setModel(Find::findCompletionModel());
|
||||
|
@@ -284,8 +284,8 @@ void SearchResultWidget::addResults(const QList<SearchResultItem> &items, Search
|
||||
InfoBarEntry info(sizeWarningId,
|
||||
tr("The search resulted in more than %n items, do you still want to continue?",
|
||||
nullptr, SEARCHRESULT_WARNING_LIMIT));
|
||||
info.setCancelButtonInfo(tr("Cancel"), [this]() { cancelAfterSizeWarning(); });
|
||||
info.addCustomButton(tr("Continue"), [this]() { continueAfterSizeWarning(); });
|
||||
info.setCancelButtonInfo(tr("Cancel"), [this] { cancelAfterSizeWarning(); });
|
||||
info.addCustomButton(tr("Continue"), [this] { continueAfterSizeWarning(); });
|
||||
m_infoBar.addInfo(info);
|
||||
emit requestPopup(false/*no focus*/);
|
||||
}
|
||||
|
@@ -650,10 +650,8 @@ QList<QWidget *> SearchResultWindowPrivate::toolBarWidgets()
|
||||
m_recentSearchesBox->setProperty("drawleftborder", true);
|
||||
m_recentSearchesBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
||||
m_recentSearchesBox->addItem(tr("New Search"));
|
||||
connect(m_recentSearchesBox,
|
||||
QOverload<int>::of(&QComboBox::activated),
|
||||
this,
|
||||
&SearchResultWindowPrivate::setCurrentIndexWithFocus);
|
||||
connect(m_recentSearchesBox, &QComboBox::activated,
|
||||
this, &SearchResultWindowPrivate::setCurrentIndexWithFocus);
|
||||
}
|
||||
return {m_expandCollapseButton,
|
||||
m_filterButton,
|
||||
|
@@ -388,11 +388,8 @@ FolderNavigationWidget::FolderNavigationWidget(QWidget *parent) : QWidget(parent
|
||||
this,
|
||||
&FolderNavigationWidget::toggleAutoSynchronization);
|
||||
connect(m_toggleRootSync, &QAbstractButton::clicked,
|
||||
this, [this]() { setRootAutoSynchronization(!m_rootAutoSync); });
|
||||
connect(m_rootSelector,
|
||||
QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
this,
|
||||
[this](int index) {
|
||||
this, [this] { setRootAutoSynchronization(!m_rootAutoSync); });
|
||||
connect(m_rootSelector, &QComboBox::currentIndexChanged, this, [this](int index) {
|
||||
const auto directory = m_rootSelector->itemData(index).value<Utils::FilePath>();
|
||||
m_rootSelector->setToolTip(directory.toUserOutput());
|
||||
setRootDirectory(directory);
|
||||
|
@@ -109,7 +109,7 @@ Locator::Locator()
|
||||
{
|
||||
m_instance = this;
|
||||
m_refreshTimer.setSingleShot(false);
|
||||
connect(&m_refreshTimer, &QTimer::timeout, this, [this]() { refresh(filters()); });
|
||||
connect(&m_refreshTimer, &QTimer::timeout, this, [this] { refresh(filters()); });
|
||||
}
|
||||
|
||||
Locator::~Locator()
|
||||
|
@@ -207,7 +207,7 @@ public:
|
||||
connect(m_ui.filterList, &Utils::TreeView::activated,
|
||||
this, &LocatorSettingsWidget::configureFilter);
|
||||
connect(m_ui.editButton, &QPushButton::clicked,
|
||||
this, [this]() { configureFilter(m_ui.filterList->currentIndex()); });
|
||||
this, [this] { configureFilter(m_ui.filterList->currentIndex()); });
|
||||
connect(m_ui.removeButton, &QPushButton::clicked,
|
||||
this, &LocatorSettingsWidget::removeCustomFilter);
|
||||
|
||||
|
@@ -630,7 +630,8 @@ LocatorWidget::LocatorWidget(Locator *locator) :
|
||||
m_progressIndicator->hide();
|
||||
m_showProgressTimer.setSingleShot(true);
|
||||
m_showProgressTimer.setInterval(50); // don't show progress for < 50ms tasks
|
||||
connect(&m_showProgressTimer, &QTimer::timeout, [this]() { setProgressIndicatorVisible(true);});
|
||||
connect(&m_showProgressTimer, &QTimer::timeout,
|
||||
this, [this] { setProgressIndicatorVisible(true); });
|
||||
|
||||
Command *locateCmd = ActionManager::command(Constants::LOCATE);
|
||||
if (QTC_GUARD(locateCmd)) {
|
||||
|
@@ -564,7 +564,7 @@ void LoggingViewManagerWidget::showLogViewContextMenu(const QPoint &pos) const
|
||||
m.addAction(copy);
|
||||
auto copyAll = new QAction(tr("Copy All"), &m);
|
||||
m.addAction(copyAll);
|
||||
connect(copy, &QAction::triggered, &m, [this](){
|
||||
connect(copy, &QAction::triggered, &m, [this] {
|
||||
auto selectionModel = m_logView->selectionModel();
|
||||
QString copied;
|
||||
const bool useTS = m_timestamps->isChecked();
|
||||
@@ -576,7 +576,7 @@ void LoggingViewManagerWidget::showLogViewContextMenu(const QPoint &pos) const
|
||||
|
||||
QGuiApplication::clipboard()->setText(copied);
|
||||
});
|
||||
connect(copyAll, &QAction::triggered, &m, [this](){
|
||||
connect(copyAll, &QAction::triggered, &m, [this] {
|
||||
QString copied;
|
||||
const bool useTS = m_timestamps->isChecked();
|
||||
const bool useLL = m_messageTypes->isChecked();
|
||||
|
@@ -1493,7 +1493,7 @@ void MainWindow::changeLog()
|
||||
"[\\1](https://bugreports.qt.io/browse/\\1)");
|
||||
textEdit->setMarkdown(contents);
|
||||
};
|
||||
connect(versionCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), textEdit, showLog);
|
||||
connect(versionCombo, &QComboBox::currentIndexChanged, textEdit, showLog);
|
||||
showLog(versionCombo->currentIndex());
|
||||
|
||||
connect(showInExplorer, &QPushButton::clicked, [versionCombo, versionedFiles] {
|
||||
|
@@ -55,8 +55,7 @@ MimeTypeMagicDialog::MimeTypeMagicDialog(QWidget *parent) :
|
||||
connect(ui.informationLabel, &QLabel::linkActivated, this, [](const QString &link) {
|
||||
QDesktopServices::openUrl(QUrl(link));
|
||||
});
|
||||
connect(ui.typeSelector, QOverload<int>::of(&QComboBox::activated),
|
||||
this, [this]() {
|
||||
connect(ui.typeSelector, &QComboBox::activated, this, [this] {
|
||||
if (ui.useRecommendedGroupBox->isChecked())
|
||||
setToRecommendedValues();
|
||||
});
|
||||
|
@@ -99,8 +99,7 @@ NavigationSubWidget::NavigationSubWidget(NavigationWidget *parentWidget, int pos
|
||||
|
||||
setFactoryIndex(factoryIndex);
|
||||
|
||||
connect(m_navigationComboBox,
|
||||
QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
connect(m_navigationComboBox, &QComboBox::currentIndexChanged,
|
||||
this, &NavigationSubWidget::comboBoxIndexChanged);
|
||||
|
||||
comboBoxIndexChanged(factoryIndex);
|
||||
|
@@ -99,8 +99,7 @@ SideBarWidget::SideBarWidget(SideBar *sideBar, const QString &id)
|
||||
}
|
||||
setCurrentItem(t);
|
||||
|
||||
connect(m_comboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
this, &SideBarWidget::setCurrentIndex);
|
||||
connect(m_comboBox, &QComboBox::currentIndexChanged, this, &SideBarWidget::setCurrentIndex);
|
||||
}
|
||||
|
||||
SideBarWidget::~SideBarWidget() = default;
|
||||
|
@@ -94,12 +94,9 @@ public:
|
||||
for (const TerminalCommand &term : availableTerminals)
|
||||
m_ui.terminalComboBox->addItem(term.command, QVariant::fromValue(term));
|
||||
updateTerminalUi(TerminalCommand::terminalEmulator());
|
||||
connect(m_ui.terminalComboBox,
|
||||
QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
this,
|
||||
connect(m_ui.terminalComboBox, &QComboBox::currentIndexChanged, this,
|
||||
[this](int index) {
|
||||
updateTerminalUi(
|
||||
m_ui.terminalComboBox->itemData(index).value<TerminalCommand>());
|
||||
updateTerminalUi(m_ui.terminalComboBox->itemData(index).value<TerminalCommand>());
|
||||
});
|
||||
} else {
|
||||
m_ui.terminalLabel->hide();
|
||||
@@ -156,8 +153,7 @@ public:
|
||||
connect(m_ui.helpCrashReportingButton, &QAbstractButton::clicked, this, [this] {
|
||||
showHelpDialog(tr("Crash Reporting"), CorePlugin::msgCrashpadInformation());
|
||||
});
|
||||
connect(m_ui.enableCrashReportingCheckBox,
|
||||
QOverload<int>::of(&QCheckBox::stateChanged), this, [this] {
|
||||
connect(m_ui.enableCrashReportingCheckBox, &QCheckBox::stateChanged, this, [this] {
|
||||
const QString restartText = tr("The change will take effect after restart.");
|
||||
Core::RestartDialog restartDialog(Core::ICore::dialogParent(), restartText);
|
||||
restartDialog.exec();
|
||||
|
@@ -90,7 +90,7 @@ WindowSupport::WindowSupport(QWidget *window, const Context &context)
|
||||
|
||||
m_windowList->addWindow(window);
|
||||
|
||||
connect(ICore::instance(), &ICore::coreAboutToClose, this, [this]() { m_shutdown = true; });
|
||||
connect(ICore::instance(), &ICore::coreAboutToClose, this, [this] { m_shutdown = true; });
|
||||
}
|
||||
|
||||
WindowSupport::~WindowSupport()
|
||||
|
Reference in New Issue
Block a user