src: new signal slot syntax

SLOT()/SIGNAL() -> &class::method()
This commit is contained in:
Andreas Stallinger
2017-08-01 12:35:33 +02:00
parent 8d68203727
commit 244c9af3c6
47 changed files with 242 additions and 232 deletions
+3 -3
View File
@@ -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<const QString&>(&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<const QString&>(&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);
+2 -2
View File
@@ -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<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &QtBookmarkCreator::onComboBoxIndexChanged);
m_categoryCount = m_categoryBox->count();
+3 -3
View File
@@ -65,7 +65,7 @@ void QtIndexingDialog::setupStart(
m_fullRefreshCheckBox = new QCheckBox("full refresh", this);
m_fullRefreshCheckBox->setObjectName("message");
connect(m_fullRefreshCheckBox, static_cast<void(QCheckBox::*)(bool)>(&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);
+48 -48
View File
@@ -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<QApplication*>(QCoreApplication::instance()), SLOT(quit()));
connect(window, &QtEulaWindow::finished, this, &QtMainWindow::acceptedEula);
connect(window, &QtEulaWindow::canceled, dynamic_cast<QApplication*>(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<QtLicense>();
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<QtStartScreen>();
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<typename T>
{
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);
+1 -8
View File
@@ -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)
+7 -7
View File
@@ -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);
+4 -4
View File
@@ -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();
}
+2 -2
View File
@@ -96,8 +96,8 @@ protected:
QPushButton* m_previousButton;
QPushButton* m_closeButton;
private slots:
void handleNextPress();
public slots:
void handleNextPress(bool);
void handlePreviousPress();
void handleClosePress();
@@ -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<QtProjectWizzardContentSelect*>(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)");
}
@@ -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<std::string>& 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();
@@ -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 "
@@ -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++;
@@ -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<void (QComboBox::*)(int)>(&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",
"<p>Show logs in the console and save this information in files.</p>", 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<void (QComboBox::*)(int)>(&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);
@@ -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);
@@ -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()