From 244c9af3c6d94e4ae9434e9bc0b92e786f37f138 Mon Sep 17 00:00:00 2001 From: Andreas Stallinger Date: Tue, 1 Aug 2017 12:35:33 +0200 Subject: [PATCH] src: new signal slot syntax SLOT()/SIGNAL() -> &class::method() --- cmake/CLANGConfig.cmake | 1 + .../qt/element/QtAutocompletionList.cpp | 10 +- src/lib_gui/qt/element/QtBookmark.cpp | 10 +- src/lib_gui/qt/element/QtBookmarkCategory.cpp | 4 +- src/lib_gui/qt/element/QtCodeArea.cpp | 6 +- src/lib_gui/qt/element/QtCodeFile.cpp | 24 ++--- src/lib_gui/qt/element/QtCodeFileList.cpp | 7 +- src/lib_gui/qt/element/QtCodeFileSingle.cpp | 2 +- .../qt/element/QtCodeFileTitleButton.cpp | 2 +- src/lib_gui/qt/element/QtCodeNavigator.cpp | 12 +-- src/lib_gui/qt/element/QtCodeNavigator.h | 4 +- src/lib_gui/qt/element/QtCodeSnippet.cpp | 4 +- src/lib_gui/qt/element/QtDirectoryListBox.cpp | 16 ++-- src/lib_gui/qt/element/QtHelpButton.cpp | 2 +- src/lib_gui/qt/element/QtHistoryList.cpp | 2 +- src/lib_gui/qt/element/QtLocationPicker.cpp | 2 +- src/lib_gui/qt/element/QtProgressBar.cpp | 2 +- src/lib_gui/qt/element/QtRefreshBar.cpp | 2 +- src/lib_gui/qt/element/QtSearchBar.cpp | 4 +- src/lib_gui/qt/element/QtSmartSearchBox.cpp | 12 +-- src/lib_gui/qt/element/QtStatusBar.cpp | 6 +- src/lib_gui/qt/element/QtUndoRedo.cpp | 14 +-- src/lib_gui/qt/graphics/QtGraphicsView.cpp | 16 ++-- src/lib_gui/qt/network/QtTcpWrapper.cpp | 4 +- .../qt/networkPrototype/SocketTest.cpp | 2 +- src/lib_gui/qt/utility/QtContextMenu.cpp | 8 +- src/lib_gui/qt/utility/QtThreadedFunctor.h | 2 +- src/lib_gui/qt/view/QtBookmarkView.cpp | 4 +- src/lib_gui/qt/view/QtDialogView.cpp | 13 ++- src/lib_gui/qt/view/QtErrorView.cpp | 7 +- src/lib_gui/qt/view/QtErrorView.h | 3 +- src/lib_gui/qt/view/QtGraphView.cpp | 30 +++--- src/lib_gui/qt/window/QtBookmarkBrowser.cpp | 6 +- src/lib_gui/qt/window/QtBookmarkCreator.cpp | 4 +- src/lib_gui/qt/window/QtIndexingDialog.cpp | 6 +- src/lib_gui/qt/window/QtMainWindow.cpp | 96 +++++++++---------- src/lib_gui/qt/window/QtSplashScreen.cpp | 9 +- src/lib_gui/qt/window/QtStartScreen.cpp | 14 +-- src/lib_gui/qt/window/QtWindow.cpp | 8 +- src/lib_gui/qt/window/QtWindow.h | 4 +- .../project_wizzard/QtProjectWizzard.cpp | 56 +++++------ .../QtProjectWizzardContent.cpp | 6 +- .../QtProjectWizzardContentPath.cpp | 2 +- .../QtProjectWizzardContentPaths.cpp | 10 +- .../QtProjectWizzardContentPreferences.cpp | 12 +-- ...QtProjectWizzardContentSourceGroupData.cpp | 2 +- .../QtProjectWizzardContentVS.cpp | 2 +- 47 files changed, 242 insertions(+), 232 deletions(-) diff --git a/cmake/CLANGConfig.cmake b/cmake/CLANGConfig.cmake index 9c5def8a..c65cbce2 100644 --- a/cmake/CLANGConfig.cmake +++ b/cmake/CLANGConfig.cmake @@ -38,6 +38,7 @@ endif() # Remove unwanted flags string(REPLACE "-fno-exceptions" "" CLANG_DEFINITIONS "${CLANG_DEFINITIONS}") string(REPLACE "-fno-rtti" "" CLANG_DEFINITIONS "${CLANG_DEFINITIONS}") +string(REPLACE "-std=c++11" "" CLANG_DEFINITIONS "${CLANG_DEFINITIONS}") if(CMAKE_COMPILER_IS_GNUCXX) string(REPLACE "-Wcovered-switch-default" "" CLANG_DEFINITIONS "${CLANG_DEFINITIONS}") diff --git a/src/lib_gui/qt/element/QtAutocompletionList.cpp b/src/lib_gui/qt/element/QtAutocompletionList.cpp index 6a01a359..50126801 100644 --- a/src/lib_gui/qt/element/QtAutocompletionList.cpp +++ b/src/lib_gui/qt/element/QtAutocompletionList.cpp @@ -384,8 +384,14 @@ void QtAutocompletionList::completeAt(const QPoint& pos, const std::vectorresetCharSizes(); disconnect(); // must be done because of a bug where signals are no longer received by QtSmartSearchBox - connect(this, SIGNAL(highlighted(const QModelIndex&)), this, SLOT(onHighlighted(const QModelIndex&)), Qt::DirectConnection); - connect(this, SIGNAL(activated(const QModelIndex&)), this, SLOT(onActivated(const QModelIndex&)), Qt::DirectConnection); + connect(this, + static_cast(&QtAutocompletionList::highlighted), + this, + &QtAutocompletionList::onHighlighted, Qt::DirectConnection); + connect(this, + static_cast(&QtAutocompletionList::activated), + this, + &QtAutocompletionList::onActivated, Qt::DirectConnection); complete(QRect(pos.x(), pos.y(), std::max(dynamic_cast(parent())->width(), 400), 1)); diff --git a/src/lib_gui/qt/element/QtBookmark.cpp b/src/lib_gui/qt/element/QtBookmark.cpp index d14dcf49..c74baf3c 100644 --- a/src/lib_gui/qt/element/QtBookmark.cpp +++ b/src/lib_gui/qt/element/QtBookmark.cpp @@ -81,10 +81,10 @@ QtBookmark::QtBookmark() m_comment->hide(); layout->addWidget(m_comment); - connect(m_activateButton, SIGNAL(clicked()), this, SLOT(activateClicked())); - connect(m_editButton, SIGNAL(clicked()), this, SLOT(editClicked())); - connect(m_deleteButton, SIGNAL(clicked()), this, SLOT(deleteClicked())); - connect(m_toggleCommentButton, SIGNAL(clicked()), this, SLOT(commentToggled())); + connect(m_activateButton, &QPushButton::clicked, this, &QtBookmark::activateClicked); + connect(m_editButton, &QPushButton::clicked, this, &QtBookmark::editClicked); + connect(m_deleteButton, &QPushButton::clicked, this, &QtBookmark::deleteClicked); + connect(m_toggleCommentButton, &QPushButton::clicked, this, &QtBookmark::commentToggled); } QtBookmark::~QtBookmark() @@ -174,7 +174,7 @@ void QtBookmark::resizeEvent(QResizeEvent* event) } m_activateButton->setText(m_bookmark->getName().c_str()); - QTimer::singleShot(10, this, SLOT(elideButtonText())); + QTimer::singleShot(10, this, &QtBookmark::elideButtonText); } void QtBookmark::showEvent(QShowEvent* event) diff --git a/src/lib_gui/qt/element/QtBookmarkCategory.cpp b/src/lib_gui/qt/element/QtBookmarkCategory.cpp index ef644880..6a6cb45d 100644 --- a/src/lib_gui/qt/element/QtBookmarkCategory.cpp +++ b/src/lib_gui/qt/element/QtBookmarkCategory.cpp @@ -27,7 +27,7 @@ QtBookmarkCategory::QtBookmarkCategory() m_expandButton->setIconSize(QSize(8, 8)); layout->addWidget(m_expandButton); - connect(m_expandButton, SIGNAL(clicked()), this, SLOT(expandClicked())); + connect(m_expandButton, &QPushButton::clicked, this, &QtBookmarkCategory::expandClicked); m_name = new QLabel(); m_name->setObjectName("category_name"); @@ -45,7 +45,7 @@ QtBookmarkCategory::QtBookmarkCategory() m_deleteButton->hide(); layout->addWidget(m_deleteButton); - connect(m_deleteButton, SIGNAL(clicked()), this, SLOT(deleteClicked())); + connect(m_deleteButton, &QPushButton::clicked, this, &QtBookmarkCategory::deleteClicked); } QtBookmarkCategory::~QtBookmarkCategory() diff --git a/src/lib_gui/qt/element/QtCodeArea.cpp b/src/lib_gui/qt/element/QtCodeArea.cpp index f6c478dd..d674dbb8 100644 --- a/src/lib_gui/qt/element/QtCodeArea.cpp +++ b/src/lib_gui/qt/element/QtCodeArea.cpp @@ -95,8 +95,8 @@ QtCodeArea::QtCodeArea( m_digits = lineNumberDigits(); updateLineNumberAreaWidth(); - connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int))); - connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int))); + connect(this, &QtCodeArea::blockCountChanged, this, &QtCodeArea::updateLineNumberAreaWidth); + connect(this, &QtCodeArea::updateRequest, this, &QtCodeArea::updateLineNumberArea); // MouseWheelOverScrollbarFilter is deleted by parent. horizontalScrollBar()->installEventFilter(new MouseWheelOverScrollbarFilter()); @@ -646,5 +646,5 @@ void QtCodeArea::createActions() m_setIDECursorPositionAction = new QAction(tr("Set IDE Cursor"), this); m_setIDECursorPositionAction->setStatusTip(tr("Set the IDE Cursor to this code position")); m_setIDECursorPositionAction->setToolTip(tr("Set the IDE Cursor to this code position")); - connect(m_setIDECursorPositionAction, SIGNAL(triggered()), this, SLOT(setIDECursorPosition())); + connect(m_setIDECursorPositionAction, &QAction::triggered, this, &QtCodeArea::setIDECursorPosition); } diff --git a/src/lib_gui/qt/element/QtCodeFile.cpp b/src/lib_gui/qt/element/QtCodeFile.cpp index 33e32efb..81d60268 100644 --- a/src/lib_gui/qt/element/QtCodeFile.cpp +++ b/src/lib_gui/qt/element/QtCodeFile.cpp @@ -34,8 +34,8 @@ QtCodeFile::QtCodeFile(const FilePath& filePath, QtCodeNavigator* navigator) m_titleBar->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac layout->addWidget(m_titleBar); - connect(dynamic_cast(m_titleBar), SIGNAL(hoveredIn(QPushButton*)), this, SLOT(enteredTitleBar(QPushButton*))); - connect(dynamic_cast(m_titleBar), SIGNAL(hoveredOut(QPushButton*)), this, SLOT(leftTitleBar(QPushButton*))); + connect(dynamic_cast(m_titleBar), &QtHoverButton::hoveredIn, this, &QtCodeFile::enteredTitleBar); + connect(dynamic_cast(m_titleBar), &QtHoverButton::hoveredOut, this, &QtCodeFile::leftTitleBar); QHBoxLayout* titleLayout = new QHBoxLayout(); titleLayout->setMargin(0); @@ -84,12 +84,12 @@ QtCodeFile::QtCodeFile(const FilePath& filePath, QtCodeNavigator* navigator) m_maximizeButton->setToolTip("maximize"); titleLayout->addWidget(m_maximizeButton); - connect(m_minimizeButton, SIGNAL(hoveredIn(QPushButton*)), this, SLOT(leftTitleBar(QPushButton*))); - connect(m_minimizeButton, SIGNAL(hoveredOut(QPushButton*)), this, SLOT(enteredTitleBar(QPushButton*))); - connect(m_snippetButton, SIGNAL(hoveredIn(QPushButton*)), this, SLOT(leftTitleBar(QPushButton*))); - connect(m_snippetButton, SIGNAL(hoveredOut(QPushButton*)), this, SLOT(enteredTitleBar(QPushButton*))); - connect(m_maximizeButton, SIGNAL(hoveredIn(QPushButton*)), this, SLOT(leftTitleBar(QPushButton*))); - connect(m_maximizeButton, SIGNAL(hoveredOut(QPushButton*)), this, SLOT(enteredTitleBar(QPushButton*))); + connect(m_minimizeButton, &QtIconStateButton::hoveredIn, this, &QtCodeFile::leftTitleBar); + connect(m_minimizeButton, &QtIconStateButton::hoveredOut, this, &QtCodeFile::enteredTitleBar); + connect(m_snippetButton, &QtIconStateButton::hoveredIn, this, &QtCodeFile::leftTitleBar); + connect(m_snippetButton, &QtIconStateButton::hoveredOut, this, &QtCodeFile::enteredTitleBar); + connect(m_maximizeButton, &QtIconStateButton::hoveredIn, this, &QtCodeFile::leftTitleBar); + connect(m_maximizeButton, &QtIconStateButton::hoveredOut, this, &QtCodeFile::enteredTitleBar); titleLayout->addSpacing(3); @@ -97,10 +97,10 @@ QtCodeFile::QtCodeFile(const FilePath& filePath, QtCodeNavigator* navigator) m_snippetButton->setEnabled(false); m_maximizeButton->setEnabled(false); - connect(m_titleBar, SIGNAL(clicked()), this, SLOT(clickedTitleBar())); - connect(m_minimizeButton, SIGNAL(clicked()), this, SLOT(clickedMinimizeButton())); - connect(m_snippetButton, SIGNAL(clicked()), this, SLOT(clickedSnippetButton())); - connect(m_maximizeButton, SIGNAL(clicked()), this, SLOT(clickedMaximizeButton())); + connect(m_titleBar, &QPushButton::clicked, this, &QtCodeFile::clickedTitleBar); + connect(m_minimizeButton, &QtIconStateButton::clicked, this, &QtCodeFile::clickedMinimizeButton); + connect(m_snippetButton, &QtIconStateButton::clicked, this, &QtCodeFile::clickedSnippetButton); + connect(m_maximizeButton, &QtIconStateButton::clicked, this, &QtCodeFile::clickedMaximizeButton); m_snippetLayout = new QVBoxLayout(); m_snippetLayout->setContentsMargins(0, 0, 0, 0); diff --git a/src/lib_gui/qt/element/QtCodeFileList.cpp b/src/lib_gui/qt/element/QtCodeFileList.cpp index 696e212c..4339c6f7 100644 --- a/src/lib_gui/qt/element/QtCodeFileList.cpp +++ b/src/lib_gui/qt/element/QtCodeFileList.cpp @@ -30,7 +30,7 @@ QtCodeFileList::QtCodeFileList(QtCodeNavigator* navigator) m_scrollSpeedChangeListener.setScrollBar(verticalScrollBar()); - connect(verticalScrollBar(), SIGNAL(valueChanged(int)), m_navigator, SLOT(scrolled(int))); + connect(verticalScrollBar(), &QScrollBar::valueChanged, m_navigator, &QtCodeNavigator::scrolled); } QtCodeFileList::~QtCodeFileList() @@ -86,15 +86,14 @@ QScrollArea* QtCodeFileList::getScrollArea() void QtCodeFileList::addCodeSnippet(const CodeSnippetParams& params) { QtCodeFile* file = getFile(params.locationFile->getFilePath()); - QtCodeSnippet* snippet = nullptr; if (params.insertSnippet) { - snippet = file->insertCodeSnippet(params); + file->insertCodeSnippet(params); } else { - snippet = file->addCodeSnippet(params); + file->addCodeSnippet(params); } file->setModificationTime(params.modificationTime); diff --git a/src/lib_gui/qt/element/QtCodeFileSingle.cpp b/src/lib_gui/qt/element/QtCodeFileSingle.cpp index d4c002b3..40d34100 100644 --- a/src/lib_gui/qt/element/QtCodeFileSingle.cpp +++ b/src/lib_gui/qt/element/QtCodeFileSingle.cpp @@ -114,7 +114,7 @@ void QtCodeFileSingle::addCodeSnippet(const CodeSnippetParams& params) } file.area = std::make_shared(1, params.code, params.locationFile, m_navigator, this); - connect(file.area->verticalScrollBar(), SIGNAL(valueChanged(int)), m_navigator, SLOT(scrolled(int))); + connect(file.area->verticalScrollBar(), &QScrollBar::valueChanged, m_navigator, &QtCodeNavigator::scrolled); m_fileDatas.emplace(file.filePath, file); m_filePaths.push_back(file.filePath); diff --git a/src/lib_gui/qt/element/QtCodeFileTitleButton.cpp b/src/lib_gui/qt/element/QtCodeFileTitleButton.cpp index 33e3acf3..a70d7c80 100644 --- a/src/lib_gui/qt/element/QtCodeFileTitleButton.cpp +++ b/src/lib_gui/qt/element/QtCodeFileTitleButton.cpp @@ -22,7 +22,7 @@ QtCodeFileTitleButton::QtCodeFileTitleButton(QWidget* parent) setFixedHeight(std::max(fontMetrics().height() * 1.2, 28.0)); setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Fixed); - connect(this, SIGNAL(clicked()), this, SLOT(clickedTitle())); + connect(this, &QtCodeFileTitleButton::clicked, this, &QtCodeFileTitleButton::clickedTitle); } QtCodeFileTitleButton::~QtCodeFileTitleButton() diff --git a/src/lib_gui/qt/element/QtCodeNavigator.cpp b/src/lib_gui/qt/element/QtCodeNavigator.cpp index e30a84fd..5af025c9 100644 --- a/src/lib_gui/qt/element/QtCodeNavigator.cpp +++ b/src/lib_gui/qt/element/QtCodeNavigator.cpp @@ -55,8 +55,8 @@ QtCodeNavigator::QtCodeNavigator(QWidget* parent) navLayout->addWidget(m_prevButton); navLayout->addWidget(m_nextButton); - connect(m_prevButton, SIGNAL(clicked()), this, SLOT(previousReference())); - connect(m_nextButton, SIGNAL(clicked()), this, SLOT(nextReference())); + connect(m_prevButton, &QPushButton::clicked, this, &QtCodeNavigator::previousReference); + connect(m_nextButton, &QPushButton::clicked, this, &QtCodeNavigator::nextReference); m_refLabel = new QLabel("0/0 references"); @@ -81,8 +81,8 @@ QtCodeNavigator::QtCodeNavigator(QWidget* parent) navLayout->addWidget(m_listButton); navLayout->addWidget(m_fileButton); - connect(m_listButton, SIGNAL(clicked()), this, SLOT(setModeList())); - connect(m_fileButton, SIGNAL(clicked()), this, SLOT(setModeSingle())); + connect(m_listButton, &QPushButton::clicked, this, &QtCodeNavigator::setModeList); + connect(m_fileButton, &QPushButton::clicked, this, &QtCodeNavigator::setModeSingle); navigation->setLayout(navLayout); @@ -128,7 +128,7 @@ QtCodeNavigator::QtCodeNavigator(QWidget* parent) setModeList(); } - connect(this, SIGNAL(scrollRequest()), this, SLOT(handleScrollRequest()), Qt::QueuedConnection); + connect(this, &QtCodeNavigator::scrollRequest, this, &QtCodeNavigator::handleScrollRequest, Qt::QueuedConnection); } QtCodeNavigator::~QtCodeNavigator() @@ -550,7 +550,7 @@ void QtCodeNavigator::scrollToValue(int value, bool inListMode) if ((m_mode == MODE_LIST) == inListMode) { m_value = value; - QTimer::singleShot(100, this, SLOT(setValue())); + QTimer::singleShot(100, this, &QtCodeNavigator::setValue); m_scrollRequest = ScrollRequest(); } } diff --git a/src/lib_gui/qt/element/QtCodeNavigator.h b/src/lib_gui/qt/element/QtCodeNavigator.h index 018c10a5..b6e0dca2 100644 --- a/src/lib_gui/qt/element/QtCodeNavigator.h +++ b/src/lib_gui/qt/element/QtCodeNavigator.h @@ -94,9 +94,11 @@ public: signals: void scrollRequest(); +public slots: + void scrolled(int value); + private slots: void handleScrollRequest(); - void scrolled(int value); void setValue(); void previousReference(bool fromUI = true); diff --git a/src/lib_gui/qt/element/QtCodeSnippet.cpp b/src/lib_gui/qt/element/QtCodeSnippet.cpp index ac46290f..ab019058 100644 --- a/src/lib_gui/qt/element/QtCodeSnippet.cpp +++ b/src/lib_gui/qt/element/QtCodeSnippet.cpp @@ -89,7 +89,7 @@ QtCodeSnippet::QtCodeSnippet(const CodeSnippetParams& params, QtCodeNavigator* n { m_title->setText(m_titleString.c_str()); } - connect(m_title, SIGNAL(clicked()), this, SLOT(clickedTitle())); + connect(m_title, &QPushButton::clicked, this, &QtCodeSnippet::clickedTitle); } layout->addWidget(m_codeArea.get()); @@ -105,7 +105,7 @@ QtCodeSnippet::QtCodeSnippet(const CodeSnippetParams& params, QtCodeNavigator* n { m_footer->setText(m_footerString.c_str()); } - connect(m_footer, SIGNAL(clicked()), this, SLOT(clickedFooter())); + connect(m_footer, &QPushButton::clicked, this, &QtCodeSnippet::clickedFooter); } if (params.reduced) diff --git a/src/lib_gui/qt/element/QtDirectoryListBox.cpp b/src/lib_gui/qt/element/QtDirectoryListBox.cpp index ffecebb5..2d8c9ced 100644 --- a/src/lib_gui/qt/element/QtDirectoryListBox.cpp +++ b/src/lib_gui/qt/element/QtDirectoryListBox.cpp @@ -46,8 +46,8 @@ QtListItemWidget::QtListItemWidget(QtDirectoryListBox* list, QListWidgetItem* it setLayout(layout); - connect(m_button, SIGNAL(clicked()), this, SLOT(handleButtonPress())); - connect(m_data, SIGNAL(focus()), this, SLOT(handleFocus())); + connect(m_button, &QPushButton::clicked, this, &QtListItemWidget::handleButtonPress); + connect(m_data, &QtLineEdit::focus, this, &QtListItemWidget::handleFocus); } QString QtListItemWidget::getText() @@ -184,9 +184,9 @@ QtDirectoryListBox::QtDirectoryListBox(QWidget *parent, const QString& listName, layout->addWidget(buttonContainer); setLayout(layout); - connect(m_addButton, SIGNAL(clicked()), this, SLOT(addListBoxItem())); - connect(m_removeButton, SIGNAL(clicked()), this, SLOT(removeListBoxItem())); - connect(editButton, SIGNAL(clicked()), this, SLOT(showEditDialog())); + connect(m_addButton, &QPushButton::clicked, this, &QtDirectoryListBox::addListBoxItem); + connect(m_removeButton, &QPushButton::clicked, this, &QtDirectoryListBox::removeListBoxItem); + connect(editButton, &QPushButton::clicked, this, &QtDirectoryListBox::showEditDialog); setAcceptDrops(true); setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Minimum); @@ -284,7 +284,7 @@ void QtDirectoryListBox::setStringList(const std::vector& list) m_relativeRootDirectory = root; - QTimer::singleShot(1, this, SLOT(resize())); + QTimer::singleShot(1, this, &QtDirectoryListBox::resize); } void QtDirectoryListBox::selectItem(QListWidgetItem* item) @@ -382,8 +382,8 @@ void QtDirectoryListBox::showEditDialog() m_editDialog->setText(utility::join(getStringList(), "\n")); - connect(m_editDialog.get(), SIGNAL(canceled()), this, SLOT(canceledEditDialog())); - connect(m_editDialog.get(), SIGNAL(finished()), this, SLOT(savedEditDialog())); + connect(m_editDialog.get(), &QtTextEditDialog::canceled, this, &QtDirectoryListBox::canceledEditDialog); + connect(m_editDialog.get(), &QtTextEditDialog::finished, this, &QtDirectoryListBox::savedEditDialog); } m_editDialog->showWindow(); diff --git a/src/lib_gui/qt/element/QtHelpButton.cpp b/src/lib_gui/qt/element/QtHelpButton.cpp index 17cac05c..5a291e4e 100644 --- a/src/lib_gui/qt/element/QtHelpButton.cpp +++ b/src/lib_gui/qt/element/QtHelpButton.cpp @@ -19,7 +19,7 @@ QtHelpButton::QtHelpButton(const QString& helpText, QWidget* parent) leaveEvent(nullptr); - connect(this, SIGNAL(clicked()), this, SLOT(handleHelpPress())); + connect(this, &QtHelpButton::clicked, this, &QtHelpButton::handleHelpPress); } void QtHelpButton::handleHelpPress() diff --git a/src/lib_gui/qt/element/QtHistoryList.cpp b/src/lib_gui/qt/element/QtHistoryList.cpp index 4a54af95..f4dd80b3 100644 --- a/src/lib_gui/qt/element/QtHistoryList.cpp +++ b/src/lib_gui/qt/element/QtHistoryList.cpp @@ -129,7 +129,7 @@ QtHistoryList::QtHistoryList(const std::vector& history, size_t cur setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concat(FilePath("history_list/history_list.css"))).c_str()); - connect(m_list, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(onItemClicked(QListWidgetItem*))); + connect(m_list, &QListWidget::itemClicked, this, &QtHistoryList::onItemClicked); } void QtHistoryList::showPopup(QPoint pos) diff --git a/src/lib_gui/qt/element/QtLocationPicker.cpp b/src/lib_gui/qt/element/QtLocationPicker.cpp index 8d7f78fc..f3873783 100644 --- a/src/lib_gui/qt/element/QtLocationPicker.cpp +++ b/src/lib_gui/qt/element/QtLocationPicker.cpp @@ -32,7 +32,7 @@ QtLocationPicker::QtLocationPicker(QWidget *parent) (ResourcePaths::getGuiPath().str() + "window/dots_hover.png").c_str()); m_button->setObjectName("dotsButton"); m_button->setToolTip("pick file"); - connect(m_button, SIGNAL(clicked()), this, SLOT(handleButtonPress())); + connect(m_button, &QPushButton::clicked, this, &QtLocationPicker::handleButtonPress); layout->addWidget(m_button); setLayout(layout); diff --git a/src/lib_gui/qt/element/QtProgressBar.cpp b/src/lib_gui/qt/element/QtProgressBar.cpp index bfa1e490..e33ffd7b 100644 --- a/src/lib_gui/qt/element/QtProgressBar.cpp +++ b/src/lib_gui/qt/element/QtProgressBar.cpp @@ -14,7 +14,7 @@ QtProgressBar::QtProgressBar(QWidget* parent) , m_pixmap((ResourcePaths::getGuiPath().str() + "indexing_dialog/progress_bar_element.png").c_str()) { m_timer = new QTimer(this); - connect(m_timer, SIGNAL(timeout()), this, SLOT(animate())); + connect(m_timer, &QTimer::timeout, this, &QtProgressBar::animate); m_pixmap.scaleToHeight(20); } diff --git a/src/lib_gui/qt/element/QtRefreshBar.cpp b/src/lib_gui/qt/element/QtRefreshBar.cpp index b72863b6..10f5aa3e 100644 --- a/src/lib_gui/qt/element/QtRefreshBar.cpp +++ b/src/lib_gui/qt/element/QtRefreshBar.cpp @@ -28,7 +28,7 @@ QtRefreshBar::QtRefreshBar() m_refreshButton->setEnabled(false); - connect(m_refreshButton, SIGNAL(clicked()), this, SLOT(refreshClicked())); + connect(m_refreshButton, &QPushButton::clicked, this, &QtRefreshBar::refreshClicked); refreshStyle(); } diff --git a/src/lib_gui/qt/element/QtSearchBar.cpp b/src/lib_gui/qt/element/QtSearchBar.cpp index 5c795db9..234aebfc 100644 --- a/src/lib_gui/qt/element/QtSearchBar.cpp +++ b/src/lib_gui/qt/element/QtSearchBar.cpp @@ -25,7 +25,7 @@ QtSearchBar::QtSearchBar() m_homeButton->setToolTip("to overview"); m_homeButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac layout->addWidget(m_homeButton); - connect(m_homeButton, SIGNAL(clicked()), this, SLOT(homeButtonClicked())); + connect(m_homeButton, &QPushButton::clicked, this, &QtSearchBar::homeButtonClicked); m_searchBoxContainer = new QWidget(this); m_searchBoxContainer->setObjectName("search_box_container"); @@ -51,7 +51,7 @@ QtSearchBar::QtSearchBar() m_searchButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac layout->addWidget(m_searchButton); - connect(m_searchButton, SIGNAL(clicked()), m_searchBox, SLOT(search())); + connect(m_searchButton, &QPushButton::clicked, m_searchBox, &QtSmartSearchBox::search); refreshStyle(); } diff --git a/src/lib_gui/qt/element/QtSmartSearchBox.cpp b/src/lib_gui/qt/element/QtSmartSearchBox.cpp index eb3d16da..b44f1d39 100644 --- a/src/lib_gui/qt/element/QtSmartSearchBox.cpp +++ b/src/lib_gui/qt/element/QtSmartSearchBox.cpp @@ -20,7 +20,7 @@ QtSearchElement::QtSearchElement(const QString& text, QWidget* parent) { show(); setCheckable(true); - connect(this, SIGNAL(clicked(bool)), this, SLOT(onChecked(bool))); + connect(this, &QtSearchElement::clicked, this, &QtSearchElement::onChecked); } void QtSearchElement::onChecked(bool) @@ -94,8 +94,8 @@ QtSmartSearchBox::QtSmartSearchBox(QWidget* parent) m_highlightRect->setGeometry(0, 0, 0, 0); m_highlightRect->setObjectName("search_box_highlight"); - connect(this, SIGNAL(textEdited(const QString&)), this, SLOT(onTextEdited(const QString&))); - connect(this, SIGNAL(textChanged(const QString&)), this, SLOT(onTextChanged(const QString&))); + connect(this, &QtSmartSearchBox::textEdited, this, &QtSmartSearchBox::onTextEdited); + connect(this, &QtSmartSearchBox::textChanged, this, &QtSmartSearchBox::onTextChanged); m_completer = new QtAutocompletionList(this); m_completer->setWidget(this); @@ -122,8 +122,8 @@ void QtSmartSearchBox::setAutocompletionList(const std::vector& aut setCursorPosition(cursor); - connect(completer, SIGNAL(matchHighlighted(const SearchMatch&)), this, SLOT(onAutocompletionHighlighted(const SearchMatch&)), Qt::DirectConnection); - connect(completer, SIGNAL(matchActivated(const SearchMatch&)), this, SLOT(onAutocompletionActivated(const SearchMatch&)), Qt::DirectConnection); + connect(completer, &QtAutocompletionList::matchHighlighted, this, &QtSmartSearchBox::onAutocompletionHighlighted, Qt::DirectConnection); + connect(completer, &QtAutocompletionList::matchActivated, this, &QtSmartSearchBox::onAutocompletionActivated, Qt::DirectConnection); if (autocompletionList.size()) { @@ -775,7 +775,7 @@ void QtSmartSearchBox::updateElements() element->setStyleSheet(css.str().c_str()); - connect(element.get(), SIGNAL(wasChecked(QtSearchElement*)), this, SLOT(onElementSelected(QtSearchElement*))); + connect(element.get(), &QtSearchElement::wasChecked, this, &QtSmartSearchBox::onElementSelected); } updatePlaceholder(); diff --git a/src/lib_gui/qt/element/QtStatusBar.cpp b/src/lib_gui/qt/element/QtStatusBar.cpp index 456781ca..a34f9aa8 100644 --- a/src/lib_gui/qt/element/QtStatusBar.cpp +++ b/src/lib_gui/qt/element/QtStatusBar.cpp @@ -17,7 +17,7 @@ QtStatusBar::QtStatusBar() // if movie doesn't loop forever, force it to. if (movie->loopCount() != -1) { - connect(movie, SIGNAL(finished()), movie, SLOT(start())); + connect(movie, &QMovie::finished, movie, &QMovie::start); } movie->start(); @@ -31,7 +31,7 @@ QtStatusBar::QtStatusBar() addWidget(&m_text, 1); setText("", false, false); - connect(&m_text, SIGNAL(clicked()), this, SLOT(showStatus())); + connect(&m_text, &QPushButton::clicked, this, &QtStatusBar::showStatus); addPermanentWidget(&m_ideStatusText); @@ -45,7 +45,7 @@ QtStatusBar::QtStatusBar() ).scaledToHeight(12)); addPermanentWidget(&m_errorButton); - connect(&m_errorButton, SIGNAL(clicked()), this, SLOT(showErrors())); + connect(&m_errorButton, &QPushButton::clicked, this, &QtStatusBar::showErrors); } QtStatusBar::~QtStatusBar() diff --git a/src/lib_gui/qt/element/QtUndoRedo.cpp b/src/lib_gui/qt/element/QtUndoRedo.cpp index fa1c006d..d10826f1 100644 --- a/src/lib_gui/qt/element/QtUndoRedo.cpp +++ b/src/lib_gui/qt/element/QtUndoRedo.cpp @@ -45,13 +45,13 @@ QtUndoRedo::QtUndoRedo() layout->addWidget(m_historyButton); layout->addWidget(m_redoButton); - connect(m_undoButton, SIGNAL(pressed()), this, SLOT(buttonPressed())); - connect(m_redoButton, SIGNAL(pressed()), this, SLOT(buttonPressed())); - connect(m_historyButton, SIGNAL(pressed()), this, SLOT(buttonPressed())); + connect(m_undoButton, &QPushButton::pressed, this, &QtUndoRedo::buttonPressed); + connect(m_redoButton, &QPushButton::pressed, this, &QtUndoRedo::buttonPressed); + connect(m_historyButton, &QPushButton::pressed, this, &QtUndoRedo::buttonPressed); - connect(m_undoButton, SIGNAL(released()), this, SLOT(undoReleased())); - connect(m_redoButton, SIGNAL(released()), this, SLOT(redoReleased())); - connect(m_historyButton, SIGNAL(released()), this, SLOT(showHistory())); + connect(m_undoButton, &QPushButton::released, this, &QtUndoRedo::undoReleased); + connect(m_redoButton, &QPushButton::released, this, &QtUndoRedo::redoReleased); + connect(m_historyButton, &QPushButton::released, this, &QtUndoRedo::showHistory); refreshStyle(); } @@ -63,7 +63,7 @@ QtUndoRedo::~QtUndoRedo() void QtUndoRedo::buttonPressed() { m_pressed = true; - QTimer::singleShot(250, this, SLOT(showHistory())); + QTimer::singleShot(250, this, &QtUndoRedo::showHistory); m_historyButton->setAttribute(Qt::WA_UnderMouse, false); } diff --git a/src/lib_gui/qt/graphics/QtGraphicsView.cpp b/src/lib_gui/qt/graphics/QtGraphicsView.cpp index 7dd51f86..12845e12 100644 --- a/src/lib_gui/qt/graphics/QtGraphicsView.cpp +++ b/src/lib_gui/qt/graphics/QtGraphicsView.cpp @@ -37,29 +37,29 @@ QtGraphicsView::QtGraphicsView(QWidget* parent) setTransformationAnchor(QGraphicsView::AnchorUnderMouse); m_timer = std::make_shared(this); - connect(m_timer.get(), SIGNAL(timeout()), this, SLOT(updateTimer())); + connect(m_timer.get(), &QTimer::timeout, this, &QtGraphicsView::updateTimer); m_timerStopper = std::make_shared(this); m_timerStopper->setSingleShot(true); - connect(m_timerStopper.get(), SIGNAL(timeout()), this, SLOT(stopTimer())); + connect(m_timerStopper.get(), &QTimer::timeout, this, &QtGraphicsView::stopTimer); m_zoomLabelTimer = std::make_shared(this); - connect(m_zoomLabelTimer.get(), SIGNAL(timeout()), this, SLOT(hideZoomLabel())); + connect(m_zoomLabelTimer.get(), &QTimer::timeout, this, &QtGraphicsView::hideZoomLabel); m_exportGraphAction = new QAction(tr("Save as Image"), this); m_exportGraphAction->setStatusTip(tr("Save this graph as image file")); m_exportGraphAction->setToolTip(tr("Save this graph as image file")); - connect(m_exportGraphAction, SIGNAL(triggered()), this, SLOT(exportGraph())); + connect(m_exportGraphAction, &QAction::triggered, this, &QtGraphicsView::exportGraph); m_copyNodeNameAction = new QAction(tr("Copy Name"), this); m_copyNodeNameAction->setStatusTip(tr("Copies the name of this node to the clipboard")); m_copyNodeNameAction->setToolTip(tr("Copies the name of this node to the clipboard")); - connect(m_copyNodeNameAction, SIGNAL(triggered()), this, SLOT(copyNodeName())); + connect(m_copyNodeNameAction, &QAction::triggered, this, &QtGraphicsView::copyNodeName); m_bookmarkNodeAction = new QAction(tr("Bookmark Node"), this); m_bookmarkNodeAction->setStatusTip(tr("Create a bookmark for this node")); m_bookmarkNodeAction->setToolTip(tr("Create a bookmark for this node")); - connect(m_bookmarkNodeAction, SIGNAL(triggered()), this, SLOT(bookmarkNode())); + connect(m_bookmarkNodeAction, &QAction::triggered, this, &QtGraphicsView::bookmarkNode); m_zoomState = new QPushButton(this); m_zoomState->setObjectName("zoom_state"); @@ -69,13 +69,13 @@ QtGraphicsView::QtGraphicsView(QWidget* parent) m_zoomInButton->setObjectName("zoom_in_button"); m_zoomInButton->setAutoRepeat(true); m_zoomInButton->setToolTip("Zoom in (" + modifierName + " + Mousewheel forward)"); - connect(m_zoomInButton, SIGNAL(pressed()), this, SLOT(zoomInPressed())); + connect(m_zoomInButton, &QPushButton::pressed, this, &QtGraphicsView::zoomInPressed); m_zoomOutButton = new QPushButton(this); m_zoomOutButton->setObjectName("zoom_out_button"); m_zoomOutButton->setAutoRepeat(true); m_zoomOutButton->setToolTip("Zoom out (" + modifierName + " + Mousewheel back)"); - connect(m_zoomOutButton, SIGNAL(pressed()), this, SLOT(zoomOutPressed())); + connect(m_zoomOutButton, &QPushButton::pressed, this, &QtGraphicsView::zoomOutPressed); refreshStyle(); } diff --git a/src/lib_gui/qt/network/QtTcpWrapper.cpp b/src/lib_gui/qt/network/QtTcpWrapper.cpp index 008ef207..aa900fc3 100644 --- a/src/lib_gui/qt/network/QtTcpWrapper.cpp +++ b/src/lib_gui/qt/network/QtTcpWrapper.cpp @@ -11,7 +11,7 @@ QtTcpWrapper::QtTcpWrapper(QObject* parent, const std::string& ip, const quint16 { m_tcpServer = new QTcpServer(this); - connect(m_tcpServer, SIGNAL(newConnection()), this, SLOT(acceptConnection())); + connect(m_tcpServer, &QTcpServer::newConnection, this, &QtTcpWrapper::acceptConnection); } void QtTcpWrapper::startListening() @@ -96,7 +96,7 @@ void QtTcpWrapper::acceptConnection() { m_tcpClient = m_tcpServer->nextPendingConnection(); - connect(m_tcpClient, SIGNAL(readyRead()), this, SLOT(startRead())); + connect(m_tcpClient, &QTcpSocket::readyRead, this, &QtTcpWrapper::startRead); } void QtTcpWrapper::startRead() diff --git a/src/lib_gui/qt/networkPrototype/SocketTest.cpp b/src/lib_gui/qt/networkPrototype/SocketTest.cpp index c9dca9b2..e388208c 100644 --- a/src/lib_gui/qt/networkPrototype/SocketTest.cpp +++ b/src/lib_gui/qt/networkPrototype/SocketTest.cpp @@ -10,7 +10,7 @@ SocketTest::SocketTest(QObject* parent) QHostAddress address("127.0.0.1"); m_socket->bind(address, 6666); - connect(m_socket, SIGNAL(readyRead()), this, SLOT(readyRead())); + connect(m_socket, &QUdpSocket::readyRead, this, &SocketTest::readyRead); } SocketTest::~SocketTest() diff --git a/src/lib_gui/qt/utility/QtContextMenu.cpp b/src/lib_gui/qt/utility/QtContextMenu.cpp index 040debea..7a4b2777 100644 --- a/src/lib_gui/qt/utility/QtContextMenu.cpp +++ b/src/lib_gui/qt/utility/QtContextMenu.cpp @@ -67,22 +67,22 @@ QtContextMenu* QtContextMenu::getInstance() s_undoAction = new QAction(tr("Back"), s_instance); s_undoAction->setStatusTip(tr("Go back to last active symbol")); s_undoAction->setToolTip(tr("Go back to last active symbol")); - connect(s_undoAction, SIGNAL(triggered()), s_instance, SLOT(undoActionTriggered())); + connect(s_undoAction, &QAction::triggered, s_instance, &QtContextMenu::undoActionTriggered); s_redoAction = new QAction(tr("Forward"), s_instance); s_redoAction->setStatusTip(tr("Go forward to next active symbol")); s_redoAction->setToolTip(tr("Go forward to next active symbol")); - connect(s_redoAction, SIGNAL(triggered()), s_instance, SLOT(redoActionTriggered())); + connect(s_redoAction, &QAction::triggered, s_instance, &QtContextMenu::redoActionTriggered); s_copyFullPathAction = new QAction(tr("Copy Full Path"), s_instance); s_copyFullPathAction->setStatusTip(tr("Copies the path of this file to the clipboard")); s_copyFullPathAction->setToolTip(tr("Copies the path of this file to the clipboard")); - connect(s_copyFullPathAction, SIGNAL(triggered()), s_instance, SLOT(copyFullPathActionTriggered())); + connect(s_copyFullPathAction, &QAction::triggered, s_instance, &QtContextMenu::copyFullPathActionTriggered); s_openContainingFolderAction = new QAction(tr("Open Containing Folder"), s_instance); s_openContainingFolderAction->setStatusTip(tr("Opens the folder that contains this file")); s_openContainingFolderAction->setToolTip(tr("Opens the folder that contains this file")); - connect(s_openContainingFolderAction, SIGNAL(triggered()), s_instance, SLOT(openContainingFolderActionTriggered())); + connect(s_openContainingFolderAction, &QAction::triggered, s_instance, &QtContextMenu::openContainingFolderActionTriggered); } return s_instance; diff --git a/src/lib_gui/qt/utility/QtThreadedFunctor.h b/src/lib_gui/qt/utility/QtThreadedFunctor.h index f6d47c98..6a3c56a7 100644 --- a/src/lib_gui/qt/utility/QtThreadedFunctor.h +++ b/src/lib_gui/qt/utility/QtThreadedFunctor.h @@ -26,7 +26,7 @@ public: QtThreadedFunctorHelper() : m_freeCallbacks(1) { - QObject::connect(this, SIGNAL(signalExecution()), this, SLOT(execute())); + QObject::connect(this, &QtThreadedFunctorHelper::signalExecution, this, &QtThreadedFunctorHelper::execute); } void operator()(std::function callback) diff --git a/src/lib_gui/qt/view/QtBookmarkView.cpp b/src/lib_gui/qt/view/QtBookmarkView.cpp index 4d97d2f1..a9a0fae0 100644 --- a/src/lib_gui/qt/view/QtBookmarkView.cpp +++ b/src/lib_gui/qt/view/QtBookmarkView.cpp @@ -53,7 +53,7 @@ void QtBookmarkView::initView() m_createBookmarkButton->setEnabled(false); layout->addWidget(m_createBookmarkButton); - connect(m_createBookmarkButton, SIGNAL(clicked()), this, SLOT(createBookmarkClicked())); + connect(m_createBookmarkButton, &QPushButton::clicked, this, &QtBookmarkView::createBookmarkClicked); m_showBookmarksButton = new QPushButton(); m_showBookmarksButton->setObjectName("show_bookmark_button"); @@ -62,7 +62,7 @@ void QtBookmarkView::initView() m_showBookmarksButton->setEnabled(false); layout->addWidget(m_showBookmarksButton); - connect(m_showBookmarksButton, SIGNAL(clicked()), this, SLOT(showBookmarksClicked())); + connect(m_showBookmarksButton, &QPushButton::clicked, this, &QtBookmarkView::showBookmarksClicked); setStyleSheet(); refreshStyle(); diff --git a/src/lib_gui/qt/view/QtDialogView.cpp b/src/lib_gui/qt/view/QtDialogView.cpp index e0b60dbe..7fe22f3b 100644 --- a/src/lib_gui/qt/view/QtDialogView.cpp +++ b/src/lib_gui/qt/view/QtDialogView.cpp @@ -326,8 +326,7 @@ void QtDialogView::handleMessage(MessageWindowClosed* message) void QtDialogView::updateErrorCount(size_t errorCount, size_t fatalCount) { - QtIndexingDialog* window = dynamic_cast(m_windowStack.getTopWindow()); - if (window) + if (QtIndexingDialog* window = dynamic_cast(m_windowStack.getTopWindow())) { window->updateErrorCount(errorCount, fatalCount); } @@ -346,10 +345,14 @@ template window = new T(m_mainWindow); } - connect(window, SIGNAL(canceled()), &m_windowStack, SLOT(popWindow())); - connect(window, SIGNAL(finished()), &m_windowStack, SLOT(clearWindows())); + //make sure T is a QtWindow + if (dynamic_cast(window)) + { + connect(window, &QtWindow::canceled, &m_windowStack, &QtWindowStack::popWindow); + connect(window, &QtWindow::finished, &m_windowStack, &QtWindowStack::clearWindows); - m_windowStack.pushWindow(window); + m_windowStack.pushWindow(window); + } return window; } diff --git a/src/lib_gui/qt/view/QtErrorView.cpp b/src/lib_gui/qt/view/QtErrorView.cpp index 1ffa4579..66b6bd24 100644 --- a/src/lib_gui/qt/view/QtErrorView.cpp +++ b/src/lib_gui/qt/view/QtErrorView.cpp @@ -207,6 +207,11 @@ void QtErrorView::resetErrorLimit() errorFilterChanged(0, false); } +void QtErrorView::errorFilterChanged(int i) +{ + errorFilterChanged(i, true); +} + void QtErrorView::errorFilterChanged(int i, bool showErrors) { m_table->selectionModel()->clearSelection(); @@ -315,7 +320,7 @@ QCheckBox* QtErrorView::createFilterCheckbox(const QString& name, bool checked, QCheckBox* checkbox = new QCheckBox(name); checkbox->setChecked(checked); - connect(checkbox, SIGNAL(stateChanged(int)), this, SLOT(errorFilterChanged(int))); + connect(checkbox, &QCheckBox::stateChanged, this, static_cast(&QtErrorView::errorFilterChanged)); layout->addWidget(checkbox); layout->addSpacing(25); diff --git a/src/lib_gui/qt/view/QtErrorView.h b/src/lib_gui/qt/view/QtErrorView.h index 0709ce07..d736e666 100644 --- a/src/lib_gui/qt/view/QtErrorView.h +++ b/src/lib_gui/qt/view/QtErrorView.h @@ -38,7 +38,8 @@ public: virtual void resetErrorLimit(); private slots: - void errorFilterChanged(int i = 0, bool showErrors = true); + void errorFilterChanged(int i = 0); + void errorFilterChanged(int i, bool showErrors); private: enum COLUMN { diff --git a/src/lib_gui/qt/view/QtGraphView.cpp b/src/lib_gui/qt/view/QtGraphView.cpp index 0c59f001..5130872d 100644 --- a/src/lib_gui/qt/view/QtGraphView.cpp +++ b/src/lib_gui/qt/view/QtGraphView.cpp @@ -80,15 +80,15 @@ void QtGraphView::initView() widget->layout()->addWidget(view); - connect(view, SIGNAL(emptySpaceClicked()), this, SLOT(clickedInEmptySpace())); - connect(view, SIGNAL(characterKeyPressed(QChar)), this, SLOT(pressedCharacterKey(QChar))); - connect(view, SIGNAL(resized()), this, SLOT(resized())); + connect(view, &QtGraphicsView::emptySpaceClicked, this, &QtGraphView::clickedInEmptySpace); + connect(view, &QtGraphicsView::characterKeyPressed, this, &QtGraphView::pressedCharacterKey); + connect(view, &QtGraphicsView::resized, this, &QtGraphView::resized); m_scrollSpeedChangeListenerHorizontal.setScrollBar(view->horizontalScrollBar()); m_scrollSpeedChangeListenerVertical.setScrollBar(view->verticalScrollBar()); - connect(view->horizontalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(scrolled(int))); - connect(view->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(scrolled(int))); + connect(view->horizontalScrollBar(), &QScrollBar::valueChanged, this, &QtGraphView::scrolled); + connect(view->verticalScrollBar(), &QScrollBar::valueChanged, this, &QtGraphView::scrolled); // trail controls { @@ -99,7 +99,7 @@ void QtGraphView::initView() m_expandButton->setObjectName("expand_button"); m_expandButton->setToolTip("show depth graph controls"); m_expandButton->setGeometry(0, 0, 26, 26); - connect(m_expandButton, SIGNAL(clicked()), this, SLOT(clickedExpand())); + connect(m_expandButton, &QPushButton::clicked, this, &QtGraphView::clickedExpand); stack->addWidget(m_expandButton); } @@ -111,15 +111,15 @@ void QtGraphView::initView() m_collapseButton = new QPushButton(ui); m_collapseButton->setObjectName("collapse_button"); m_collapseButton->setToolTip("hide depth graph controls"); - connect(m_collapseButton, SIGNAL(clicked()), this, SLOT(clickedCollapse())); + connect(m_collapseButton, &QPushButton::clicked, this, &QtGraphView::clickedCollapse); m_forwardTrailButton = new QPushButton(ui); m_forwardTrailButton->setObjectName("trail_button"); - connect(m_forwardTrailButton, SIGNAL(clicked()), this, SLOT(clickedForwardTrail())); + connect(m_forwardTrailButton, &QPushButton::clicked, this, &QtGraphView::clickedForwardTrail); m_backwardTrailButton = new QPushButton(ui); m_backwardTrailButton->setObjectName("trail_button"); - connect(m_backwardTrailButton, SIGNAL(clicked()), this, SLOT(clickedBackwardTrail())); + connect(m_backwardTrailButton, &QPushButton::clicked, this, &QtGraphView::clickedBackwardTrail); m_trailDepthLabel = new QLabel(ui); m_trailDepthLabel->setObjectName("depth_label"); @@ -132,7 +132,7 @@ void QtGraphView::initView() m_trailDepthSlider->setMinimum(1); m_trailDepthSlider->setMaximum(26); m_trailDepthSlider->setValue(5); - connect(m_trailDepthSlider, SIGNAL(valueChanged(int)), this, SLOT(trailDepthChanged(int))); + connect(m_trailDepthSlider, &QSlider::valueChanged, this, &QtGraphView::trailDepthChanged); m_collapseButton->setGeometry(0, 0, 26, 20); m_backwardTrailButton->setGeometry(0, 22, 26, 26); @@ -1054,8 +1054,8 @@ void QtGraphView::createTransition() remain->addAnimation(anim); - connect(anim, SIGNAL(finished()), newNode, SLOT(showNode())); - connect(anim, SIGNAL(finished()), oldNode, SLOT(hideNode())); + connect(anim, &QPropertyAnimation::finished, newNode, &QtGraphNode::showNode); + connect(anim, &QPropertyAnimation::finished, oldNode, &QtGraphNode::hideNode); newNode->hide(); anim = new QPropertyAnimation(oldNode, "size"); @@ -1079,7 +1079,7 @@ void QtGraphView::createTransition() if (!remainingNodes.size() || m_scrollToTop || m_restoreScroll) { - connect(anim, SIGNAL(finished()), this, SLOT(updateScrollBars())); + connect(anim, &QPropertyAnimation::finished, this, &QtGraphView::updateScrollBars); } remain->addAnimation(anim); @@ -1101,7 +1101,7 @@ void QtGraphView::createTransition() appear->addAnimation(anim); - connect(anim, SIGNAL(finished()), node, SLOT(blendIn())); + connect(anim, &QPropertyAnimation::finished, node, &QtGraphNode::blendIn); node->blendOut(); } @@ -1120,7 +1120,7 @@ void QtGraphView::createTransition() m_transition->addAnimation(appear); } - connect(m_transition.get(), SIGNAL(finished()), this, SLOT(finishedTransition())); + connect(m_transition.get(), &QPropertyAnimation::finished, this, &QtGraphView::finishedTransition); m_transition->start(); } diff --git a/src/lib_gui/qt/window/QtBookmarkBrowser.cpp b/src/lib_gui/qt/window/QtBookmarkBrowser.cpp index ff8fe8fb..0b07bff2 100644 --- a/src/lib_gui/qt/window/QtBookmarkBrowser.cpp +++ b/src/lib_gui/qt/window/QtBookmarkBrowser.cpp @@ -65,7 +65,7 @@ void QtBookmarkBrowser::setupBookmarkBrowser() m_filterComboBox->setObjectName("filter_box"); headerLayout->addWidget(m_filterComboBox); - connect(m_filterComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(filterOrOrderChanged(const QString&))); + connect(m_filterComboBox, qOverload(&QComboBox::currentIndexChanged), this, &QtBookmarkBrowser::filterOrOrderChanged); headerLayout->addSpacing(40); @@ -87,7 +87,7 @@ void QtBookmarkBrowser::setupBookmarkBrowser() m_orderComboBox->setObjectName("order_box"); headerLayout->addWidget(m_orderComboBox); - connect(m_orderComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(filterOrOrderChanged(const QString&))); + connect(m_orderComboBox, qOverload(&QComboBox::currentIndexChanged), this, &QtBookmarkBrowser::filterOrOrderChanged); } { @@ -105,7 +105,7 @@ void QtBookmarkBrowser::setupBookmarkBrowser() m_bookmarkTree->setIndentation(0); m_bookmarkTree->setHeaderLabel("Bookmarks"); - connect(m_bookmarkTree, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(treeItemClicked(QTreeWidgetItem*, int))); + connect(m_bookmarkTree, &QTreeWidget::itemClicked, this, &QtBookmarkBrowser::treeItemClicked); bodyLayout->addWidget(m_bookmarkTree); diff --git a/src/lib_gui/qt/window/QtBookmarkCreator.cpp b/src/lib_gui/qt/window/QtBookmarkCreator.cpp index 08ddb791..90ccae38 100644 --- a/src/lib_gui/qt/window/QtBookmarkCreator.cpp +++ b/src/lib_gui/qt/window/QtBookmarkCreator.cpp @@ -53,7 +53,7 @@ void QtBookmarkCreator::setupBookmarkCreator() m_displayName->setAttribute(Qt::WA_MacShowFocusRect, 0); layout->addWidget(m_displayName); - connect(m_displayName, SIGNAL(textChanged(const QString&)), this, SLOT(onNameChanged(const QString&))); + connect(m_displayName, &QLineEdit::textChanged, this, &QtBookmarkCreator::onNameChanged); layout->addSpacing(15); } @@ -86,7 +86,7 @@ void QtBookmarkCreator::setupBookmarkCreator() m_categoryBox->setInsertPolicy(QComboBox::InsertPolicy::InsertAtTop); layout->addWidget(m_categoryBox); - connect(m_categoryBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onComboBoxIndexChanged(int))); + connect(m_categoryBox, static_cast(&QComboBox::currentIndexChanged), this, &QtBookmarkCreator::onComboBoxIndexChanged); m_categoryCount = m_categoryBox->count(); diff --git a/src/lib_gui/qt/window/QtIndexingDialog.cpp b/src/lib_gui/qt/window/QtIndexingDialog.cpp index 5dbdb3a9..0af6244b 100644 --- a/src/lib_gui/qt/window/QtIndexingDialog.cpp +++ b/src/lib_gui/qt/window/QtIndexingDialog.cpp @@ -65,7 +65,7 @@ void QtIndexingDialog::setupStart( m_fullRefreshCheckBox = new QCheckBox("full refresh", this); m_fullRefreshCheckBox->setObjectName("message"); - connect(m_fullRefreshCheckBox, static_cast(&QCheckBox::toggled), + connect(m_fullRefreshCheckBox, &QCheckBox::toggled, [=](bool checked = false) { clearLabel->setVisible(!checked); @@ -434,11 +434,11 @@ void QtIndexingDialog::addButtons(QBoxLayout* layout) { m_nextButton = new QPushButton("Next"); m_nextButton->setObjectName("windowButton"); - connect(m_nextButton, SIGNAL(clicked()), this, SLOT(handleNextPress())); + connect(m_nextButton, &QPushButton::clicked, this, &QtIndexingDialog::handleNextPress); m_closeButton = new QPushButton("Cancel"); m_closeButton->setObjectName("windowButton"); - connect(m_closeButton, SIGNAL(clicked()), this, SLOT(handleClosePress())); + connect(m_closeButton, &QPushButton::clicked, this, &QtIndexingDialog::handleClosePress); QHBoxLayout* buttons = new QHBoxLayout(); buttons->addWidget(m_closeButton); diff --git a/src/lib_gui/qt/window/QtMainWindow.cpp b/src/lib_gui/qt/window/QtMainWindow.cpp index eb277e65..51f9948e 100644 --- a/src/lib_gui/qt/window/QtMainWindow.cpp +++ b/src/lib_gui/qt/window/QtMainWindow.cpp @@ -161,11 +161,11 @@ void QtMainWindow::addView(View* view) addDockWidget(Qt::TopDockWidgetArea, dock); QtViewToggle* toggle = new QtViewToggle(view, this); - connect(dock, SIGNAL(visibilityChanged(bool)), toggle, SLOT(toggledByUI())); + connect(dock, &QDockWidget::visibilityChanged, toggle, &QtViewToggle::toggledByUI); QAction* action = new QAction(tr((view->getName() + " Window").c_str()), this); action->setCheckable(true); - connect(action, SIGNAL(triggered()), toggle, SLOT(toggledByAction())); + connect(action, &QAction::triggered, toggle, &QtViewToggle::toggledByAction); m_viewMenu->insertAction(m_viewSeparator, action); DockWidget dockWidget; @@ -439,12 +439,12 @@ void QtMainWindow::showEula(bool forceAccept) setEnabled(false); window->setEnabled(true); - connect(window, SIGNAL(finished()), this, SLOT(acceptedEula())); - connect(window, SIGNAL(canceled()), dynamic_cast(QCoreApplication::instance()), SLOT(quit())); + connect(window, &QtEulaWindow::finished, this, &QtMainWindow::acceptedEula); + connect(window, &QtEulaWindow::canceled, dynamic_cast(QCoreApplication::instance()), &QApplication::quit); } else { - connect(window, SIGNAL(canceled()), &m_windowStack, SLOT(popWindow())); + connect(window, &QtEulaWindow::canceled, &m_windowStack, &QtWindowStack::popWindow); } } @@ -468,8 +468,8 @@ void QtMainWindow::enterLicense() QtLicense* enterLicenseWindow = createWindow(); enterLicenseWindow->setup(); - disconnect(enterLicenseWindow, SIGNAL(finished()), &m_windowStack, SLOT(clearWindows())); - connect(enterLicenseWindow, SIGNAL(finished()), this, SLOT(enteredLicense())); + disconnect(enterLicenseWindow, &QtLicense::finished, &m_windowStack, &QtWindowStack::clearWindows); + connect(enterLicenseWindow, &QtLicense::finished, this, &QtMainWindow::enteredLicense); enterLicenseWindow->load(); } @@ -513,9 +513,9 @@ void QtMainWindow::showStartScreen() QtStartScreen* startScreen = createWindow(); startScreen->setupStartScreen(); - connect(startScreen, SIGNAL(openOpenProjectDialog()), this, SLOT(openProject())); - connect(startScreen, SIGNAL(openNewProjectDialog()), this, SLOT(newProject())); - connect(startScreen, SIGNAL(openEnterLicenseDialog()), this, SLOT(enterLicense())); + connect(startScreen, &QtStartScreen::openOpenProjectDialog, this, &QtMainWindow::openProject); + connect(startScreen, &QtStartScreen::openNewProjectDialog, this, &QtMainWindow::newProject); + connect(startScreen, &QtStartScreen::openEnterLicenseDialog, this, &QtMainWindow::enterLicense); } void QtMainWindow::hideStartScreen() @@ -732,8 +732,8 @@ void QtMainWindow::setupProjectMenu() QMenu *menu = new QMenu(tr("&Project"), this); menuBar()->addMenu(menu); - m_trialDisabledActions.push_back(menu->addAction(tr("&New Project..."), this, SLOT(newProject()), QKeySequence::New)); - menu->addAction(tr("&Open Project..."), this, SLOT(openProject()), QKeySequence::Open); + m_trialDisabledActions.push_back(menu->addAction(tr("&New Project..."), this, &QtMainWindow::newProject, QKeySequence::New)); + menu->addAction(tr("&Open Project..."), this, &QtMainWindow::openProject, QKeySequence::Open); QMenu *recentProjectMenu = new QMenu(tr("Recent Projects")); menu->addMenu(recentProjectMenu); @@ -742,8 +742,8 @@ void QtMainWindow::setupProjectMenu() { m_recentProjectAction[i] = new QAction(this); m_recentProjectAction[i]->setVisible(false); - connect(m_recentProjectAction[i], SIGNAL(triggered()), - this, SLOT(openRecentProject())); + connect(m_recentProjectAction[i], &QAction::triggered, + this, &QtMainWindow::openRecentProject); recentProjectMenu->addAction(m_recentProjectAction[i]); } updateRecentProjectMenu(); @@ -752,10 +752,10 @@ void QtMainWindow::setupProjectMenu() menu->addSeparator(); - m_trialDisabledActions.push_back(menu->addAction(tr("&Edit Project..."), this, SLOT(editProject()))); + m_trialDisabledActions.push_back(menu->addAction(tr("&Edit Project..."), this, &QtMainWindow::editProject)); m_trialDisabledActions.push_back(menu->addSeparator()); - menu->addAction(tr("E&xit"), QCoreApplication::instance(), SLOT(quit()), QKeySequence::Quit); + menu->addAction(tr("E&xit"), QCoreApplication::instance(), &QCoreApplication::quit, QKeySequence::Quit); } void QtMainWindow::setupEditMenu() @@ -763,11 +763,11 @@ void QtMainWindow::setupEditMenu() QMenu *menu = new QMenu(tr("&Edit"), this); menuBar()->addMenu(menu); - m_trialDisabledActions.push_back(menu->addAction(tr("&Refresh"), this, SLOT(refresh()), QKeySequence::Refresh)); + m_trialDisabledActions.push_back(menu->addAction(tr("&Refresh"), this, &QtMainWindow::refresh, QKeySequence::Refresh)); if (QSysInfo::windowsVersion() != QSysInfo::WV_None) { m_trialDisabledActions.push_back( - menu->addAction(tr("&Full Refresh"), this, SLOT(forceRefresh()), QKeySequence(Qt::SHIFT + Qt::Key_F5)) + menu->addAction(tr("&Full Refresh"), this, &QtMainWindow::forceRefresh, QKeySequence(Qt::SHIFT + Qt::Key_F5)) ); } else @@ -775,28 +775,28 @@ void QtMainWindow::setupEditMenu() m_trialDisabledActions.push_back(menu->addAction( tr("&Full Refresh"), this, - SLOT(forceRefresh()), + &QtMainWindow::forceRefresh, QKeySequence(Qt::SHIFT + Qt::CTRL + Qt::Key_R) )); } menu->addSeparator(); - menu->addAction(tr("&Find Symbol"), this, SLOT(find()), QKeySequence::Find); - menu->addAction(tr("&Find Text"), this, SLOT(findFulltext()), QKeySequence(Qt::SHIFT + Qt::CTRL + Qt::Key_F)); + menu->addAction(tr("&Find Symbol"), this, &QtMainWindow::find, QKeySequence::Find); + menu->addAction(tr("&Find Text"), this, &QtMainWindow::findFulltext, QKeySequence(Qt::SHIFT + Qt::CTRL + Qt::Key_F)); menu->addSeparator(); - menu->addAction(tr("Code Reference Next"), this, SLOT(codeReferenceNext()), QKeySequence(Qt::CTRL + Qt::Key_G)); - menu->addAction(tr("Code Reference Previous"), this, SLOT(codeReferencePrevious()), QKeySequence(Qt::SHIFT + Qt::CTRL + Qt::Key_G)); + menu->addAction(tr("Code Reference Next"), this, &QtMainWindow::codeReferenceNext, QKeySequence(Qt::CTRL + Qt::Key_G)); + menu->addAction(tr("Code Reference Previous"), this, &QtMainWindow::codeReferencePrevious, QKeySequence(Qt::SHIFT + Qt::CTRL + Qt::Key_G)); menu->addSeparator(); - menu->addAction(tr("&To overview"), this, SLOT(overview()), QKeySequence::MoveToStartOfDocument); + menu->addAction(tr("&To overview"), this, &QtMainWindow::overview, QKeySequence::MoveToStartOfDocument); menu->addSeparator(); - menu->addAction(tr("Preferences..."), this, SLOT(openSettings()), QKeySequence(Qt::CTRL + Qt::Key_Comma)); + menu->addAction(tr("Preferences..."), this, &QtMainWindow::openSettings, QKeySequence(Qt::CTRL + Qt::Key_Comma)); } void QtMainWindow::setupViewMenu() @@ -804,22 +804,22 @@ void QtMainWindow::setupViewMenu() QMenu *menu = new QMenu(tr("&View"), this); menuBar()->addMenu(menu); - menu->addAction(tr("Show Start Window"), this, SLOT(showStartScreen())); + menu->addAction(tr("Show Start Window"), this, &QtMainWindow::showStartScreen); m_showTitleBarsAction = new QAction("Show Title Bars", this); m_showTitleBarsAction->setCheckable(true); m_showTitleBarsAction->setChecked(m_showDockWidgetTitleBars); - connect(m_showTitleBarsAction, SIGNAL(triggered()), this, SLOT(toggleShowDockWidgetTitleBars())); + connect(m_showTitleBarsAction, &QAction::triggered, this, &QtMainWindow::toggleShowDockWidgetTitleBars); menu->addAction(m_showTitleBarsAction); menu->addSeparator(); m_viewSeparator = menu->addSeparator(); - menu->addAction(tr("Larger font"), this, SLOT(zoomIn()), QKeySequence::ZoomIn); - menu->addAction(tr("Smaller font"), this, SLOT(zoomOut()), QKeySequence::ZoomOut); - menu->addAction(tr("Reset font size"), this, SLOT(resetZoom()), QKeySequence(Qt::CTRL + Qt::Key_0)); - menu->addAction(tr("Reset window layout"), this, SLOT(resetWindowLayout())); + menu->addAction(tr("Larger font"), this, &QtMainWindow::zoomIn, QKeySequence::ZoomIn); + menu->addAction(tr("Smaller font"), this, &QtMainWindow::zoomOut, QKeySequence::ZoomOut); + menu->addAction(tr("Reset font size"), this, &QtMainWindow::resetZoom, QKeySequence(Qt::CTRL + Qt::Key_0)); + menu->addAction(tr("Reset window layout"), this, &QtMainWindow::resetWindowLayout); m_viewMenu = menu; } @@ -836,8 +836,8 @@ void QtMainWindow::setupHistoryMenu() m_historyMenu->clear(); } - m_historyMenu->addAction(tr("Back"), this, SLOT(undo()), QKeySequence::Undo); - m_historyMenu->addAction(tr("Forward"), this, SLOT(redo()), QKeySequence::Redo); + m_historyMenu->addAction(tr("Back"), this, &QtMainWindow::undo, QKeySequence::Undo); + m_historyMenu->addAction(tr("Forward"), this, &QtMainWindow::redo, QKeySequence::Redo); m_historyMenu->addSeparator(); @@ -854,7 +854,7 @@ void QtMainWindow::setupHistoryMenu() action->setText(name.c_str()); action->setData(QVariant(int(i))); - connect(action, SIGNAL(triggered()), this, SLOT(openHistoryAction())); + connect(action, &QAction::triggered, this, &QtMainWindow::openHistoryAction); m_historyMenu->addAction(action); } } @@ -871,8 +871,8 @@ void QtMainWindow::setupBookmarksMenu() m_bookmarksMenu->clear(); } - m_bookmarksMenu->addAction(tr("Bookmark Active Symbol..."), this, SLOT(showBookmarkCreator()), QKeySequence(Qt::CTRL + Qt::Key_D)); - m_bookmarksMenu->addAction(tr("Bookmark Manager"), this, SLOT(showBookmarkBrowser()), QKeySequence(Qt::CTRL + Qt::Key_B)); + m_bookmarksMenu->addAction(tr("Bookmark Active Symbol..."), this, &QtMainWindow::showBookmarkCreator, QKeySequence(Qt::CTRL + Qt::Key_D)); + m_bookmarksMenu->addAction(tr("Bookmark Manager"), this, &QtMainWindow::showBookmarkBrowser, QKeySequence(Qt::CTRL + Qt::Key_B)); m_bookmarksMenu->addSeparator(); @@ -889,7 +889,7 @@ void QtMainWindow::setupBookmarksMenu() action->setText(name.c_str()); action->setData(QVariant(int(i))); - connect(action, SIGNAL(triggered()), this, SLOT(activateBookmarkAction())); + connect(action, &QAction::triggered, this, &QtMainWindow::activateBookmarkAction); m_bookmarksMenu->addAction(action); } } @@ -899,21 +899,21 @@ void QtMainWindow::setupHelpMenu() QMenu *menu = new QMenu(tr("&Help"), this); menuBar()->addMenu(menu); - menu->addAction(tr("Keyboard Shortcuts"), this, SLOT(showKeyboardShortcuts())); - menu->addAction(tr("Documentation"), this, SLOT(showDocumentation())); - menu->addAction(tr("Bug Tracker"), this, SLOT(showBugtracker())); - menu->addAction(tr("Enter License..."), this, SLOT(enterLicense())); + menu->addAction(tr("Keyboard Shortcuts"), this, &QtMainWindow::showKeyboardShortcuts); + menu->addAction(tr("Documentation"), this, &QtMainWindow::showDocumentation); + menu->addAction(tr("Bug Tracker"), this, &QtMainWindow::showBugtracker); + menu->addAction(tr("Enter License..."), this, &QtMainWindow::enterLicense); menu->addSeparator(); - menu->addAction(tr("End User License Agreement"), this, SLOT(showEula())); - menu->addAction(tr("3rd Party Licences"), this, SLOT(showLicenses())); - menu->addAction(tr("&About Sourcetrail"), this, SLOT(about())); + menu->addAction(tr("End User License Agreement"), this, &QtMainWindow::showEula); + menu->addAction(tr("3rd Party Licences"), this, &QtMainWindow::showLicenses); + menu->addAction(tr("&About Sourcetrail"), this, &QtMainWindow::about); menu->addSeparator(); - menu->addAction(tr("Show Data Folder"), this, SLOT(showDataFolder())); - menu->addAction(tr("Show Log Folder"), this, SLOT(showLogFolder())); + menu->addAction(tr("Show Data Folder"), this, &QtMainWindow::showDataFolder); + menu->addAction(tr("Show Log Folder"), this, &QtMainWindow::showLogFolder); } void QtMainWindow::setTrialActionsEnabled(bool enabled) @@ -991,8 +991,8 @@ template { T* window = new T(this); - connect(window, SIGNAL(canceled()), &m_windowStack, SLOT(popWindow())); - connect(window, SIGNAL(finished()), &m_windowStack, SLOT(clearWindows())); + connect(window, &QtWindow::canceled, &m_windowStack, &QtWindowStack::popWindow); + connect(window, &QtWindow::finished, &m_windowStack, &QtWindowStack::clearWindows); m_windowStack.pushWindow(window); diff --git a/src/lib_gui/qt/window/QtSplashScreen.cpp b/src/lib_gui/qt/window/QtSplashScreen.cpp index 4ac44205..a439efb5 100644 --- a/src/lib_gui/qt/window/QtSplashScreen.cpp +++ b/src/lib_gui/qt/window/QtSplashScreen.cpp @@ -42,7 +42,7 @@ void QtSplashScreen::exec(QApplication& app) { m_state = 0; QTimer* timer = new QTimer(this); - QObject::connect(timer, SIGNAL(timeout()), this, SLOT(animate())); + QObject::connect(timer, &QTimer::timeout, this, &QtSplashScreen::animate); timer->start(150); app.processEvents(); @@ -51,13 +51,6 @@ void QtSplashScreen::exec(QApplication& app) repaint(); app.processEvents(); - - // Eventloop for the SplashScreen - // QEventLoop loop; - // InitThread* initThread = new InitThread(); - // QObject::connect(initThread, SIGNAL(finished()), &loop, SLOT(quit())); - // initThread->start(); - // loop.exec(); } void QtSplashScreen::setMessage(const QString &str) diff --git a/src/lib_gui/qt/window/QtStartScreen.cpp b/src/lib_gui/qt/window/QtStartScreen.cpp index c47669de..efaa4a59 100644 --- a/src/lib_gui/qt/window/QtStartScreen.cpp +++ b/src/lib_gui/qt/window/QtStartScreen.cpp @@ -118,15 +118,15 @@ size_t i = 0; break; } button->setFixedWidth(button->fontMetrics().width(button->text()) + 45); - connect(button, SIGNAL(clicked()), button, SLOT(handleButtonClick())); + connect(button, &QtRecentProjectButton::clicked, button, &QtRecentProjectButton::handleButtonClick); if (button->projectExists()) { button->setObjectName("recentButton"); - connect(button, SIGNAL(clicked()), this, SLOT(handleRecentButton())); + connect(button, &QtRecentProjectButton::clicked, this, &QtStartScreen::handleRecentButton); } else { - connect(button, SIGNAL(updateButtons()), this, SLOT(updateButtons())); + connect(button, &QtRecentProjectButton::updateButtons, this, &QtStartScreen::updateButtons); button->setObjectName("recentButtonMissing"); } } @@ -181,7 +181,7 @@ void QtStartScreen::setupStartScreen() openProjectButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac openProjectButton->setObjectName("projectButton"); openProjectButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - connect(openProjectButton, SIGNAL(clicked()), this, SLOT(handleOpenProjectButton())); + connect(openProjectButton, &QPushButton::clicked, this, &QtStartScreen::handleOpenProjectButton); col->addWidget(openProjectButton); col->addSpacing(8); @@ -190,7 +190,7 @@ void QtStartScreen::setupStartScreen() unlockButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac unlockButton->setObjectName("projectButton"); unlockButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - connect(unlockButton, SIGNAL(clicked()), this, SLOT(handleUnlockButton())); + connect(unlockButton, &QPushButton::clicked, this, &QtStartScreen::handleUnlockButton); QHBoxLayout* row = new QHBoxLayout(); row->addWidget(unlockButton); @@ -229,7 +229,7 @@ void QtStartScreen::setupStartScreen() newProjectButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac newProjectButton->setObjectName("projectButton"); newProjectButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - connect(newProjectButton, SIGNAL(clicked()), this, SLOT(handleNewProjectButton())); + connect(newProjectButton, &QPushButton::clicked, this, &QtStartScreen::handleNewProjectButton); col->addWidget(newProjectButton); col->addSpacing(8); @@ -238,7 +238,7 @@ void QtStartScreen::setupStartScreen() openProjectButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac openProjectButton->setObjectName("projectButton"); openProjectButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - connect(openProjectButton, SIGNAL(clicked()), this, SLOT(handleOpenProjectButton())); + connect(openProjectButton, &QPushButton::clicked, this, &QtStartScreen::handleOpenProjectButton); col->addWidget(openProjectButton); layout->addStretch(2); diff --git a/src/lib_gui/qt/window/QtWindow.cpp b/src/lib_gui/qt/window/QtWindow.cpp index d016ef74..599a478a 100644 --- a/src/lib_gui/qt/window/QtWindow.cpp +++ b/src/lib_gui/qt/window/QtWindow.cpp @@ -517,15 +517,15 @@ QHBoxLayout* QtWindow::createButtons() { m_nextButton = new QPushButton("Next"); m_nextButton->setObjectName("windowButton"); - connect(m_nextButton, SIGNAL(clicked()), this, SLOT(handleNextPress())); + connect(m_nextButton, &QPushButton::clicked, this, &QtWindow::handleNextPress); m_previousButton = new QPushButton("Previous"); m_previousButton->setObjectName("windowButton"); - connect(m_previousButton, SIGNAL(clicked()), this, SLOT(handlePreviousPress())); + connect(m_previousButton, &QPushButton::clicked, this, &QtWindow::handlePreviousPress); m_closeButton = new QPushButton("Cancel"); m_closeButton->setObjectName("windowButton"); - connect(m_closeButton, SIGNAL(clicked()), this, SLOT(handleClosePress())); + connect(m_closeButton, &QPushButton::clicked, this, &QtWindow::handleClosePress); QHBoxLayout* buttons = new QHBoxLayout(); buttons->addWidget(m_closeButton); @@ -536,7 +536,7 @@ QHBoxLayout* QtWindow::createButtons() return buttons; } -void QtWindow::handleNextPress() +void QtWindow::handleNextPress(bool) { handleNext(); } diff --git a/src/lib_gui/qt/window/QtWindow.h b/src/lib_gui/qt/window/QtWindow.h index c2ff0c2c..4f9a2d82 100644 --- a/src/lib_gui/qt/window/QtWindow.h +++ b/src/lib_gui/qt/window/QtWindow.h @@ -96,8 +96,8 @@ protected: QPushButton* m_previousButton; QPushButton* m_closeButton; -private slots: - void handleNextPress(); +public slots: + void handleNextPress(bool); void handlePreviousPress(); void handleClosePress(); diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp index 5615f5aa..08c5e5b8 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp @@ -39,9 +39,9 @@ QtProjectWizzard::QtProjectWizzard(QWidget* parent) { setScrollAble(true); - connect(&m_windowStack, SIGNAL(push()), this, SLOT(windowStackChanged())); - connect(&m_windowStack, SIGNAL(pop()), this, SLOT(windowStackChanged())); - connect(&m_windowStack, SIGNAL(empty()), this, SLOT(windowStackChanged())); + connect(&m_windowStack, &QtWindowStack::push, this, &QtProjectWizzard::windowStackChanged); + connect(&m_windowStack, &QtWindowStack::pop, this, &QtProjectWizzard::windowStackChanged); + connect(&m_windowStack, &QtWindowStack::empty, this, &QtProjectWizzard::windowStackChanged); // save old application settings so they can be compared later ApplicationSettings* appSettings = ApplicationSettings::getInstance().get(); @@ -131,7 +131,7 @@ void QtProjectWizzard::populateWindow(QWidget* widget) m_generalButton = new QPushButton("General"); m_generalButton->setObjectName("general_button"); m_generalButton->setCheckable(true); - connect(m_generalButton, SIGNAL(clicked()), this, SLOT(generalButtonClicked())); + connect(m_generalButton, &QPushButton::clicked, this, &QtProjectWizzard::generalButtonClicked); menuLayout->addWidget(m_generalButton); QLabel* sourceGroupLabel = new QLabel("Source Groups:"); @@ -139,7 +139,7 @@ void QtProjectWizzard::populateWindow(QWidget* widget) m_sourceGroupList = new QListWidget(); m_sourceGroupList->setAttribute(Qt::WA_MacShowFocusRect, 0); - connect(m_sourceGroupList, SIGNAL(currentRowChanged(int)), this, SLOT(selectedSourceGroupChanged(int))); + connect(m_sourceGroupList, &QListWidget::currentRowChanged, this, &QtProjectWizzard::selectedSourceGroupChanged); menuLayout->addWidget(m_sourceGroupList); QHBoxLayout* buttonsLayout = new QHBoxLayout(); @@ -173,9 +173,9 @@ void QtProjectWizzard::populateWindow(QWidget* widget) m_removeButton->setEnabled(false); m_duplicateButton->setEnabled(false); - connect(addButton, SIGNAL(clicked()), this, SLOT(newSourceGroup())); - connect(m_removeButton, SIGNAL(clicked()), this, SLOT(removeSelectedSourceGroup())); - connect(m_duplicateButton, SIGNAL(clicked()), this, SLOT(duplicateSelectedSourceGroup())); + connect(addButton, &QPushButton::clicked, this, &QtProjectWizzard::newSourceGroup); + connect(m_removeButton, &QPushButton::clicked, this, &QtProjectWizzard::removeSelectedSourceGroup); + connect(m_duplicateButton, &QPushButton::clicked, this, &QtProjectWizzard::duplicateSelectedSourceGroup); buttonsLayout->addWidget(addButton); buttonsLayout->addWidget(m_removeButton); @@ -226,8 +226,8 @@ void QtProjectWizzard::windowReady() updateSubTitle("Overview"); updatePreviousButton("Add Source Group"); - connect(this, SIGNAL(previous()), this, SLOT(newSourceGroup())); - connect(this, SIGNAL(next()), this, SLOT(createProject())); + connect(this, &QtProjectWizzard::previous, this, &QtProjectWizzard::newSourceGroup); + connect(this, &QtProjectWizzard::next, this, &QtProjectWizzard::createProject); updateSourceGroupList(); @@ -279,8 +279,8 @@ QtProjectWizzardWindow* QtProjectWizzard::createWindowWithContent( ){ QtProjectWizzardWindow* window = new QtProjectWizzardWindow(parentWidget()); - connect(window, SIGNAL(previous()), &m_windowStack, SLOT(popWindow())); - connect(window, SIGNAL(canceled()), this, SLOT(cancelSourceGroup())); + connect(window, &QtProjectWizzardWindow::previous, &m_windowStack, &QtWindowStack::popWindow); + connect(window, &QtProjectWizzardWindow::canceled, this, &QtProjectWizzard::cancelSourceGroup); window->setPreferredSize(QSize(580, 340)); window->setContent(func(window)); @@ -297,8 +297,8 @@ QtProjectWizzardWindow* QtProjectWizzard::createWindowWithSummary( ){ QtProjectWizzardWindow* window = new QtProjectWizzardWindow(parentWidget()); - connect(window, SIGNAL(previous()), &m_windowStack, SLOT(popWindow())); - connect(window, SIGNAL(canceled()), this, SLOT(cancelSourceGroup())); + connect(window, &QtProjectWizzardWindow::previous, &m_windowStack, &QtWindowStack::popWindow); + connect(window, &QtProjectWizzardWindow::canceled, this, &QtProjectWizzard::cancelSourceGroup); QtProjectWizzardContentSummary* summary = new QtProjectWizzardContentSummary(window); @@ -382,7 +382,7 @@ void QtProjectWizzard::selectedSourceGroupChanged(int index) summary->setIsForm(true); QtProjectWizzardContentSourceGroupData* content = new QtProjectWizzardContentSourceGroupData(group, this); - connect(content, SIGNAL(nameUpdated(QString)), this, SLOT(selectedSourceGroupNameChanged(QString))); + connect(content, &QtProjectWizzardContentSourceGroupData::nameUpdated, this, &QtProjectWizzard::selectedSourceGroupNameChanged); summary->addContent(content); summary->addSpace(); @@ -592,8 +592,8 @@ void QtProjectWizzard::newSourceGroup() ); connect(dynamic_cast(window->content()), - SIGNAL(selected(SourceGroupType)), - this, SLOT(selectedProjectType(SourceGroupType))); + &QtProjectWizzardContentSelect::selected, + this, &QtProjectWizzard::selectedProjectType); window->show(); window->setNextEnabled(false); @@ -654,11 +654,11 @@ void QtProjectWizzard::emptySourceGroup() if (m_newSourceGroupSettings->getType() == SOURCE_GROUP_JAVA_EMPTY) { - connect(window, SIGNAL(next()), this, SLOT(sourcePathsJava())); + connect(window, &QtProjectWizzardWindow::next, this, &QtProjectWizzard::sourcePathsJava); } else { - connect(window, SIGNAL(next()), this, SLOT(sourcePaths())); + connect(window, &QtProjectWizzardWindow::next, this, &QtProjectWizzard::sourcePaths); } window->updateSubTitle("Standard"); @@ -678,7 +678,7 @@ void QtProjectWizzard::emptySourceGroupCDBVS() } ); - connect(window, SIGNAL(next()), this, SLOT(advancedSettingsCxx())); + connect(window, &QtProjectWizzardWindow::next, this, &QtProjectWizzard::advancedSettingsCxx); window->updateSubTitle("VS Solution"); } @@ -695,7 +695,7 @@ void QtProjectWizzard::emptySourceGroupCDB() } ); - connect(window, SIGNAL(next()), this, SLOT(advancedSettingsCxx())); + connect(window, &QtProjectWizzardWindow::next, this, &QtProjectWizzard::advancedSettingsCxx); window->updateSubTitle("CDB Path"); } @@ -710,7 +710,7 @@ void QtProjectWizzard::sourcePaths() } ); - connect(window, SIGNAL(next()), this, SLOT(headerSearchPaths())); + connect(window, &QtProjectWizzardWindow::next, this, &QtProjectWizzard::headerSearchPaths); window->updateSubTitle("Indexed Paths"); } @@ -725,7 +725,7 @@ void QtProjectWizzard::headerSearchPaths() } ); - connect(window, SIGNAL(next()), this, SLOT(headerSearchPathsDone())); + connect(window, &QtProjectWizzardWindow::next, this, &QtProjectWizzard::headerSearchPathsDone); window->updateSubTitle("Include Paths"); } @@ -752,7 +752,7 @@ void QtProjectWizzard::frameworkSearchPaths() } ); - connect(window, SIGNAL(next()), this, SLOT(advancedSettingsCxx())); + connect(window, &QtProjectWizzardWindow::next, this, &QtProjectWizzard::advancedSettingsCxx); window->updateSubTitle("Framework Search Paths"); } @@ -767,7 +767,7 @@ void QtProjectWizzard::sourcePathsJava() } ); - connect(window, SIGNAL(next()), this, SLOT(advancedSettingsJava())); + connect(window, &QtProjectWizzardWindow::next, this, &QtProjectWizzard::advancedSettingsJava); window->updateSubTitle("Indexed Paths"); } @@ -786,7 +786,7 @@ void QtProjectWizzard::sourcePathsJavaMaven() } ); - connect(window, SIGNAL(next()), this, SLOT(advancedSettingsJava())); + connect(window, &QtProjectWizzardWindow::next, this, &QtProjectWizzard::advancedSettingsJava); window->updateSubTitle("Indexed Paths"); } @@ -801,7 +801,7 @@ void QtProjectWizzard::advancedSettingsCxx() } ); - connect(window, SIGNAL(next()), this, SLOT(createSourceGroup())); + connect(window, &QtProjectWizzardWindow::next, this, &QtProjectWizzard::createSourceGroup); window->updateSubTitle("Advanced (optional)"); } @@ -816,7 +816,7 @@ void QtProjectWizzard::advancedSettingsJava() } ); - connect(window, SIGNAL(next()), this, SLOT(createSourceGroup())); + connect(window, &QtProjectWizzardWindow::next, this, &QtProjectWizzard::createSourceGroup); window->updateSubTitle("Advanced (optional)"); } diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContent.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContent.cpp index 35a40c34..8a67cf85 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContent.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContent.cpp @@ -109,7 +109,7 @@ QPushButton* QtProjectWizzardContent::addFilesButton(QString name, QGridLayout* { layout->addWidget(button, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignRight | Qt::AlignTop); } - connect(button, SIGNAL(clicked()), this, SLOT(filesButtonClicked())); + connect(button, &QPushButton::clicked, this, &QtProjectWizzardContent::filesButtonClicked); return button; } @@ -149,8 +149,8 @@ void QtProjectWizzardContent::showFilesDialog(const std::vector& fi m_filesDialog->setCloseVisible(false); m_filesDialog->setReadOnly(true); - connect(m_filesDialog.get(), SIGNAL(finished()), this, SLOT(closedFilesDialog())); - connect(m_filesDialog.get(), SIGNAL(canceled()), this, SLOT(closedFilesDialog())); + connect(m_filesDialog.get(), &QtTextEditDialog::finished, this, &QtProjectWizzardContent::closedFilesDialog); + connect(m_filesDialog.get(), &QtTextEditDialog::canceled, this, &QtProjectWizzardContent::closedFilesDialog); } m_filesDialog->showWindow(); diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPath.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPath.cpp index f4c72d65..9d475cd2 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPath.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPath.cpp @@ -127,7 +127,7 @@ void QtProjectWizzardContentPathCDB::populate(QGridLayout* layout, int& row) QtProjectWizzardContentPath::populate(layout, row); m_picker->setPickDirectory(false); m_picker->setFileFilter("JSON Compilation Database (*.json)"); - connect(m_picker, SIGNAL(locationPicked()), this, SLOT(pickedCDBPath())); + connect(m_picker, &QtLocationPicker::locationPicked, this, &QtProjectWizzardContentPathCDB::pickedCDBPath); QLabel* description = new QLabel( "Sourcetrail will use all include paths and compiler flags from the compilation database and stay up-to-date " diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp index eb711dd3..fd24c530 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp @@ -123,7 +123,7 @@ void QtProjectWizzardContentPaths::addDetection(QGridLayout* layout, int row) QPushButton* button = new QPushButton("detect"); button->setObjectName("windowButton"); - connect(button, SIGNAL(clicked()), this, SLOT(detectionClicked())); + connect(button, &QPushButton::clicked, this, &QtProjectWizzardContentPaths::detectionClicked); QHBoxLayout* hlayout = new QHBoxLayout(); hlayout->setContentsMargins(0, 0, 0, 0); @@ -236,7 +236,7 @@ void QtProjectWizzardContentPathsCDBHeader::populate(QGridLayout* layout, int& r QPushButton* button = new QPushButton("Select from Include Paths"); button->setObjectName("windowButton"); - connect(button, SIGNAL(clicked()), this, SLOT(buttonClicked())); + connect(button, &QPushButton::clicked, this, &QtProjectWizzardContentPathsCDBHeader::buttonClicked); layout->addWidget(button, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignRight | Qt::AlignTop); row++; @@ -285,8 +285,8 @@ void QtProjectWizzardContentPathsCDBHeader::buttonClicked() "paths containing the header files you want to index with Sourcetrail."); m_filesDialog->setup(); - connect(m_filesDialog.get(), SIGNAL(finished()), this, SLOT(savedFilesDialog())); - connect(m_filesDialog.get(), SIGNAL(canceled()), this, SLOT(closedFilesDialog())); + connect(m_filesDialog.get(), &QtSelectPathsDialog::finished, this, &QtProjectWizzardContentPathsCDBHeader::savedFilesDialog); + connect(m_filesDialog.get(), &QtSelectPathsDialog::canceled, this, &QtProjectWizzardContentPathsCDBHeader::closedFilesDialog); utility::CompilationDatabase cdb(cdbPath.str()); @@ -377,7 +377,7 @@ void QtProjectWizzardContentPathsHeaderSearch::populate(QGridLayout* layout, int QPushButton* button = new QPushButton("validate include directives"); button->setObjectName("windowButton"); - connect(button, SIGNAL(clicked()), this, SLOT(validateButtonClicked())); + connect(button, &QPushButton::clicked, this, &QtProjectWizzardContentPathsHeaderSearch::validateButtonClicked); layout->addWidget(button, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignRight | Qt::AlignTop); row++; diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPreferences.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPreferences.cpp index c8a90cd1..996ea426 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPreferences.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPreferences.cpp @@ -54,7 +54,7 @@ void QtProjectWizzardContentPreferences::populate(QGridLayout* layout, int& row) { m_colorSchemes->insertItem(i, m_colorSchemePaths[i].withoutExtension().fileName().c_str()); } - connect(m_colorSchemes, SIGNAL(activated(int)), this, SLOT(colorSchemeChanged(int))); + connect(m_colorSchemes, static_cast(&QComboBox::activated), this, &QtProjectWizzardContentPreferences::colorSchemeChanged); // animations m_useAnimations = addCheckBox("Animations", "Enable animations", @@ -63,7 +63,7 @@ void QtProjectWizzardContentPreferences::populate(QGridLayout* layout, int& row) // logging m_loggingEnabled = addCheckBox("Logging", "Enable console and file logging", "

Show logs in the console and save this information in files.

", layout, row); - connect(m_loggingEnabled, SIGNAL(clicked()), this, SLOT(loggingEnabledChanged())); + connect(m_loggingEnabled, &QCheckBox::clicked, this, &QtProjectWizzardContentPreferences::loggingEnabledChanged); m_verboseIndexerLoggingEnabled = addCheckBox( "Indexer Logging", @@ -106,7 +106,7 @@ void QtProjectWizzardContentPreferences::populate(QGridLayout* layout, int& row) const int maxThreadCount = 24; m_threads = new QComboBox(this); - connect(m_threads, SIGNAL(activated(int)), this, SLOT(indexerThreadsChanges(int))); + connect(m_threads, static_cast(&QComboBox::activated), this, &QtProjectWizzardContentPreferences::indexerThreadsChanges); for (int i = minThreadCount; i <= maxThreadCount; i++) { m_threads->insertItem(i, QString::number(i)); @@ -442,7 +442,7 @@ void QtProjectWizzardContentPreferences::addJavaPathDetection(QGridLayout* layou QPushButton* button = new QPushButton("detect"); button->setObjectName("windowButton"); - connect(button, SIGNAL(clicked()), this, SLOT(javaPathDetectionClicked())); + connect(button, &QPushButton::clicked, this, &QtProjectWizzardContentPreferences::javaPathDetectionClicked); QHBoxLayout* hlayout = new QHBoxLayout(); hlayout->setContentsMargins(0, 0, 0, 0); @@ -476,7 +476,7 @@ void QtProjectWizzardContentPreferences::addJreSystemLibraryPathsDetection(QGrid QPushButton* button = new QPushButton("detect"); button->setObjectName("windowButton"); - connect(button, SIGNAL(clicked()), this, SLOT(jreSystemLibraryPathsDetectionClicked())); + connect(button, &QPushButton::clicked, this, &QtProjectWizzardContentPreferences::jreSystemLibraryPathsDetectionClicked); QHBoxLayout* hlayout = new QHBoxLayout(); hlayout->setContentsMargins(0, 0, 0, 0); @@ -510,7 +510,7 @@ void QtProjectWizzardContentPreferences::addMavenPathDetection(QGridLayout* layo QPushButton* button = new QPushButton("detect"); button->setObjectName("windowButton"); - connect(button, SIGNAL(clicked()), this, SLOT(mavenPathDetectionClicked())); + connect(button, &QPushButton::clicked, this, &QtProjectWizzardContentPreferences::mavenPathDetectionClicked); QHBoxLayout* hlayout = new QHBoxLayout(); hlayout->setContentsMargins(0, 0, 0, 0); diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentSourceGroupData.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentSourceGroupData.cpp index d70c0a48..60011c8a 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentSourceGroupData.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentSourceGroupData.cpp @@ -27,7 +27,7 @@ void QtProjectWizzardContentSourceGroupData::populate(QGridLayout* layout, int& m_name = new QLineEdit(); m_name->setObjectName("name"); m_name->setAttribute(Qt::WA_MacShowFocusRect, 0); - connect(m_name, SIGNAL(textEdited(QString)), this, SLOT(editedName(QString))); + connect(m_name, &QLineEdit::textEdited, this, &QtProjectWizzardContentSourceGroupData::editedName); layout->addWidget(nameLabel, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight); layout->addWidget(m_name, row, QtProjectWizzardWindow::BACK_COL); diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentVS.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentVS.cpp index 6a46cfbe..62e413c8 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentVS.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentVS.cpp @@ -36,7 +36,7 @@ Note: Sourcetrail's Visual Studio plugin has to be installed. Visual Studio has addSeparator(layout, row++); - connect(button, SIGNAL(clicked()), this, SLOT(handleVSCDBClicked())); + connect(button, &QPushButton::clicked, this, &QtProjectWizzardContentVS::handleVSCDBClicked); } void QtProjectWizzardContentVS::handleVSCDBClicked()