diff --git a/src/lib/3rdparty/fancytabwidget.cpp b/src/lib/3rdparty/fancytabwidget.cpp index 8ab8a4262..1ad855b19 100644 --- a/src/lib/3rdparty/fancytabwidget.cpp +++ b/src/lib/3rdparty/fancytabwidget.cpp @@ -257,7 +257,7 @@ FancyTabBar::FancyTabBar(QWidget* parent) setLayout(layout); // We use a zerotimer to keep the sidebar responsive - connect(&m_triggerTimer, SIGNAL(timeout()), this, SLOT(emitCurrentIndex())); + connect(&m_triggerTimer, &QTimer::timeout, this, &FancyTabBar::emitCurrentIndex); } FancyTabBar::~FancyTabBar() @@ -628,7 +628,7 @@ void FancyTabWidget::SetMode(Mode mode) } bar->setCurrentIndex(stack_->currentIndex()); - connect(bar, SIGNAL(currentChanged(int)), SLOT(ShowWidget(int))); + connect(bar, &FancyTabBar::currentChanged, this, &FancyTabWidget::ShowWidget); use_background_ = true; @@ -742,6 +742,6 @@ void FancyTabWidget::MakeTabBar(QTabBar::Shape shape, bool text, bool icons, } bar->setCurrentIndex(stack_->currentIndex()); - connect(bar, SIGNAL(currentChanged(int)), SLOT(ShowWidget(int))); + connect(bar, &QTabBar::currentChanged, this, &FancyTabWidget::ShowWidget); tab_bar_ = bar; } diff --git a/src/lib/3rdparty/lineedit.cpp b/src/lib/3rdparty/lineedit.cpp index 602fdb9c7..8106d93e4 100644 --- a/src/lib/3rdparty/lineedit.cpp +++ b/src/lib/3rdparty/lineedit.cpp @@ -96,48 +96,48 @@ void LineEdit::init() setWidgetSpacing(3); - connect(m_leftWidget, SIGNAL(sizeHintChanged()), this, SLOT(updateTextMargins())); - connect(m_rightWidget, SIGNAL(sizeHintChanged()), this, SLOT(updateTextMargins())); + connect(m_leftWidget, &SideWidget::sizeHintChanged, this, &LineEdit::updateTextMargins); + connect(m_rightWidget, &SideWidget::sizeHintChanged, this, &LineEdit::updateTextMargins); QAction* undoAction = new QAction(QIcon::fromTheme(QSL("edit-undo")), tr("&Undo"), this); undoAction->setShortcut(QKeySequence(QSL("Ctrl+Z"))); undoAction->setShortcutContext(Qt::WidgetWithChildrenShortcut); - connect(undoAction, SIGNAL(triggered()), SLOT(undo())); + connect(undoAction, &QAction::triggered, this, &QLineEdit::undo); QAction* redoAction = new QAction(QIcon::fromTheme(QSL("edit-redo")), tr("&Redo"), this); redoAction->setShortcut(QKeySequence(QSL("Ctrl+Shift+Z"))); redoAction->setShortcutContext(Qt::WidgetWithChildrenShortcut); - connect(redoAction, SIGNAL(triggered()), SLOT(redo())); + connect(redoAction, &QAction::triggered, this, &QLineEdit::redo); QAction* cutAction = new QAction(QIcon::fromTheme(QSL("edit-cut")), tr("Cu&t"), this); cutAction->setShortcut(QKeySequence(QSL("Ctrl+X"))); cutAction->setShortcutContext(Qt::WidgetWithChildrenShortcut); - connect(cutAction, SIGNAL(triggered()), SLOT(cut())); + connect(cutAction, &QAction::triggered, this, &QLineEdit::cut); QAction* copyAction = new QAction(QIcon::fromTheme(QSL("edit-copy")), tr("&Copy"), this); copyAction->setShortcut(QKeySequence(QSL("Ctrl+C"))); copyAction->setShortcutContext(Qt::WidgetWithChildrenShortcut); - connect(copyAction, SIGNAL(triggered()), SLOT(copy())); + connect(copyAction, &QAction::triggered, this, &QLineEdit::copy); QAction* pasteAction = new QAction(QIcon::fromTheme(QSL("edit-paste")), tr("&Paste"), this); pasteAction->setShortcut(QKeySequence(QSL("Ctrl+V"))); pasteAction->setShortcutContext(Qt::WidgetWithChildrenShortcut); - connect(pasteAction, SIGNAL(triggered()), SLOT(paste())); + connect(pasteAction, &QAction::triggered, this, &QLineEdit::paste); QAction* pasteAndGoAction = new QAction(this); pasteAndGoAction->setShortcut(QKeySequence(QSL("Ctrl+Shift+V"))); pasteAndGoAction->setShortcutContext(Qt::WidgetWithChildrenShortcut); QAction* deleteAction = new QAction(QIcon::fromTheme(QSL("edit-delete")), tr("Delete"), this); - connect(deleteAction, SIGNAL(triggered()), SLOT(slotDelete())); + connect(deleteAction, &QAction::triggered, this, &LineEdit::slotDelete); QAction* clearAllAction = new QAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear All"), this); - connect(clearAllAction, SIGNAL(triggered()), SLOT(clear())); + connect(clearAllAction, &QAction::triggered, this, &QLineEdit::clear); QAction* selectAllAction = new QAction(QIcon::fromTheme(QSL("edit-select-all")), tr("Select All"), this); selectAllAction->setShortcut(QKeySequence(QSL("Ctrl+A"))); selectAllAction->setShortcutContext(Qt::WidgetWithChildrenShortcut); - connect(selectAllAction, SIGNAL(triggered()), SLOT(selectAll())); + connect(selectAllAction, &QAction::triggered, this, &QLineEdit::selectAll); m_editActions[Undo] = undoAction; m_editActions[Redo] = redoAction; @@ -161,8 +161,8 @@ void LineEdit::init() addAction(selectAllAction); // Connections to update edit actions - connect(this, SIGNAL(textChanged(QString)), this, SLOT(updateActions())); - connect(this, SIGNAL(selectionChanged()), this, SLOT(updateActions())); + connect(this, &QLineEdit::textChanged, this, &LineEdit::updateActions); + connect(this, &QLineEdit::selectionChanged, this, &LineEdit::updateActions); updateActions(); } diff --git a/src/lib/3rdparty/qtsingleapplication/qtlocalpeer.cpp b/src/lib/3rdparty/qtsingleapplication/qtlocalpeer.cpp index ee3d8a8b7..c1cb96aa2 100644 --- a/src/lib/3rdparty/qtsingleapplication/qtlocalpeer.cpp +++ b/src/lib/3rdparty/qtsingleapplication/qtlocalpeer.cpp @@ -128,7 +128,7 @@ bool QtLocalPeer::isClient() #endif if (!res) qWarning("QtSingleCoreApplication: listen on local socket failed, %s", qPrintable(server->errorString())); - QObject::connect(server, SIGNAL(newConnection()), SLOT(receiveConnection())); + QObject::connect(server, &QLocalServer::newConnection, this, &QtLocalPeer::receiveConnection); return false; } diff --git a/src/lib/3rdparty/qtsingleapplication/qtsingleapplication.cpp b/src/lib/3rdparty/qtsingleapplication/qtsingleapplication.cpp index aafe57f07..7378bd3bc 100644 --- a/src/lib/3rdparty/qtsingleapplication/qtsingleapplication.cpp +++ b/src/lib/3rdparty/qtsingleapplication/qtsingleapplication.cpp @@ -137,7 +137,7 @@ void QtSingleApplication::sysInit(const QString &appId) { actWin = 0; peer = new QtLocalPeer(this, appId); - connect(peer, SIGNAL(messageReceived(const QString&)), SIGNAL(messageReceived(const QString&))); + connect(peer, &QtLocalPeer::messageReceived, this, &QtSingleApplication::messageReceived); } @@ -292,9 +292,9 @@ void QtSingleApplication::setActivationWindow(QWidget* aw, bool activateOnMessag { actWin = aw; if (activateOnMessage) - connect(peer, SIGNAL(messageReceived(const QString&)), this, SLOT(activateWindow())); + connect(peer, &QtLocalPeer::messageReceived, this, &QtSingleApplication::activateWindow); else - disconnect(peer, SIGNAL(messageReceived(const QString&)), this, SLOT(activateWindow())); + disconnect(peer, &QtLocalPeer::messageReceived, this, &QtSingleApplication::activateWindow); } diff --git a/src/lib/3rdparty/squeezelabelv2.cpp b/src/lib/3rdparty/squeezelabelv2.cpp index f4d1c02bc..d4f60bacb 100644 --- a/src/lib/3rdparty/squeezelabelv2.cpp +++ b/src/lib/3rdparty/squeezelabelv2.cpp @@ -61,7 +61,7 @@ void SqueezeLabelV2::contextMenuEvent(QContextMenuEvent* event) } QMenu menu; - QAction* act = menu.addAction(tr("Copy"), this, SLOT(copy())); + QAction* act = menu.addAction(tr("Copy"), this, &SqueezeLabelV2::copy); act->setShortcut(QKeySequence(QSL("Ctrl+C"))); act->setEnabled(hasSelectedText()); diff --git a/src/lib/adblock/adblockdialog.cpp b/src/lib/adblock/adblockdialog.cpp index 1b9e44723..65d707d9c 100644 --- a/src/lib/adblock/adblockdialog.cpp +++ b/src/lib/adblock/adblockdialog.cpp @@ -46,22 +46,22 @@ AdBlockDialog::AdBlockDialog(QWidget* parent) adblockCheckBox->setChecked(m_manager->isEnabled()); QMenu* menu = new QMenu(buttonOptions); - m_actionAddRule = menu->addAction(tr("Add Rule"), this, SLOT(addRule())); - m_actionRemoveRule = menu->addAction(tr("Remove Rule"), this, SLOT(removeRule())); + m_actionAddRule = menu->addAction(tr("Add Rule"), this, &AdBlockDialog::addRule); + m_actionRemoveRule = menu->addAction(tr("Remove Rule"), this, &AdBlockDialog::removeRule); menu->addSeparator(); - m_actionAddSubscription = menu->addAction(tr("Add Subscription"), this, SLOT(addSubscription())); - m_actionRemoveSubscription = menu->addAction(tr("Remove Subscription"), this, SLOT(removeSubscription())); - menu->addAction(tr("Update Subscriptions"), m_manager, SLOT(updateAllSubscriptions())); + m_actionAddSubscription = menu->addAction(tr("Add Subscription"), this, &AdBlockDialog::addSubscription); + m_actionRemoveSubscription = menu->addAction(tr("Remove Subscription"), this, &AdBlockDialog::removeSubscription); + menu->addAction(tr("Update Subscriptions"), m_manager, &AdBlockManager::updateAllSubscriptions); menu->addSeparator(); - menu->addAction(tr("Learn about writing rules..."), this, SLOT(learnAboutRules())); + menu->addAction(tr("Learn about writing rules..."), this, &AdBlockDialog::learnAboutRules); buttonOptions->setMenu(menu); - connect(menu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowMenu())); + connect(menu, &QMenu::aboutToShow, this, &AdBlockDialog::aboutToShowMenu); - connect(adblockCheckBox, SIGNAL(toggled(bool)), this, SLOT(enableAdBlock(bool))); - connect(search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString))); - connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentChanged(int))); - connect(buttonBox, SIGNAL(accepted()), this, SLOT(close())); + connect(adblockCheckBox, &QAbstractButton::toggled, this, &AdBlockDialog::enableAdBlock); + connect(search, &QLineEdit::textChanged, this, &AdBlockDialog::filterString); + connect(tabWidget, &QTabWidget::currentChanged, this, &AdBlockDialog::currentChanged); + connect(buttonBox, &QDialogButtonBox::accepted, this, &QWidget::close); load(); @@ -181,5 +181,5 @@ void AdBlockDialog::load() m_loaded = true; - QTimer::singleShot(50, this, SLOT(loadSubscriptions())); + QTimer::singleShot(50, this, &AdBlockDialog::loadSubscriptions); } diff --git a/src/lib/adblock/adblockicon.cpp b/src/lib/adblock/adblockicon.cpp index fd9d47cf6..60a9e0a82 100644 --- a/src/lib/adblock/adblockicon.cpp +++ b/src/lib/adblock/adblockicon.cpp @@ -154,13 +154,13 @@ void AdBlockIcon::clicked(ClickController *controller) act->setCheckable(true); act->setChecked(customList->containsFilter(hostFilter)); act->setData(hostFilter); - connect(act, SIGNAL(triggered()), this, SLOT(toggleCustomFilter())); + connect(act, &QAction::triggered, this, &AdBlockIcon::toggleCustomFilter); act = menu->addAction(tr("Disable only on this page")); act->setCheckable(true); act->setChecked(customList->containsFilter(pageFilter)); act->setData(pageFilter); - connect(act, SIGNAL(triggered()), this, SLOT(toggleCustomFilter())); + connect(act, &QAction::triggered, this, &AdBlockIcon::toggleCustomFilter); } connect(menu, &QMenu::aboutToHide, this, [=]() { diff --git a/src/lib/adblock/adblockmanager.cpp b/src/lib/adblock/adblockmanager.cpp index 5b856b687..e299b4eb8 100644 --- a/src/lib/adblock/adblockmanager.cpp +++ b/src/lib/adblock/adblockmanager.cpp @@ -217,8 +217,8 @@ AdBlockSubscription* AdBlockManager::addSubscription(const QString &title, const subscription->loadSubscription(m_disabledRules); m_subscriptions.insert(m_subscriptions.count() - 1, subscription); - connect(subscription, SIGNAL(subscriptionUpdated()), mApp, SLOT(reloadUserStyleSheet())); - connect(subscription, SIGNAL(subscriptionChanged()), this, SLOT(updateMatcher())); + connect(subscription, &AdBlockSubscription::subscriptionUpdated, mApp, &MainApplication::reloadUserStyleSheet); + connect(subscription, &AdBlockSubscription::subscriptionChanged, this, &AdBlockManager::updateMatcher); return subscription; } @@ -332,12 +332,12 @@ void AdBlockManager::load() foreach (AdBlockSubscription* subscription, m_subscriptions) { subscription->loadSubscription(m_disabledRules); - connect(subscription, SIGNAL(subscriptionUpdated()), mApp, SLOT(reloadUserStyleSheet())); - connect(subscription, SIGNAL(subscriptionChanged()), this, SLOT(updateMatcher())); + connect(subscription, &AdBlockSubscription::subscriptionUpdated, mApp, &MainApplication::reloadUserStyleSheet); + connect(subscription, &AdBlockSubscription::subscriptionChanged, this, &AdBlockManager::updateMatcher); } if (lastUpdate.addDays(5) < QDateTime::currentDateTime()) { - QTimer::singleShot(1000 * 60, this, SLOT(updateAllSubscriptions())); + QTimer::singleShot(1000 * 60, this, &AdBlockManager::updateAllSubscriptions); } #ifdef ADBLOCK_DEBUG diff --git a/src/lib/adblock/adblocksubscription.cpp b/src/lib/adblock/adblocksubscription.cpp index 5fd259132..e0f405fa7 100644 --- a/src/lib/adblock/adblocksubscription.cpp +++ b/src/lib/adblock/adblocksubscription.cpp @@ -93,13 +93,13 @@ void AdBlockSubscription::loadSubscription(const QStringList &disabledRules) QFile file(m_filePath); if (!file.exists()) { - QTimer::singleShot(0, this, SLOT(updateSubscription())); + QTimer::singleShot(0, this, &AdBlockSubscription::updateSubscription); return; } if (!file.open(QFile::ReadOnly)) { qWarning() << "AdBlockSubscription::" << __FUNCTION__ << "Unable to open adblock file for reading" << m_filePath; - QTimer::singleShot(0, this, SLOT(updateSubscription())); + QTimer::singleShot(0, this, &AdBlockSubscription::updateSubscription); return; } @@ -112,7 +112,7 @@ void AdBlockSubscription::loadSubscription(const QStringList &disabledRules) if (!header.startsWith(QLatin1String("[Adblock")) || m_title.isEmpty()) { qWarning() << "AdBlockSubscription::" << __FUNCTION__ << "invalid format of adblock file" << m_filePath; - QTimer::singleShot(0, this, SLOT(updateSubscription())); + QTimer::singleShot(0, this, &AdBlockSubscription::updateSubscription); return; } @@ -133,7 +133,7 @@ void AdBlockSubscription::loadSubscription(const QStringList &disabledRules) // Initial update if (m_rules.isEmpty() && !m_updated) { - QTimer::singleShot(0, this, SLOT(updateSubscription())); + QTimer::singleShot(0, this, &AdBlockSubscription::updateSubscription); } } diff --git a/src/lib/adblock/adblocktreewidget.cpp b/src/lib/adblock/adblocktreewidget.cpp index 581e8e541..91866fc14 100644 --- a/src/lib/adblock/adblocktreewidget.cpp +++ b/src/lib/adblock/adblocktreewidget.cpp @@ -36,10 +36,10 @@ AdBlockTreeWidget::AdBlockTreeWidget(AdBlockSubscription* subscription, QWidget* setAlternatingRowColors(true); setLayoutDirection(Qt::LeftToRight); - connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequested(QPoint))); + connect(this, &QWidget::customContextMenuRequested, this, &AdBlockTreeWidget::contextMenuRequested); connect(this, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(itemChanged(QTreeWidgetItem*))); - connect(m_subscription, SIGNAL(subscriptionUpdated()), this, SLOT(subscriptionUpdated())); - connect(m_subscription, SIGNAL(subscriptionError(QString)), this, SLOT(subscriptionError(QString))); + connect(m_subscription, &AdBlockSubscription::subscriptionUpdated, this, &AdBlockTreeWidget::subscriptionUpdated); + connect(m_subscription, &AdBlockSubscription::subscriptionError, this, &AdBlockTreeWidget::subscriptionError); } AdBlockSubscription* AdBlockTreeWidget::subscription() const @@ -77,9 +77,9 @@ void AdBlockTreeWidget::contextMenuRequested(const QPoint &pos) } QMenu menu; - menu.addAction(tr("Add Rule"), this, SLOT(addRule())); + menu.addAction(tr("Add Rule"), this, &AdBlockTreeWidget::addRule); menu.addSeparator(); - QAction* deleteAction = menu.addAction(tr("Remove Rule"), this, SLOT(removeRule())); + QAction* deleteAction = menu.addAction(tr("Remove Rule"), this, &AdBlockTreeWidget::removeRule); if (!item->parent()) { deleteAction->setDisabled(true); diff --git a/src/lib/app/browserwindow.cpp b/src/lib/app/browserwindow.cpp index 7ef10d36d..70b73518e 100644 --- a/src/lib/app/browserwindow.cpp +++ b/src/lib/app/browserwindow.cpp @@ -211,11 +211,11 @@ BrowserWindow::BrowserWindow(Qz::BrowserWindowType type, const QUrl &startUrl) m_hideNavigationTimer = new QTimer(this); m_hideNavigationTimer->setInterval(1000); m_hideNavigationTimer->setSingleShot(true); - connect(m_hideNavigationTimer, SIGNAL(timeout()), this, SLOT(hideNavigationSlot())); + connect(m_hideNavigationTimer, &QTimer::timeout, this, &BrowserWindow::hideNavigationSlot); - connect(mApp, SIGNAL(settingsReloaded()), this, SLOT(loadSettings())); + connect(mApp, &MainApplication::settingsReloaded, this, &BrowserWindow::loadSettings); - QTimer::singleShot(0, this, SLOT(postLaunch())); + QTimer::singleShot(0, this, &BrowserWindow::postLaunch); if (mApp->isPrivate()) { QzTools::setWmClass(QSL("Falkon Browser (Private Window)"), this); @@ -463,22 +463,22 @@ void BrowserWindow::setupMenu() // Setup other shortcuts QShortcut* reloadBypassCacheAction = new QShortcut(QKeySequence(QSL("Ctrl+F5")), this); QShortcut* reloadBypassCacheAction2 = new QShortcut(QKeySequence(QSL("Ctrl+Shift+R")), this); - connect(reloadBypassCacheAction, SIGNAL(activated()), this, SLOT(reloadBypassCache())); - connect(reloadBypassCacheAction2, SIGNAL(activated()), this, SLOT(reloadBypassCache())); + connect(reloadBypassCacheAction, &QShortcut::activated, this, &BrowserWindow::reloadBypassCache); + connect(reloadBypassCacheAction2, &QShortcut::activated, this, &BrowserWindow::reloadBypassCache); QShortcut* closeTabAction = new QShortcut(QKeySequence(QSL("Ctrl+W")), this); QShortcut* closeTabAction2 = new QShortcut(QKeySequence(QSL("Ctrl+F4")), this); - connect(closeTabAction, SIGNAL(activated()), this, SLOT(closeTab())); - connect(closeTabAction2, SIGNAL(activated()), this, SLOT(closeTab())); + connect(closeTabAction, &QShortcut::activated, this, &BrowserWindow::closeTab); + connect(closeTabAction2, &QShortcut::activated, this, &BrowserWindow::closeTab); QShortcut* reloadAction = new QShortcut(QKeySequence(QSL("Ctrl+R")), this); - connect(reloadAction, SIGNAL(activated()), this, SLOT(reload())); + connect(reloadAction, &QShortcut::activated, this, &BrowserWindow::reload); QShortcut* openLocationAction = new QShortcut(QKeySequence(QSL("Alt+D")), this); - connect(openLocationAction, SIGNAL(activated()), this, SLOT(openLocation())); + connect(openLocationAction, &QShortcut::activated, this, &BrowserWindow::openLocation); QShortcut* inspectorAction = new QShortcut(QKeySequence(QSL("F12")), this); - connect(inspectorAction, SIGNAL(activated()), this, SLOT(toggleWebInspector())); + connect(inspectorAction, &QShortcut::activated, this, &BrowserWindow::toggleWebInspector); QShortcut* restoreClosedWindow = new QShortcut(QKeySequence(QSL("Ctrl+Shift+N")), this); connect(restoreClosedWindow, &QShortcut::activated, mApp->closedWindowsManager(), &ClosedWindowsManager::restoreClosedWindow); @@ -503,7 +503,7 @@ QAction* BrowserWindow::createEncodingAction(const QString &codecName, QAction* action = new QAction(codecName, menu); action->setData(codecName); action->setCheckable(true); - connect(action, SIGNAL(triggered()), this, SLOT(changeEncoding())); + connect(action, &QAction::triggered, this, &BrowserWindow::changeEncoding); if (activeCodecName.compare(codecName, Qt::CaseInsensitive) == 0) { action->setChecked(true); } @@ -1045,16 +1045,16 @@ void BrowserWindow::createToolbarsMenu(QMenu* menu) QAction* action; #ifndef Q_OS_MACOS - action = menu->addAction(tr("&Menu Bar"), this, SLOT(toggleShowMenubar())); + action = menu->addAction(tr("&Menu Bar"), this, &BrowserWindow::toggleShowMenubar); action->setCheckable(true); action->setChecked(menuBar()->isVisible()); #endif - action = menu->addAction(tr("&Navigation Toolbar"), this, SLOT(toggleShowNavigationToolbar())); + action = menu->addAction(tr("&Navigation Toolbar"), this, &BrowserWindow::toggleShowNavigationToolbar); action->setCheckable(true); action->setChecked(m_navigationToolbar->isVisible()); - action = menu->addAction(tr("&Bookmarks Toolbar"), this, SLOT(toggleShowBookmarksToolbar())); + action = menu->addAction(tr("&Bookmarks Toolbar"), this, &BrowserWindow::toggleShowBookmarksToolbar); action->setCheckable(true); action->setChecked(Settings().value(QSL("Browser-View-Settings/showBookmarksToolbar")).toBool()); diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index 56e227f5c..1a9c977d9 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -111,8 +111,8 @@ MainApplication::MainApplication(int &argc, char** argv) setAttribute(Qt::AA_UseHighDpiPixmaps); setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); - setApplicationName(QLatin1String("falkon")); - setOrganizationDomain(QLatin1String("org.kde")); + setApplicationName(QStringLiteral("falkon")); + setOrganizationDomain(QStringLiteral("org.kde")); setWindowIcon(QIcon::fromTheme(QSL("falkon"), QIcon(QSL(":icons/falkon.svg")))); setDesktopFileName(QSL("org.kde.falkon")); @@ -165,18 +165,18 @@ MainApplication::MainApplication(int &argc, char** argv) m_isPortable = true; break; case Qz::CL_NewTab: - messages.append(QLatin1String("ACTION:NewTab")); + messages.append(QStringLiteral("ACTION:NewTab")); m_postLaunchActions.append(OpenNewTab); break; case Qz::CL_NewWindow: - messages.append(QLatin1String("ACTION:NewWindow")); + messages.append(QStringLiteral("ACTION:NewWindow")); break; case Qz::CL_ToggleFullScreen: - messages.append(QLatin1String("ACTION:ToggleFullScreen")); + messages.append(QStringLiteral("ACTION:ToggleFullScreen")); m_postLaunchActions.append(ToggleFullScreen); break; case Qz::CL_ShowDownloadManager: - messages.append(QLatin1String("ACTION:ShowDownloadManager")); + messages.append(QStringLiteral("ACTION:ShowDownloadManager")); m_postLaunchActions.append(OpenDownloadManager); break; case Qz::CL_StartPrivateBrowsing: @@ -221,7 +221,7 @@ MainApplication::MainApplication(int &argc, char** argv) // Don't start single application in private browsing if (!isPrivate()) { - QString appId = QLatin1String("FalkonWebBrowser"); + QString appId = QStringLiteral("FalkonWebBrowser"); if (isPortable()) { appId.append(QLatin1String("Portable")); @@ -248,7 +248,7 @@ MainApplication::MainApplication(int &argc, char** argv) // If there is nothing to tell other instance, we need to at least wake it if (messages.isEmpty()) { - messages.append(QLatin1String(" ")); + messages.append(QStringLiteral(" ")); } if (isRunning()) { @@ -289,7 +289,7 @@ MainApplication::MainApplication(int &argc, char** argv) if (!isPrivate() && !isTestModeEnabled()) { m_sessionManager = new SessionManager(this); m_autoSaver = new AutoSaver(this); - connect(m_autoSaver, SIGNAL(save()), m_sessionManager, SLOT(autoSaveLastSession())); + connect(m_autoSaver, &AutoSaver::save, m_sessionManager, &SessionManager::autoSaveLastSession); Settings settings; settings.beginGroup(QSL("SessionRestore")); @@ -324,7 +324,7 @@ MainApplication::MainApplication(int &argc, char** argv) BrowserWindow* window = createWindow(Qz::BW_FirstAppWindow, startUrl); connect(window, SIGNAL(startingCompleted()), this, SLOT(restoreOverrideCursor())); - connect(this, SIGNAL(focusChanged(QWidget*,QWidget*)), this, SLOT(onFocusChanged())); + connect(this, &QApplication::focusChanged, this, &MainApplication::onFocusChanged); if (!isPrivate() && !isTestModeEnabled()) { #ifndef DISABLE_CHECK_UPDATES @@ -353,9 +353,9 @@ MainApplication::MainApplication(int &argc, char** argv) QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, DataPaths::currentProfilePath()); connect(this, SIGNAL(messageReceived(QString)), this, SLOT(messageReceived(QString))); - connect(this, SIGNAL(aboutToQuit()), this, SLOT(saveSettings())); + connect(this, &QCoreApplication::aboutToQuit, this, &MainApplication::saveSettings); - QTimer::singleShot(0, this, SLOT(postLaunch())); + QTimer::singleShot(0, this, &MainApplication::postLaunch); } MainApplication::~MainApplication() @@ -426,7 +426,7 @@ BrowserWindow* MainApplication::createWindow(Qz::BrowserWindowType type, const Q } BrowserWindow* window = new BrowserWindow(type, startUrl); - connect(window, SIGNAL(destroyed(QObject*)), this, SLOT(windowDestroyed(QObject*))); + connect(window, &QObject::destroyed, this, &MainApplication::windowDestroyed); m_windows.prepend(window); return window; diff --git a/src/lib/app/mainmenu.cpp b/src/lib/app/mainmenu.cpp index 6e299ef53..464084251 100644 --- a/src/lib/app/mainmenu.cpp +++ b/src/lib/app/mainmenu.cpp @@ -466,24 +466,24 @@ void MainMenu::init() // Standard actions - needed on Mac to be placed correctly in "application" menu QAction* action = new QAction(QIcon::fromTheme(QSL("help-about")), tr("&About Falkon"), this); action->setMenuRole(QAction::AboutRole); - connect(action, SIGNAL(triggered()), this, SLOT(showAboutDialog())); + connect(action, &QAction::triggered, this, &MainMenu::showAboutDialog); m_actions[QSL("Standard/About")] = action; action = new QAction(IconProvider::settingsIcon(), tr("Pr&eferences"), this); action->setMenuRole(QAction::PreferencesRole); action->setShortcut(QKeySequence(QKeySequence::Preferences)); - connect(action, SIGNAL(triggered()), this, SLOT(showPreferences())); + connect(action, &QAction::triggered, this, &MainMenu::showPreferences); m_actions[QSL("Standard/Preferences")] = action; action = new QAction(QIcon::fromTheme(QSL("application-exit")), tr("Quit"), this); action->setMenuRole(QAction::QuitRole); // shortcut set from browserwindow - connect(action, SIGNAL(triggered()), this, SLOT(quitApplication())); + connect(action, &QAction::triggered, this, &MainMenu::quitApplication); m_actions[QSL("Standard/Quit")] = action; // File menu m_menuFile = new QMenu(tr("&File")); - connect(m_menuFile, SIGNAL(aboutToShow()), this, SLOT(aboutToShowFileMenu())); + connect(m_menuFile, &QMenu::aboutToShow, this, &MainMenu::aboutToShowFileMenu); ADD_ACTION("File/NewTab", m_menuFile, IconProvider::newTabIcon(), tr("New Tab"), SLOT(newTab()), "Ctrl+T"); ADD_ACTION("File/NewWindow", m_menuFile, IconProvider::newWindowIcon(), tr("&New Window"), SLOT(newWindow()), "Ctrl+N"); @@ -498,7 +498,7 @@ void MainMenu::init() connect(sessionsSubmenu, SIGNAL(aboutToShow()), mApp->sessionManager(), SLOT(aboutToShowSessionsMenu())); m_menuFile->addMenu(sessionsSubmenu); action = new QAction(tr("Session Manager"), this); - connect(action, SIGNAL(triggered()), mApp->sessionManager(), SLOT(openSessionManagerDialog())); + connect(action, &QAction::triggered, mApp->sessionManager(), &SessionManager::openSessionManagerDialog); m_actions[QSL("File/SessionManager")] = action; m_menuFile->addAction(action); m_menuFile->addSeparator(); @@ -512,7 +512,7 @@ void MainMenu::init() // Edit menu m_menuEdit = new QMenu(tr("&Edit")); - connect(m_menuEdit, SIGNAL(aboutToShow()), this, SLOT(aboutToShowEditMenu())); + connect(m_menuEdit, &QMenu::aboutToShow, this, &MainMenu::aboutToShowEditMenu); ADD_ACTION("Edit/Undo", m_menuEdit, QIcon::fromTheme(QSL("edit-undo")), tr("&Undo"), SLOT(editUndo()), "Ctrl+Z"); action->setShortcutContext(Qt::WidgetShortcut); @@ -534,14 +534,14 @@ void MainMenu::init() // View menu m_menuView = new QMenu(tr("&View")); - connect(m_menuView, SIGNAL(aboutToShow()), this, SLOT(aboutToShowViewMenu())); + connect(m_menuView, &QMenu::aboutToShow, this, &MainMenu::aboutToShowViewMenu); QMenu* toolbarsMenu = new QMenu(tr("Toolbars")); - connect(toolbarsMenu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowToolbarsMenu())); + connect(toolbarsMenu, &QMenu::aboutToShow, this, &MainMenu::aboutToShowToolbarsMenu); QMenu* sidebarMenu = new QMenu(tr("Sidebar")); - connect(sidebarMenu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowSidebarsMenu())); + connect(sidebarMenu, &QMenu::aboutToShow, this, &MainMenu::aboutToShowSidebarsMenu); QMenu* encodingMenu = new QMenu(tr("Character &Encoding")); - connect(encodingMenu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowEncodingMenu())); + connect(encodingMenu, &QMenu::aboutToShow, this, &MainMenu::aboutToShowEncodingMenu); // Create menus to make shortcuts available even before first showing the menu m_window->createToolbarsMenu(toolbarsMenu); @@ -566,7 +566,7 @@ void MainMenu::init() // Tools menu m_menuTools = new QMenu(tr("&Tools")); - connect(m_menuTools, SIGNAL(aboutToShow()), this, SLOT(aboutToShowToolsMenu())); + connect(m_menuTools, &QMenu::aboutToShow, this, &MainMenu::aboutToShowToolsMenu); ADD_ACTION("Tools/WebSearch", m_menuTools, QIcon::fromTheme(QSL("edit-find")), tr("&Web Search"), SLOT(webSearch()), "Ctrl+K"); ADD_ACTION("Tools/SiteInfo", m_menuTools, QIcon::fromTheme(QSL("dialog-information")), tr("Site &Info"), SLOT(showSiteInfo()), "Ctrl+I"); @@ -611,7 +611,7 @@ void MainMenu::init() // Other actions action = new QAction(QIcon::fromTheme(QSL("user-trash")), tr("Restore &Closed Tab"), this); action->setShortcut(QKeySequence(QSL("Ctrl+Shift+T"))); - connect(action, SIGNAL(triggered()), this, SLOT(restoreClosedTab())); + connect(action, &QAction::triggered, this, &MainMenu::restoreClosedTab); m_actions[QSL("Other/RestoreClosedTab")] = action; #ifdef Q_OS_MACOS diff --git a/src/lib/app/profilemanager.cpp b/src/lib/app/profilemanager.cpp index 4c86c6162..8a0ef942d 100644 --- a/src/lib/app/profilemanager.cpp +++ b/src/lib/app/profilemanager.cpp @@ -44,7 +44,7 @@ void ProfileManager::initConfigDir() migrateFromQupZilla(); } - if (QFileInfo::exists(dir.filePath(QLatin1String("profiles/profiles.ini")))) { + if (QFileInfo::exists(dir.filePath(QStringLiteral("profiles/profiles.ini")))) { return; } @@ -54,22 +54,22 @@ void ProfileManager::initConfigDir() dir.mkpath(dir.absolutePath()); } - dir.mkdir(QLatin1String("profiles")); - dir.cd(QLatin1String("profiles")); + dir.mkdir(QStringLiteral("profiles")); + dir.cd(QStringLiteral("profiles")); // $Config/profiles - QFile(dir.filePath(QLatin1String("profiles.ini"))).remove(); - QFile(QLatin1String(":data/profiles.ini")).copy(dir.filePath(QLatin1String("profiles.ini"))); - QFile(dir.filePath(QLatin1String("profiles.ini"))).setPermissions(QFile::ReadUser | QFile::WriteUser); + QFile(dir.filePath(QStringLiteral("profiles.ini"))).remove(); + QFile(QStringLiteral(":data/profiles.ini")).copy(dir.filePath(QStringLiteral("profiles.ini"))); + QFile(dir.filePath(QStringLiteral("profiles.ini"))).setPermissions(QFile::ReadUser | QFile::WriteUser); - dir.mkdir(QLatin1String("default")); - dir.cd(QLatin1String("default")); + dir.mkdir(QStringLiteral("default")); + dir.cd(QStringLiteral("default")); // $Config/profiles/default - QFile(QLatin1String(":data/bookmarks.json")).copy(dir.filePath(QLatin1String("bookmarks.json"))); - QFile(dir.filePath(QLatin1String("bookmarks.json"))).setPermissions(QFile::ReadUser | QFile::WriteUser); + QFile(QStringLiteral(":data/bookmarks.json")).copy(dir.filePath(QStringLiteral("bookmarks.json"))); + QFile(dir.filePath(QStringLiteral("bookmarks.json"))).setPermissions(QFile::ReadUser | QFile::WriteUser); - QFile versionFile(dir.filePath(QLatin1String("version"))); + QFile versionFile(dir.filePath(QStringLiteral("version"))); versionFile.open(QFile::WriteOnly); versionFile.write(Qz::VERSION); versionFile.close(); @@ -105,7 +105,7 @@ int ProfileManager::createProfile(const QString &profileName) dir.cd(profileName); - QFile versionFile(dir.filePath(QLatin1String("version"))); + QFile versionFile(dir.filePath(QStringLiteral("version"))); versionFile.open(QFile::WriteOnly); versionFile.write(Qz::VERSION); versionFile.close(); @@ -136,14 +136,14 @@ QString ProfileManager::currentProfile() QString ProfileManager::startingProfile() { QSettings settings(DataPaths::path(DataPaths::Profiles) + QLatin1String("/profiles.ini"), QSettings::IniFormat); - return settings.value(QLatin1String("Profiles/startProfile"), QLatin1String("default")).toString(); + return settings.value(QStringLiteral("Profiles/startProfile"), QLatin1String("default")).toString(); } // static void ProfileManager::setStartingProfile(const QString &profileName) { QSettings settings(DataPaths::path(DataPaths::Profiles) + QLatin1String("/profiles.ini"), QSettings::IniFormat); - settings.setValue(QLatin1String("Profiles/startProfile"), profileName); + settings.setValue(QStringLiteral("Profiles/startProfile"), profileName); } // static @@ -162,7 +162,7 @@ void ProfileManager::updateCurrentProfile() newDir.mkdir(profileDir.dirName()); } - QFile versionFile(profileDir.filePath(QLatin1String("version"))); + QFile versionFile(profileDir.filePath(QStringLiteral("version"))); // If file exists, just update the profile to current version if (versionFile.exists()) { @@ -198,18 +198,18 @@ void ProfileManager::updateProfile(const QString ¤t, const QString &profil return; } - if (prof < Updater::Version("1.9.0")) { + if (prof < Updater::Version(QStringLiteral("1.9.0"))) { std::cout << "Falkon: Using profile from QupZilla " << qPrintable(profile) << " is not supported!" << std::endl; return; } // No change in 2.0 - if (prof < Updater::Version("2.9.99")) { + if (prof < Updater::Version(QStringLiteral("2.9.99"))) { return; } // No change in 3.0 - if (prof < Updater::Version("3.0.99")) { + if (prof < Updater::Version(QStringLiteral("3.0.99"))) { return; } } @@ -218,10 +218,10 @@ void ProfileManager::copyDataToProfile() { QDir profileDir(DataPaths::currentProfilePath()); - QFile browseData(profileDir.filePath(QLatin1String("browsedata.db"))); + QFile browseData(profileDir.filePath(QStringLiteral("browsedata.db"))); if (browseData.exists()) { - const QString browseDataBackup = QzTools::ensureUniqueFilename(profileDir.filePath(QLatin1String("browsedata-backup.db"))); + const QString browseDataBackup = QzTools::ensureUniqueFilename(profileDir.filePath(QStringLiteral("browsedata-backup.db"))); browseData.copy(browseDataBackup); browseData.remove(); @@ -245,7 +245,7 @@ void ProfileManager::copyDataToProfile() const QString text = "Incompatible profile version has been detected. To avoid losing your profile data, they were " "backed up in following file:

" + browseDataBackup + "
"; - QMessageBox::warning(0, "Falkon: Incompatible profile version", text); + QMessageBox::warning(0, QStringLiteral("Falkon: Incompatible profile version"), text); } } @@ -274,14 +274,14 @@ void ProfileManager::migrateFromQupZilla() void ProfileManager::connectDatabase() { - QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE")); + QSqlDatabase db = QSqlDatabase::addDatabase(QStringLiteral("QSQLITE")); if (!db.isValid()) { qCritical() << "Qt sqlite database driver is missing! Continuing without database...."; return; } if (mApp->isPrivate()) { - db.setConnectOptions("QSQLITE_OPEN_READONLY"); + db.setConnectOptions(QStringLiteral("QSQLITE_OPEN_READONLY")); } db.setDatabaseName(DataPaths::currentProfilePath() + QLatin1String("/browsedata.db")); diff --git a/src/lib/autofill/autofill.cpp b/src/lib/autofill/autofill.cpp index e93945023..9571d405e 100644 --- a/src/lib/autofill/autofill.cpp +++ b/src/lib/autofill/autofill.cpp @@ -58,9 +58,9 @@ PasswordManager* AutoFill::passwordManager() const void AutoFill::loadSettings() { Settings settings; - settings.beginGroup("Web-Browser-Settings"); - m_isStoring = settings.value("SavePasswordsOnSites", true).toBool(); - m_isAutoComplete = settings.value("AutoCompletePasswords", true).toBool(); + settings.beginGroup(QStringLiteral("Web-Browser-Settings")); + m_isStoring = settings.value(QStringLiteral("SavePasswordsOnSites"), true).toBool(); + m_isAutoComplete = settings.value(QStringLiteral("AutoCompletePasswords"), true).toBool(); settings.endGroup(); } @@ -85,7 +85,7 @@ bool AutoFill::isStoringEnabled(const QUrl &url) } QSqlQuery query(SqlDatabase::instance()->database()); - query.prepare("SELECT count(id) FROM autofill_exceptions WHERE server=?"); + query.prepare(QStringLiteral("SELECT count(id) FROM autofill_exceptions WHERE server=?")); query.addBindValue(server); query.exec(); @@ -104,7 +104,7 @@ void AutoFill::blockStoringforUrl(const QUrl &url) } QSqlQuery query(SqlDatabase::instance()->database()); - query.prepare("INSERT INTO autofill_exceptions (server) VALUES (?)"); + query.prepare(QStringLiteral("INSERT INTO autofill_exceptions (server) VALUES (?)")); query.addBindValue(server); query.exec(); } @@ -253,26 +253,26 @@ QByteArray AutoFill::exportPasswords() stream.setAutoFormatting(true); stream.writeStartDocument(); - stream.writeStartElement("passwords"); - stream.writeAttribute("version", "1.0"); + stream.writeStartElement(QStringLiteral("passwords")); + stream.writeAttribute(QStringLiteral("version"), QStringLiteral("1.0")); QVector entries = m_manager->getAllEntries(); foreach (const PasswordEntry &entry, entries) { - stream.writeStartElement("entry"); - stream.writeTextElement("server", entry.host); - stream.writeTextElement("username", entry.username); - stream.writeTextElement("password", entry.password); - stream.writeTextElement("data", entry.data); + stream.writeStartElement(QStringLiteral("entry")); + stream.writeTextElement(QStringLiteral("server"), entry.host); + stream.writeTextElement(QStringLiteral("username"), entry.username); + stream.writeTextElement(QStringLiteral("password"), entry.password); + stream.writeTextElement(QStringLiteral("data"), entry.data); stream.writeEndElement(); } QSqlQuery query(SqlDatabase::instance()->database()); - query.prepare("SELECT server FROM autofill_exceptions"); + query.prepare(QStringLiteral("SELECT server FROM autofill_exceptions")); query.exec(); while (query.next()) { - stream.writeStartElement("exception"); - stream.writeTextElement("server", query.value(0).toString()); + stream.writeStartElement(QStringLiteral("exception")); + stream.writeTextElement(QStringLiteral("server"), query.value(0).toString()); stream.writeEndElement(); } @@ -345,12 +345,12 @@ bool AutoFill::importPasswords(const QByteArray &data) if (!server.isEmpty()) { QSqlQuery query(SqlDatabase::instance()->database()); - query.prepare("SELECT id FROM autofill_exceptions WHERE server=?"); + query.prepare(QStringLiteral("SELECT id FROM autofill_exceptions WHERE server=?")); query.addBindValue(server); query.exec(); if (!query.next()) { - query.prepare("INSERT INTO autofill_exceptions (server) VALUES (?)"); + query.prepare(QStringLiteral("INSERT INTO autofill_exceptions (server) VALUES (?)")); query.addBindValue(server); query.exec(); } diff --git a/src/lib/autofill/autofillicon.cpp b/src/lib/autofill/autofillicon.cpp index 02622546d..d688a78a5 100644 --- a/src/lib/autofill/autofillicon.cpp +++ b/src/lib/autofill/autofillicon.cpp @@ -29,7 +29,7 @@ AutoFillIcon::AutoFillIcon(QWidget* parent) setToolTip(AutoFillWidget::tr("Choose username to login")); setFocusPolicy(Qt::ClickFocus); - connect(this, SIGNAL(clicked(QPoint)), this, SLOT(iconClicked())); + connect(this, &ClickableLabel::clicked, this, &AutoFillIcon::iconClicked); } void AutoFillIcon::setWebView(WebView* view) diff --git a/src/lib/autofill/autofillnotification.cpp b/src/lib/autofill/autofillnotification.cpp index 3c8524aab..b769a5b2e 100644 --- a/src/lib/autofill/autofillnotification.cpp +++ b/src/lib/autofill/autofillnotification.cpp @@ -58,8 +58,8 @@ AutoFillNotification::AutoFillNotification(const QUrl &url, const PageFormData & } connect(ui->update, SIGNAL(clicked()), this, SLOT(update())); - connect(ui->remember, SIGNAL(clicked()), this, SLOT(remember())); - connect(ui->never, SIGNAL(clicked()), this, SLOT(never())); + connect(ui->remember, &QAbstractButton::clicked, this, &AutoFillNotification::remember); + connect(ui->never, &QAbstractButton::clicked, this, &AutoFillNotification::never); connect(ui->notnow, SIGNAL(clicked()), this, SLOT(hide())); connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(hide())); diff --git a/src/lib/autofill/passwordbackends/databaseencryptedpasswordbackend.cpp b/src/lib/autofill/passwordbackends/databaseencryptedpasswordbackend.cpp index e7dfe185f..68053a2a1 100644 --- a/src/lib/autofill/passwordbackends/databaseencryptedpasswordbackend.cpp +++ b/src/lib/autofill/passwordbackends/databaseencryptedpasswordbackend.cpp @@ -517,8 +517,8 @@ MasterPasswordDialog::MasterPasswordDialog(DatabaseEncryptedPasswordBackend* bac ui->currentPassword->setVisible(m_backend->isMasterPasswordSetted()); ui->labelCurrentPassword->setVisible(m_backend->isMasterPasswordSetted()); - connect(ui->setMasterPassword, SIGNAL(clicked()), this, SLOT(showSetMasterPasswordPage())); - connect(ui->clearMasterPassword, SIGNAL(clicked()), this, SLOT(clearMasterPasswordAndConvert())); + connect(ui->setMasterPassword, &QAbstractButton::clicked, this, &MasterPasswordDialog::showSetMasterPasswordPage); + connect(ui->clearMasterPassword, &QAbstractButton::clicked, this, &MasterPasswordDialog::clearMasterPasswordAndConvert); connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(ui->buttonBoxMasterPassword, SIGNAL(rejected()), this, SLOT(reject())); connect(ui->buttonBoxMasterPassword, SIGNAL(accepted()), this, SLOT(accept())); @@ -531,7 +531,7 @@ MasterPasswordDialog::~MasterPasswordDialog() void MasterPasswordDialog::delayedExec() { - QTimer::singleShot(0, this, SLOT(exec())); + QTimer::singleShot(0, this, &QDialog::exec); } void MasterPasswordDialog::accept() @@ -689,9 +689,9 @@ AskMasterPassword::AskMasterPassword(DatabaseEncryptedPasswordBackend* backend, verticalLayout->addWidget(m_buttonBox); setLayout(verticalLayout); - connect(m_lineEdit, SIGNAL(returnPressed()), this, SLOT(verifyPassword())); - connect(m_buttonBox, SIGNAL(accepted()), this, SLOT(verifyPassword())); - connect(m_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + connect(m_lineEdit, &QLineEdit::returnPressed, this, &AskMasterPassword::verifyPassword); + connect(m_buttonBox, &QDialogButtonBox::accepted, this, &AskMasterPassword::verifyPassword); + connect(m_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); setAttribute(Qt::WA_DeleteOnClose); } diff --git a/src/lib/bookmarks/bookmarks.cpp b/src/lib/bookmarks/bookmarks.cpp index cdaeb16d9..fd6d35e3e 100644 --- a/src/lib/bookmarks/bookmarks.cpp +++ b/src/lib/bookmarks/bookmarks.cpp @@ -34,7 +34,7 @@ Bookmarks::Bookmarks(QObject* parent) , m_autoSaver(nullptr) { m_autoSaver = new AutoSaver(this); - connect(m_autoSaver, SIGNAL(save()), this, SLOT(saveSettings())); + connect(m_autoSaver, &AutoSaver::save, this, &Bookmarks::saveSettings); init(); loadSettings(); diff --git a/src/lib/bookmarks/bookmarksexport/bookmarksexportdialog.cpp b/src/lib/bookmarks/bookmarksexport/bookmarksexportdialog.cpp index 780a6ea60..ccbd52e98 100644 --- a/src/lib/bookmarks/bookmarksexport/bookmarksexportdialog.cpp +++ b/src/lib/bookmarks/bookmarksexport/bookmarksexportdialog.cpp @@ -33,9 +33,9 @@ BookmarksExportDialog::BookmarksExportDialog(QWidget* parent) init(); - connect(ui->chooseOutput, SIGNAL(clicked()), this, SLOT(setPath())); - connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(exportBookmarks())); - connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(close())); + connect(ui->chooseOutput, &QAbstractButton::clicked, this, &BookmarksExportDialog::setPath); + connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &BookmarksExportDialog::exportBookmarks); + connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QWidget::close); } BookmarksExportDialog::~BookmarksExportDialog() diff --git a/src/lib/bookmarks/bookmarksexport/htmlexporter.cpp b/src/lib/bookmarks/bookmarksexport/htmlexporter.cpp index 6b2d1fbd2..a04588c9a 100644 --- a/src/lib/bookmarks/bookmarksexport/htmlexporter.cpp +++ b/src/lib/bookmarks/bookmarksexport/htmlexporter.cpp @@ -35,7 +35,7 @@ QString HtmlExporter::getPath(QWidget* parent) { const QString defaultPath = QDir::homePath() + QLatin1String("/bookmarks.html"); const QString filter = BookmarksExporter::tr("HTML Bookmarks") + QL1S(" (.html)"); - m_path = QzTools::getSaveFileName("HtmlExporter", parent, BookmarksExporter::tr("Choose file..."), defaultPath, filter); + m_path = QzTools::getSaveFileName(QStringLiteral("HtmlExporter"), parent, BookmarksExporter::tr("Choose file..."), defaultPath, filter); return m_path; } diff --git a/src/lib/bookmarks/bookmarksimport/bookmarksimportdialog.cpp b/src/lib/bookmarks/bookmarksimport/bookmarksimportdialog.cpp index c835b1821..4059c7236 100644 --- a/src/lib/bookmarks/bookmarksimport/bookmarksimportdialog.cpp +++ b/src/lib/bookmarks/bookmarksimport/bookmarksimportdialog.cpp @@ -44,10 +44,10 @@ BookmarksImportDialog::BookmarksImportDialog(QWidget* parent) ui->browserList->setCurrentRow(0); ui->treeView->setItemDelegate(new BookmarksItemDelegate(ui->treeView)); - connect(ui->nextButton, SIGNAL(clicked()), this, SLOT(nextPage())); - connect(ui->backButton, SIGNAL(clicked()), this, SLOT(previousPage())); - connect(ui->chooseFile, SIGNAL(clicked()), this, SLOT(setFile())); - connect(ui->cancelButton, SIGNAL(rejected()), this, SLOT(close())); + connect(ui->nextButton, &QAbstractButton::clicked, this, &BookmarksImportDialog::nextPage); + connect(ui->backButton, &QAbstractButton::clicked, this, &BookmarksImportDialog::previousPage); + connect(ui->chooseFile, &QAbstractButton::clicked, this, &BookmarksImportDialog::setFile); + connect(ui->cancelButton, &QDialogButtonBox::rejected, this, &QWidget::close); #ifndef Q_OS_WIN ui->browserList->setItemHidden(ui->browserList->item(IE), true); diff --git a/src/lib/bookmarks/bookmarksimport/firefoximporter.cpp b/src/lib/bookmarks/bookmarksimport/firefoximporter.cpp index b6b41eb86..179310f4f 100644 --- a/src/lib/bookmarks/bookmarksimport/firefoximporter.cpp +++ b/src/lib/bookmarks/bookmarksimport/firefoximporter.cpp @@ -54,7 +54,7 @@ QString FirefoxImporter::standardPath() const QString FirefoxImporter::getPath(QWidget* parent) { - m_path = QFileDialog::getOpenFileName(parent, BookmarksImporter::tr("Choose file..."), standardPath(), "Places (places.sqlite)"); + m_path = QFileDialog::getOpenFileName(parent, BookmarksImporter::tr("Choose file..."), standardPath(), QStringLiteral("Places (places.sqlite)")); return m_path; } @@ -64,7 +64,7 @@ bool FirefoxImporter::prepareImport() QSqlDatabase::removeDatabase(CONNECTION); // Create new connection - QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE", CONNECTION); + QSqlDatabase db = QSqlDatabase::addDatabase(QStringLiteral("QSQLITE"), CONNECTION); if (!QFile::exists(m_path)) { setError(BookmarksImportDialog::tr("File does not exist.")); @@ -86,10 +86,10 @@ BookmarkItem* FirefoxImporter::importBookmarks() QList items; BookmarkItem* root = new BookmarkItem(BookmarkItem::Folder); - root->setTitle("Firefox Import"); + root->setTitle(QStringLiteral("Firefox Import")); QSqlQuery query(QSqlDatabase::database(CONNECTION)); - query.prepare("SELECT id, parent, type, title, fk FROM moz_bookmarks WHERE fk NOT NULL OR type = 3"); + query.prepare(QStringLiteral("SELECT id, parent, type, title, fk FROM moz_bookmarks WHERE fk NOT NULL OR type = 3")); query.exec(); while (query.next()) { @@ -105,7 +105,7 @@ BookmarkItem* FirefoxImporter::importBookmarks() } QSqlQuery query(QSqlDatabase::database(CONNECTION)); - query.prepare("SELECT url FROM moz_places WHERE id=?"); + query.prepare(QStringLiteral("SELECT url FROM moz_places WHERE id=?")); query.addBindValue(fk); query.exec(); diff --git a/src/lib/bookmarks/bookmarksimport/htmlimporter.cpp b/src/lib/bookmarks/bookmarksimport/htmlimporter.cpp index da1270db6..4d161430b 100644 --- a/src/lib/bookmarks/bookmarksimport/htmlimporter.cpp +++ b/src/lib/bookmarks/bookmarksimport/htmlimporter.cpp @@ -35,7 +35,7 @@ QString HtmlImporter::description() const QString HtmlImporter::standardPath() const { - return QString(".htm, .html"); + return QStringLiteral(".htm, .html"); } QString HtmlImporter::getPath(QWidget* parent) @@ -95,7 +95,7 @@ BookmarkItem* HtmlImporter::importBookmarks() int start = bookmarks.indexOf(QLatin1String("

")); BookmarkItem* root = new BookmarkItem(BookmarkItem::Folder); - root->setTitle("HTML Import"); + root->setTitle(QStringLiteral("HTML Import")); QList folders; folders.append(root); diff --git a/src/lib/bookmarks/bookmarksimport/ieimporter.cpp b/src/lib/bookmarks/bookmarksimport/ieimporter.cpp index 5b5d59dfb..cd3048363 100644 --- a/src/lib/bookmarks/bookmarksimport/ieimporter.cpp +++ b/src/lib/bookmarks/bookmarksimport/ieimporter.cpp @@ -59,7 +59,7 @@ bool IeImporter::prepareImport() BookmarkItem* IeImporter::importBookmarks() { BookmarkItem* root = new BookmarkItem(BookmarkItem::Folder); - root->setTitle("Internet Explorer Import"); + root->setTitle(QStringLiteral("Internet Explorer Import")); readDir(QDir(m_path), root); return root; @@ -78,7 +78,7 @@ void IeImporter::readDir(const QDir &dir, BookmarkItem *parent) } else if (file.isFile()) { QSettings urlFile(file.absoluteFilePath(), QSettings::IniFormat); - const QUrl url = urlFile.value("InternetShortcut/URL").toUrl(); + const QUrl url = urlFile.value(QStringLiteral("InternetShortcut/URL")).toUrl(); BookmarkItem* item = new BookmarkItem(BookmarkItem::Url, parent); item->setTitle(file.baseName()); diff --git a/src/lib/bookmarks/bookmarksimport/operaimporter.cpp b/src/lib/bookmarks/bookmarksimport/operaimporter.cpp index 8a5752542..3d744030e 100644 --- a/src/lib/bookmarks/bookmarksimport/operaimporter.cpp +++ b/src/lib/bookmarks/bookmarksimport/operaimporter.cpp @@ -46,7 +46,7 @@ QString OperaImporter::standardPath() const QString OperaImporter::getPath(QWidget* parent) { - m_path = QFileDialog::getOpenFileName(parent, BookmarksImporter::tr("Choose file..."), standardPath(), "Bookmarks (*.adr)"); + m_path = QFileDialog::getOpenFileName(parent, BookmarksImporter::tr("Choose file..."), standardPath(), QStringLiteral("Bookmarks (*.adr)")); return m_path; } diff --git a/src/lib/bookmarks/bookmarksmanager.cpp b/src/lib/bookmarks/bookmarksmanager.cpp index bacbfcb29..acbb2f158 100644 --- a/src/lib/bookmarks/bookmarksmanager.cpp +++ b/src/lib/bookmarks/bookmarksmanager.cpp @@ -41,18 +41,18 @@ BookmarksManager::BookmarksManager(BrowserWindow* window, QWidget* parent) ui->setupUi(this); ui->tree->setViewType(BookmarksTreeView::BookmarksManagerViewType); - connect(ui->tree, SIGNAL(bookmarkActivated(BookmarkItem*)), this, SLOT(bookmarkActivated(BookmarkItem*))); - connect(ui->tree, SIGNAL(bookmarkCtrlActivated(BookmarkItem*)), this, SLOT(bookmarkCtrlActivated(BookmarkItem*))); - connect(ui->tree, SIGNAL(bookmarkShiftActivated(BookmarkItem*)), this, SLOT(bookmarkShiftActivated(BookmarkItem*))); + connect(ui->tree, &BookmarksTreeView::bookmarkActivated, this, &BookmarksManager::bookmarkActivated); + connect(ui->tree, &BookmarksTreeView::bookmarkCtrlActivated, this, &BookmarksManager::bookmarkCtrlActivated); + connect(ui->tree, &BookmarksTreeView::bookmarkShiftActivated, this, &BookmarksManager::bookmarkShiftActivated); connect(ui->tree, SIGNAL(bookmarksSelected(QList)), this, SLOT(bookmarksSelected(QList))); - connect(ui->tree, SIGNAL(contextMenuRequested(QPoint)), this, SLOT(createContextMenu(QPoint))); + connect(ui->tree, &BookmarksTreeView::contextMenuRequested, this, &BookmarksManager::createContextMenu); // Box for editing bookmarks updateEditBox(nullptr); - connect(ui->title, SIGNAL(textEdited(QString)), this, SLOT(bookmarkEdited())); - connect(ui->address, SIGNAL(textEdited(QString)), this, SLOT(bookmarkEdited())); - connect(ui->keyword, SIGNAL(textEdited(QString)), this, SLOT(bookmarkEdited())); - connect(ui->description, SIGNAL(textChanged()), this, SLOT(descriptionEdited())); + connect(ui->title, &QLineEdit::textEdited, this, &BookmarksManager::bookmarkEdited); + connect(ui->address, &QLineEdit::textEdited, this, &BookmarksManager::bookmarkEdited); + connect(ui->keyword, &QLineEdit::textEdited, this, &BookmarksManager::bookmarkEdited); + connect(ui->description, &QPlainTextEdit::textChanged, this, &BookmarksManager::descriptionEdited); } BookmarksManager::~BookmarksManager() @@ -108,15 +108,15 @@ void BookmarksManager::createContextMenu(const QPoint &pos) menu.addSeparator(); menu.addAction(tr("New Bookmark"), this, SLOT(addBookmark())); - menu.addAction(tr("New Folder"), this, SLOT(addFolder())); - menu.addAction(tr("New Separator"), this, SLOT(addSeparator())); + menu.addAction(tr("New Folder"), this, &BookmarksManager::addFolder); + menu.addAction(tr("New Separator"), this, &BookmarksManager::addSeparator); menu.addSeparator(); QAction* actDelete = menu.addAction(QIcon::fromTheme(QSL("edit-delete")), tr("Delete")); connect(actNewTab, SIGNAL(triggered()), this, SLOT(openBookmarkInNewTab())); connect(actNewWindow, SIGNAL(triggered()), this, SLOT(openBookmarkInNewWindow())); connect(actNewPrivateWindow, SIGNAL(triggered()), this, SLOT(openBookmarkInNewPrivateWindow())); - connect(actDelete, SIGNAL(triggered()), this, SLOT(deleteBookmarks())); + connect(actDelete, &QAction::triggered, this, &BookmarksManager::deleteBookmarks); bool canBeDeleted = false; QList items = ui->tree->selectedBookmarks(); @@ -279,7 +279,7 @@ void BookmarksManager::updateEditBox(BookmarkItem* item) m_blockDescriptionChangedSignal = false; // Prevent flickering - QTimer::singleShot(10, this, SLOT(enableUpdates())); + QTimer::singleShot(10, this, &BookmarksManager::enableUpdates); } bool BookmarksManager::bookmarkEditable(BookmarkItem* item) const diff --git a/src/lib/bookmarks/bookmarksmenu.cpp b/src/lib/bookmarks/bookmarksmenu.cpp index 4dd12a22e..187035bfa 100644 --- a/src/lib/bookmarks/bookmarksmenu.cpp +++ b/src/lib/bookmarks/bookmarksmenu.cpp @@ -33,9 +33,9 @@ BookmarksMenu::BookmarksMenu(QWidget* parent) { init(); - connect(mApp->bookmarks(), SIGNAL(bookmarkAdded(BookmarkItem*)), this, SLOT(bookmarksChanged())); - connect(mApp->bookmarks(), SIGNAL(bookmarkRemoved(BookmarkItem*)), this, SLOT(bookmarksChanged())); - connect(mApp->bookmarks(), SIGNAL(bookmarkChanged(BookmarkItem*)), this, SLOT(bookmarksChanged())); + connect(mApp->bookmarks(), &Bookmarks::bookmarkAdded, this, &BookmarksMenu::bookmarksChanged); + connect(mApp->bookmarks(), &Bookmarks::bookmarkRemoved, this, &BookmarksMenu::bookmarksChanged); + connect(mApp->bookmarks(), &Bookmarks::bookmarkChanged, this, &BookmarksMenu::bookmarksChanged); } void BookmarksMenu::setMainWindow(BrowserWindow* window) @@ -164,9 +164,9 @@ void BookmarksMenu::init() { setTitle(tr("&Bookmarks")); - addAction(tr("Bookmark &This Page"), this, SLOT(bookmarkPage()))->setShortcut(QKeySequence("Ctrl+D")); - addAction(tr("Bookmark &All Tabs"), this, SLOT(bookmarkAllTabs())); - addAction(QIcon::fromTheme("bookmarks-organize"), tr("Organize &Bookmarks"), this, SLOT(showBookmarksManager()))->setShortcut(QKeySequence("Ctrl+Shift+O")); + addAction(tr("Bookmark &This Page"), this, &BookmarksMenu::bookmarkPage)->setShortcut(QKeySequence("Ctrl+D")); + addAction(tr("Bookmark &All Tabs"), this, &BookmarksMenu::bookmarkAllTabs); + addAction(QIcon::fromTheme("bookmarks-organize"), tr("Organize &Bookmarks"), this, &BookmarksMenu::showBookmarksManager)->setShortcut(QKeySequence("Ctrl+Shift+O")); addSeparator(); connect(this, SIGNAL(aboutToShow()), this, SLOT(aboutToShow())); diff --git a/src/lib/bookmarks/bookmarksmodel.cpp b/src/lib/bookmarks/bookmarksmodel.cpp index 400128076..e0ded8daf 100644 --- a/src/lib/bookmarks/bookmarksmodel.cpp +++ b/src/lib/bookmarks/bookmarksmodel.cpp @@ -36,7 +36,7 @@ BookmarksModel::BookmarksModel(BookmarkItem* root, Bookmarks* bookmarks, QObject , m_bookmarks(bookmarks) { if (m_bookmarks) { - connect(m_bookmarks, SIGNAL(bookmarkChanged(BookmarkItem*)), this, SLOT(bookmarkChanged(BookmarkItem*))); + connect(m_bookmarks, &Bookmarks::bookmarkChanged, this, &BookmarksModel::bookmarkChanged); } #ifdef BOOKMARKSMODEL_DEBUG @@ -321,7 +321,7 @@ BookmarksFilterModel::BookmarksFilterModel(QAbstractItemModel* parent) m_filterTimer->setSingleShot(true); m_filterTimer->setInterval(300); - connect(m_filterTimer, SIGNAL(timeout()), this, SLOT(startFiltering())); + connect(m_filterTimer, &QTimer::timeout, this, &BookmarksFilterModel::startFiltering); } void BookmarksFilterModel::setFilterFixedString(const QString &pattern) diff --git a/src/lib/bookmarks/bookmarkstoolbar.cpp b/src/lib/bookmarks/bookmarkstoolbar.cpp index 259c33868..a89d77451 100644 --- a/src/lib/bookmarks/bookmarkstoolbar.cpp +++ b/src/lib/bookmarks/bookmarkstoolbar.cpp @@ -51,14 +51,14 @@ BookmarksToolbar::BookmarksToolbar(BrowserWindow* window, QWidget* parent) m_updateTimer = new QTimer(this); m_updateTimer->setInterval(300); m_updateTimer->setSingleShot(true); - connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(refresh())); + connect(m_updateTimer, &QTimer::timeout, this, &BookmarksToolbar::refresh); - connect(m_bookmarks, SIGNAL(bookmarkAdded(BookmarkItem*)), this, SLOT(bookmarksChanged())); - connect(m_bookmarks, SIGNAL(bookmarkRemoved(BookmarkItem*)), this, SLOT(bookmarksChanged())); - connect(m_bookmarks, SIGNAL(bookmarkChanged(BookmarkItem*)), this, SLOT(bookmarksChanged())); - connect(m_bookmarks, SIGNAL(showOnlyIconsInToolbarChanged(bool)), this, SLOT(showOnlyIconsChanged(bool))); - connect(m_bookmarks, SIGNAL(showOnlyTextInToolbarChanged(bool)), this, SLOT(showOnlyTextChanged(bool))); - connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequested(QPoint))); + connect(m_bookmarks, &Bookmarks::bookmarkAdded, this, &BookmarksToolbar::bookmarksChanged); + connect(m_bookmarks, &Bookmarks::bookmarkRemoved, this, &BookmarksToolbar::bookmarksChanged); + connect(m_bookmarks, &Bookmarks::bookmarkChanged, this, &BookmarksToolbar::bookmarksChanged); + connect(m_bookmarks, &Bookmarks::showOnlyIconsInToolbarChanged, this, &BookmarksToolbar::showOnlyIconsChanged); + connect(m_bookmarks, &Bookmarks::showOnlyTextInToolbarChanged, this, &BookmarksToolbar::showOnlyTextChanged); + connect(this, &QWidget::customContextMenuRequested, this, &BookmarksToolbar::contextMenuRequested); refresh(); } @@ -79,17 +79,17 @@ void BookmarksToolbar::contextMenuRequested(const QPoint &pos) m_actShowOnlyIcons = menu.addAction(tr("Show Only Icons")); m_actShowOnlyIcons->setCheckable(true); m_actShowOnlyIcons->setChecked(m_bookmarks->showOnlyIconsInToolbar()); - connect(m_actShowOnlyIcons, SIGNAL(toggled(bool)), m_bookmarks, SLOT(setShowOnlyIconsInToolbar(bool))); + connect(m_actShowOnlyIcons, &QAction::toggled, m_bookmarks, &Bookmarks::setShowOnlyIconsInToolbar); m_actShowOnlyText = menu.addAction(tr("Show Only Text")); m_actShowOnlyText->setCheckable(true); m_actShowOnlyText->setChecked(m_bookmarks->showOnlyTextInToolbar()); - connect(m_actShowOnlyText, SIGNAL(toggled(bool)), m_bookmarks, SLOT(setShowOnlyTextInToolbar(bool))); + connect(m_actShowOnlyText, &QAction::toggled, m_bookmarks, &Bookmarks::setShowOnlyTextInToolbar); - connect(actNewTab, SIGNAL(triggered()), this, SLOT(openBookmarkInNewTab())); - connect(actNewWindow, SIGNAL(triggered()), this, SLOT(openBookmarkInNewWindow())); - connect(actNewPrivateWindow, SIGNAL(triggered()), this, SLOT(openBookmarkInNewPrivateWindow())); - connect(actEdit, SIGNAL(triggered()), this, SLOT(editBookmark())); - connect(actDelete, SIGNAL(triggered()), this, SLOT(deleteBookmark())); + connect(actNewTab, &QAction::triggered, this, &BookmarksToolbar::openBookmarkInNewTab); + connect(actNewWindow, &QAction::triggered, this, &BookmarksToolbar::openBookmarkInNewWindow); + connect(actNewPrivateWindow, &QAction::triggered, this, &BookmarksToolbar::openBookmarkInNewPrivateWindow); + connect(actEdit, &QAction::triggered, this, &BookmarksToolbar::editBookmark); + connect(actDelete, &QAction::triggered, this, &BookmarksToolbar::deleteBookmark); actEdit->setEnabled(m_clickedBookmark && m_bookmarks->canBeModified(m_clickedBookmark)); actDelete->setEnabled(m_clickedBookmark && m_bookmarks->canBeModified(m_clickedBookmark)); diff --git a/src/lib/bookmarks/bookmarkstools.cpp b/src/lib/bookmarks/bookmarkstools.cpp index ae72e11cb..1dab9fba4 100644 --- a/src/lib/bookmarks/bookmarkstools.cpp +++ b/src/lib/bookmarks/bookmarkstools.cpp @@ -75,7 +75,7 @@ void BookmarksFoldersMenu::createMenu(QMenu* menu, BookmarkItem* parent) { QAction* act = menu->addAction(tr("Choose %1").arg(parent->title())); act->setData(QVariant::fromValue(static_cast(parent))); - connect(act, SIGNAL(triggered()), this, SLOT(folderChoosed())); + connect(act, &QAction::triggered, this, &BookmarksFoldersMenu::folderChoosed); menu->addSeparator(); @@ -96,7 +96,7 @@ BookmarksFoldersButton::BookmarksFoldersButton(QWidget* parent, BookmarkItem* fo { init(); - connect(m_menu, SIGNAL(folderSelected(BookmarkItem*)), this, SLOT(setSelectedFolder(BookmarkItem*))); + connect(m_menu, &BookmarksFoldersMenu::folderSelected, this, &BookmarksFoldersButton::setSelectedFolder); } BookmarkItem* BookmarksFoldersButton::selectedFolder() const @@ -141,8 +141,8 @@ bool BookmarksTools::addBookmarkDialog(QWidget* parent, const QUrl &url, const Q QDialogButtonBox* box = new QDialogButtonBox(dialog); box->addButton(QDialogButtonBox::Ok); box->addButton(QDialogButtonBox::Cancel); - QObject::connect(box, SIGNAL(rejected()), dialog, SLOT(reject())); - QObject::connect(box, SIGNAL(accepted()), dialog, SLOT(accept())); + QObject::connect(box, &QDialogButtonBox::rejected, dialog, &QDialog::reject); + QObject::connect(box, &QDialogButtonBox::accepted, dialog, &QDialog::accept); layout->addWidget(label); layout->addWidget(edit); @@ -186,8 +186,8 @@ bool BookmarksTools::bookmarkAllTabsDialog(QWidget* parent, TabWidget* tabWidget QDialogButtonBox* box = new QDialogButtonBox(dialog); box->addButton(QDialogButtonBox::Ok); box->addButton(QDialogButtonBox::Cancel); - QObject::connect(box, SIGNAL(rejected()), dialog, SLOT(reject())); - QObject::connect(box, SIGNAL(accepted()), dialog, SLOT(accept())); + QObject::connect(box, &QDialogButtonBox::rejected, dialog, &QDialog::reject); + QObject::connect(box, &QDialogButtonBox::accepted, dialog, &QDialog::accept); layout->addWidget(label); layout->addWidget(folderButton); diff --git a/src/lib/bookmarks/bookmarkswidget.cpp b/src/lib/bookmarks/bookmarkswidget.cpp index f06652004..44f6433b6 100644 --- a/src/lib/bookmarks/bookmarkswidget.cpp +++ b/src/lib/bookmarks/bookmarkswidget.cpp @@ -123,20 +123,20 @@ void BookmarksWidget::init() Q_ASSERT(m_bookmark->parent()); ui->folderButton->setSelectedFolder(m_bookmark->parent()); - connect(ui->folderButton, SIGNAL(selectedFolderChanged(BookmarkItem*)), SLOT(bookmarkEdited())); + connect(ui->folderButton, &BookmarksFoldersButton::selectedFolderChanged, this, &BookmarksWidget::bookmarkEdited); } - connect(ui->speeddialButton, SIGNAL(clicked()), this, SLOT(toggleSpeedDial())); - connect(ui->bookmarksButton, SIGNAL(clicked()), this, SLOT(toggleBookmark())); + connect(ui->speeddialButton, &QAbstractButton::clicked, this, &BookmarksWidget::toggleSpeedDial); + connect(ui->bookmarksButton, &QAbstractButton::clicked, this, &BookmarksWidget::toggleBookmark); } void BookmarksWidget::closePopup() { // Prevent clicking again on buttons while popup is being closed - disconnect(ui->speeddialButton, SIGNAL(clicked()), this, SLOT(toggleSpeedDial())); - disconnect(ui->bookmarksButton, SIGNAL(clicked()), this, SLOT(toggleBookmark())); + disconnect(ui->speeddialButton, &QAbstractButton::clicked, this, &BookmarksWidget::toggleSpeedDial); + disconnect(ui->bookmarksButton, &QAbstractButton::clicked, this, &BookmarksWidget::toggleBookmark); - QTimer::singleShot(HIDE_DELAY, this, SLOT(close())); + QTimer::singleShot(HIDE_DELAY, this, &QWidget::close); } diff --git a/src/lib/cookies/cookiemanager.cpp b/src/lib/cookies/cookiemanager.cpp index 6fb0348f2..49d782488 100644 --- a/src/lib/cookies/cookiemanager.cpp +++ b/src/lib/cookies/cookiemanager.cpp @@ -50,19 +50,19 @@ CookieManager::CookieManager(QWidget *parent) } // Stored Cookies - connect(ui->cookieTree, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*))); - connect(ui->removeAll, SIGNAL(clicked()), this, SLOT(removeAll())); - connect(ui->removeOne, SIGNAL(clicked()), this, SLOT(remove())); - connect(ui->close, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); - connect(ui->close2, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); - connect(ui->close3, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); - connect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString))); + connect(ui->cookieTree, &QTreeWidget::currentItemChanged, this, &CookieManager::currentItemChanged); + connect(ui->removeAll, &QAbstractButton::clicked, this, &CookieManager::removeAll); + connect(ui->removeOne, &QAbstractButton::clicked, this, &CookieManager::remove); + connect(ui->close, &QDialogButtonBox::clicked, this, &QWidget::close); + connect(ui->close2, &QDialogButtonBox::clicked, this, &QWidget::close); + connect(ui->close3, &QDialogButtonBox::clicked, this, &QWidget::close); + connect(ui->search, &QLineEdit::textChanged, this, &CookieManager::filterString); // Cookie Filtering - connect(ui->whiteAdd, SIGNAL(clicked()), this, SLOT(addWhitelist())); - connect(ui->whiteRemove, SIGNAL(clicked()), this, SLOT(removeWhitelist())); + connect(ui->whiteAdd, &QAbstractButton::clicked, this, &CookieManager::addWhitelist); + connect(ui->whiteRemove, &QAbstractButton::clicked, this, &CookieManager::removeWhitelist); connect(ui->blackAdd, SIGNAL(clicked()), this, SLOT(addBlacklist())); - connect(ui->blackRemove, SIGNAL(clicked()), this, SLOT(removeBlacklist())); + connect(ui->blackRemove, &QAbstractButton::clicked, this, &CookieManager::removeBlacklist); // Cookie Settings Settings settings; @@ -89,9 +89,9 @@ CookieManager::CookieManager(QWidget *parent) ui->blackList->setSortingEnabled(true); QShortcut* removeShortcut = new QShortcut(QKeySequence("Del"), this); - connect(removeShortcut, SIGNAL(activated()), this, SLOT(deletePressed())); + connect(removeShortcut, &QShortcut::activated, this, &CookieManager::deletePressed); - connect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString))); + connect(ui->search, &QLineEdit::textChanged, this, &CookieManager::filterString); connect(mApp->cookieJar(), &CookieJar::cookieAdded, this, &CookieManager::addCookie); connect(mApp->cookieJar(), &CookieJar::cookieRemoved, this, &CookieManager::removeCookie); diff --git a/src/lib/downloads/downloaditem.cpp b/src/lib/downloads/downloaditem.cpp index 48400300b..5d00cd4c6 100644 --- a/src/lib/downloads/downloaditem.cpp +++ b/src/lib/downloads/downloaditem.cpp @@ -72,8 +72,8 @@ DownloadItem::DownloadItem(QListWidgetItem *item, QWebEngineDownloadItem* downlo setContextMenuPolicy(Qt::CustomContextMenu); connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint))); - connect(ui->button, SIGNAL(clicked(QPoint)), this, SLOT(stop())); - connect(manager, SIGNAL(resized(QSize)), this, SLOT(parentResized(QSize))); + connect(ui->button, &ClickableLabel::clicked, this, &DownloadItem::stop); + connect(manager, &DownloadManager::resized, this, &DownloadItem::parentResized); } void DownloadItem::startDownloading() @@ -279,14 +279,14 @@ void DownloadItem::mouseDoubleClickEvent(QMouseEvent* e) void DownloadItem::customContextMenuRequested(const QPoint &pos) { QMenu menu; - menu.addAction(QIcon::fromTheme("document-open"), tr("Open File"), this, SLOT(openFile())); + menu.addAction(QIcon::fromTheme("document-open"), tr("Open File"), this, &DownloadItem::openFile); - menu.addAction(tr("Open Folder"), this, SLOT(openFolder())); + menu.addAction(tr("Open Folder"), this, &DownloadItem::openFolder); menu.addSeparator(); - menu.addAction(QIcon::fromTheme("edit-copy"), tr("Copy Download Link"), this, SLOT(copyDownloadLink())); + menu.addAction(QIcon::fromTheme("edit-copy"), tr("Copy Download Link"), this, &DownloadItem::copyDownloadLink); menu.addSeparator(); - menu.addAction(QIcon::fromTheme("process-stop"), tr("Cancel downloading"), this, SLOT(stop()))->setEnabled(m_downloading); - menu.addAction(QIcon::fromTheme("list-remove"), tr("Remove From List"), this, SLOT(clear()))->setEnabled(!m_downloading); + menu.addAction(QIcon::fromTheme("process-stop"), tr("Cancel downloading"), this, &DownloadItem::stop)->setEnabled(m_downloading); + menu.addAction(QIcon::fromTheme("list-remove"), tr("Remove From List"), this, &DownloadItem::clear)->setEnabled(!m_downloading); if (m_downloading || ui->downloadInfo->text().startsWith(tr("Cancelled")) || ui->downloadInfo->text().startsWith(tr("Error"))) { menu.actions().at(0)->setEnabled(false); diff --git a/src/lib/downloads/downloadmanager.cpp b/src/lib/downloads/downloadmanager.cpp index 8d38d7244..683a6584d 100644 --- a/src/lib/downloads/downloadmanager.cpp +++ b/src/lib/downloads/downloadmanager.cpp @@ -65,10 +65,10 @@ DownloadManager::DownloadManager(QWidget* parent) ui->clearButton->setIcon(QIcon::fromTheme("edit-clear")); QzTools::centerWidgetOnScreen(this); - connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clearList())); + connect(ui->clearButton, &QAbstractButton::clicked, this, &DownloadManager::clearList); QShortcut* clearShortcut = new QShortcut(QKeySequence("CTRL+L"), this); - connect(clearShortcut, SIGNAL(activated()), this, SLOT(clearList())); + connect(clearShortcut, &QShortcut::activated, this, &DownloadManager::clearList); loadSettings(); @@ -400,8 +400,8 @@ void DownloadManager::download(QWebEngineDownloadItem *downloadItem) DownloadItem* downItem = new DownloadItem(listItem, downloadItem, QFileInfo(downloadPath).absolutePath(), QFileInfo(downloadPath).fileName(), openFile, this); downItem->setDownTimer(downloadTimer); downItem->startDownloading(); - connect(downItem, SIGNAL(deleteItem(DownloadItem*)), this, SLOT(deleteItem(DownloadItem*))); - connect(downItem, SIGNAL(downloadFinished(bool)), this, SLOT(downloadFinished(bool))); + connect(downItem, &DownloadItem::deleteItem, this, &DownloadManager::deleteItem); + connect(downItem, &DownloadItem::downloadFinished, this, &DownloadManager::downloadFinished); ui->list->setItemWidget(listItem, downItem); listItem->setSizeHint(downItem->sizeHint()); downItem->show(); diff --git a/src/lib/downloads/downloadoptionsdialog.cpp b/src/lib/downloads/downloadoptionsdialog.cpp index 0a893fd0b..95c16645a 100644 --- a/src/lib/downloads/downloadoptionsdialog.cpp +++ b/src/lib/downloads/downloadoptionsdialog.cpp @@ -50,8 +50,8 @@ DownloadOptionsDialog::DownloadOptionsDialog(const QString &fileName, QWebEngine ui->buttonBox->setFocus(); - connect(ui->copyDownloadLink, SIGNAL(clicked(QPoint)), this, SLOT(copyDownloadLink())); - connect(this, SIGNAL(finished(int)), this, SLOT(emitDialogFinished(int))); + connect(ui->copyDownloadLink, &ClickableLabel::clicked, this, &DownloadOptionsDialog::copyDownloadLink); + connect(this, &QDialog::finished, this, &DownloadOptionsDialog::emitDialogFinished); } void DownloadOptionsDialog::showExternalManagerOption(bool show) diff --git a/src/lib/history/historymanager.cpp b/src/lib/history/historymanager.cpp index b006c8061..774f31ba6 100644 --- a/src/lib/history/historymanager.cpp +++ b/src/lib/history/historymanager.cpp @@ -38,13 +38,13 @@ HistoryManager::HistoryManager(BrowserWindow* window, QWidget* parent) ui->setupUi(this); ui->historyTree->setViewType(HistoryTreeView::HistoryManagerViewType); - connect(ui->historyTree, SIGNAL(urlActivated(QUrl)), this, SLOT(urlActivated(QUrl))); - connect(ui->historyTree, SIGNAL(urlCtrlActivated(QUrl)), this, SLOT(urlCtrlActivated(QUrl))); - connect(ui->historyTree, SIGNAL(urlShiftActivated(QUrl)), this, SLOT(urlShiftActivated(QUrl))); - connect(ui->historyTree, SIGNAL(contextMenuRequested(QPoint)), this, SLOT(createContextMenu(QPoint))); + connect(ui->historyTree, &HistoryTreeView::urlActivated, this, &HistoryManager::urlActivated); + connect(ui->historyTree, &HistoryTreeView::urlCtrlActivated, this, &HistoryManager::urlCtrlActivated); + connect(ui->historyTree, &HistoryTreeView::urlShiftActivated, this, &HistoryManager::urlShiftActivated); + connect(ui->historyTree, &HistoryTreeView::contextMenuRequested, this, &HistoryManager::createContextMenu); - connect(ui->deleteB, SIGNAL(clicked()), ui->historyTree, SLOT(removeSelectedItems())); - connect(ui->clearAll, SIGNAL(clicked()), this, SLOT(clearHistory())); + connect(ui->deleteB, &QAbstractButton::clicked, ui->historyTree, &HistoryTreeView::removeSelectedItems); + connect(ui->clearAll, &QAbstractButton::clicked, this, &HistoryManager::clearHistory); ui->historyTree->setFocus(); } @@ -147,8 +147,8 @@ void HistoryManager::createContextMenu(const QPoint &pos) QAction* actNewPrivateWindow = menu.addAction(IconProvider::privateBrowsingIcon(), tr("Open in new private window")); menu.addSeparator(); - QAction* actCopyUrl = menu.addAction(tr("Copy url"), this, SLOT(copyUrl())); - QAction* actCopyTitle = menu.addAction(tr("Copy title"), this, SLOT(copyTitle())); + QAction* actCopyUrl = menu.addAction(tr("Copy url"), this, &HistoryManager::copyUrl); + QAction* actCopyTitle = menu.addAction(tr("Copy title"), this, &HistoryManager::copyTitle); menu.addSeparator(); QAction* actDelete = menu.addAction(QIcon::fromTheme(QSL("edit-delete")), tr("Delete")); @@ -156,7 +156,7 @@ void HistoryManager::createContextMenu(const QPoint &pos) connect(actNewTab, SIGNAL(triggered()), this, SLOT(openUrlInNewTab())); connect(actNewWindow, SIGNAL(triggered()), this, SLOT(openUrlInNewWindow())); connect(actNewPrivateWindow, SIGNAL(triggered()), this, SLOT(openUrlInNewPrivateWindow())); - connect(actDelete, SIGNAL(triggered()), ui->historyTree, SLOT(removeSelectedItems())); + connect(actDelete, &QAction::triggered, ui->historyTree, &HistoryTreeView::removeSelectedItems); if (ui->historyTree->selectedUrl().isEmpty()) { actNewTab->setDisabled(true); diff --git a/src/lib/history/historymenu.cpp b/src/lib/history/historymenu.cpp index cbc601e0f..5ad585750 100644 --- a/src/lib/history/historymenu.cpp +++ b/src/lib/history/historymenu.cpp @@ -101,9 +101,9 @@ void HistoryMenu::aboutToShow() Action* act = new Action(title); act->setData(url); act->setIcon(IconProvider::iconForUrl(url)); - connect(act, SIGNAL(triggered()), this, SLOT(historyEntryActivated())); - connect(act, SIGNAL(ctrlTriggered()), this, SLOT(historyEntryCtrlActivated())); - connect(act, SIGNAL(shiftTriggered()), this, SLOT(historyEntryShiftActivated())); + connect(act, &QAction::triggered, this, &HistoryMenu::historyEntryActivated); + connect(act, &Action::ctrlTriggered, this, &HistoryMenu::historyEntryCtrlActivated); + connect(act, &Action::shiftTriggered, this, &HistoryMenu::historyEntryShiftActivated); addAction(act); } } @@ -125,9 +125,9 @@ void HistoryMenu::aboutToShowMostVisited() Action* act = new Action(QzTools::truncatedText(entry.title, 40)); act->setData(entry.url); act->setIcon(IconProvider::iconForUrl(entry.url)); - connect(act, SIGNAL(triggered()), this, SLOT(historyEntryActivated())); - connect(act, SIGNAL(ctrlTriggered()), this, SLOT(historyEntryCtrlActivated())); - connect(act, SIGNAL(shiftTriggered()), this, SLOT(historyEntryShiftActivated())); + connect(act, &QAction::triggered, this, &HistoryMenu::historyEntryActivated); + connect(act, &Action::ctrlTriggered, this, &HistoryMenu::historyEntryCtrlActivated); + connect(act, &Action::shiftTriggered, this, &HistoryMenu::historyEntryShiftActivated); m_menuMostVisited->addAction(act); } @@ -158,8 +158,8 @@ void HistoryMenu::aboutToShowClosedTabs() } else { m_menuClosedTabs->addSeparator(); - m_menuClosedTabs->addAction(tr("Restore All Closed Tabs"), tabWidget, SLOT(restoreAllClosedTabs())); - m_menuClosedTabs->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear list"), tabWidget, SLOT(clearClosedTabsList())); + m_menuClosedTabs->addAction(tr("Restore All Closed Tabs"), tabWidget, &TabWidget::restoreAllClosedTabs); + m_menuClosedTabs->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear list"), tabWidget, &TabWidget::clearClosedTabsList); } } @@ -173,7 +173,7 @@ void HistoryMenu::aboutToShowClosedWindows() for (int i = 0; i < closedWindows.count(); ++i) { const ClosedWindowsManager::Window window = closedWindows.at(i); const QString title = QzTools::truncatedText(window.title, 40); - QAction *act = m_menuClosedWindows->addAction(window.icon, title, manager, SLOT(restoreClosedWindow())); + QAction *act = m_menuClosedWindows->addAction(window.icon, title, manager, &ClosedWindowsManager::restoreClosedWindow); if (i == 0) { act->setShortcut(QKeySequence(QSL("Ctrl+Shift+N"))); act->setShortcutContext(Qt::WidgetShortcut); @@ -186,8 +186,8 @@ void HistoryMenu::aboutToShowClosedWindows() m_menuClosedWindows->addAction(tr("Empty"))->setEnabled(false); } else { m_menuClosedWindows->addSeparator(); - m_menuClosedWindows->addAction(tr("Restore All Closed Windows"), manager, SLOT(restoreAllClosedWindows())); - m_menuClosedWindows->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear list"), manager, SLOT(clearClosedWindows())); + m_menuClosedWindows->addAction(tr("Restore All Closed Windows"), manager, &ClosedWindowsManager::restoreAllClosedWindows); + m_menuClosedWindows->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear list"), manager, &ClosedWindowsManager::clearClosedWindows); } } @@ -235,16 +235,16 @@ void HistoryMenu::init() { setTitle(tr("Hi&story")); - QAction* act = addAction(IconProvider::standardIcon(QStyle::SP_ArrowBack), tr("&Back"), this, SLOT(goBack())); + QAction* act = addAction(IconProvider::standardIcon(QStyle::SP_ArrowBack), tr("&Back"), this, &HistoryMenu::goBack); act->setShortcut(QzTools::actionShortcut(QKeySequence::Back, Qt::ALT + Qt::Key_Left, QKeySequence::Forward, Qt::ALT + Qt::Key_Right)); - act = addAction(IconProvider::standardIcon(QStyle::SP_ArrowForward), tr("&Forward"), this, SLOT(goForward())); + act = addAction(IconProvider::standardIcon(QStyle::SP_ArrowForward), tr("&Forward"), this, &HistoryMenu::goForward); act->setShortcut(QzTools::actionShortcut(QKeySequence::Forward, Qt::ALT + Qt::Key_Right, QKeySequence::Back, Qt::ALT + Qt::Key_Left)); - act = addAction(QIcon::fromTheme("go-home"), tr("&Home"), this, SLOT(goHome())); + act = addAction(QIcon::fromTheme("go-home"), tr("&Home"), this, &HistoryMenu::goHome); act->setShortcut(QKeySequence(Qt::ALT + Qt::Key_Home)); - act = addAction(QIcon::fromTheme("deep-history", QIcon(":/icons/menu/history.svg")), tr("Show &All History"), this, SLOT(showHistoryManager())); + act = addAction(QIcon::fromTheme("deep-history", QIcon(":/icons/menu/history.svg")), tr("Show &All History"), this, &HistoryMenu::showHistoryManager); act->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_H)); addSeparator(); @@ -253,10 +253,10 @@ void HistoryMenu::init() connect(this, SIGNAL(aboutToHide()), this, SLOT(aboutToHide())); m_menuMostVisited = new Menu(tr("Most Visited"), this); - connect(m_menuMostVisited, SIGNAL(aboutToShow()), this, SLOT(aboutToShowMostVisited())); + connect(m_menuMostVisited, &QMenu::aboutToShow, this, &HistoryMenu::aboutToShowMostVisited); m_menuClosedTabs = new Menu(tr("Closed Tabs")); - connect(m_menuClosedTabs, SIGNAL(aboutToShow()), this, SLOT(aboutToShowClosedTabs())); + connect(m_menuClosedTabs, &QMenu::aboutToShow, this, &HistoryMenu::aboutToShowClosedTabs); m_menuClosedWindows = new Menu(tr("Closed Windows")); connect(m_menuClosedWindows, &QMenu::aboutToShow, this, &HistoryMenu::aboutToShowClosedWindows); diff --git a/src/lib/history/historymodel.cpp b/src/lib/history/historymodel.cpp index 630a20e95..ad01535d1 100644 --- a/src/lib/history/historymodel.cpp +++ b/src/lib/history/historymodel.cpp @@ -42,10 +42,10 @@ HistoryModel::HistoryModel(History* history) { init(); - connect(m_history, SIGNAL(resetHistory()), this, SLOT(resetHistory())); - connect(m_history, SIGNAL(historyEntryAdded(HistoryEntry)), this, SLOT(historyEntryAdded(HistoryEntry))); - connect(m_history, SIGNAL(historyEntryDeleted(HistoryEntry)), this, SLOT(historyEntryDeleted(HistoryEntry))); - connect(m_history, SIGNAL(historyEntryEdited(HistoryEntry,HistoryEntry)), this, SLOT(historyEntryEdited(HistoryEntry,HistoryEntry))); + connect(m_history, &History::resetHistory, this, &HistoryModel::resetHistory); + connect(m_history, &History::historyEntryAdded, this, &HistoryModel::historyEntryAdded); + connect(m_history, &History::historyEntryDeleted, this, &HistoryModel::historyEntryDeleted); + connect(m_history, &History::historyEntryEdited, this, &HistoryModel::historyEntryEdited); } QVariant HistoryModel::headerData(int section, Qt::Orientation orientation, int role) const @@ -522,7 +522,7 @@ HistoryFilterModel::HistoryFilterModel(QAbstractItemModel* parent) m_filterTimer->setSingleShot(true); m_filterTimer->setInterval(300); - connect(m_filterTimer, SIGNAL(timeout()), this, SLOT(startFiltering())); + connect(m_filterTimer, &QTimer::timeout, this, &HistoryFilterModel::startFiltering); } void HistoryFilterModel::setFilterFixedString(const QString &pattern) diff --git a/src/lib/history/historytreeview.cpp b/src/lib/history/historytreeview.cpp index e14e87e38..4b99e5b63 100644 --- a/src/lib/history/historytreeview.cpp +++ b/src/lib/history/historytreeview.cpp @@ -42,8 +42,8 @@ HistoryTreeView::HistoryTreeView(QWidget* parent) m_header->setSectionHidden(4, true); setHeader(m_header); - connect(m_filter, SIGNAL(expandAllItems()), this, SLOT(expandAll())); - connect(m_filter, SIGNAL(collapseAllItems()), this, SLOT(collapseAll())); + connect(m_filter, &HistoryFilterModel::expandAllItems, this, &QTreeView::expandAll); + connect(m_filter, &HistoryFilterModel::collapseAllItems, this, &QTreeView::collapseAll); } HistoryTreeView::ViewType HistoryTreeView::viewType() const diff --git a/src/lib/navigation/completer/locationcompleter.cpp b/src/lib/navigation/completer/locationcompleter.cpp index 35d834fbc..ed0452376 100644 --- a/src/lib/navigation/completer/locationcompleter.cpp +++ b/src/lib/navigation/completer/locationcompleter.cpp @@ -82,7 +82,7 @@ void LocationCompleter::complete(const QString &string) emit cancelRefreshJob(); LocationCompleterRefreshJob* job = new LocationCompleterRefreshJob(trimmedStr); - connect(job, SIGNAL(finished()), this, SLOT(refreshJobFinished())); + connect(job, &LocationCompleterRefreshJob::finished, this, &LocationCompleter::refreshJobFinished); connect(this, SIGNAL(cancelRefreshJob()), job, SLOT(jobCancelled())); if (qzSettings->searchFromAddressBar && qzSettings->showABSearchSuggestions && trimmedStr.length() >= 2) { @@ -165,14 +165,14 @@ void LocationCompleter::slotPopupClosed() m_popupClosed = true; m_oldSuggestions.clear(); - disconnect(s_view, SIGNAL(closed()), this, SLOT(slotPopupClosed())); - disconnect(s_view, SIGNAL(indexActivated(QModelIndex)), this, SLOT(indexActivated(QModelIndex))); - disconnect(s_view, SIGNAL(indexCtrlActivated(QModelIndex)), this, SLOT(indexCtrlActivated(QModelIndex))); - disconnect(s_view, SIGNAL(indexShiftActivated(QModelIndex)), this, SLOT(indexShiftActivated(QModelIndex))); - disconnect(s_view, SIGNAL(indexDeleteRequested(QModelIndex)), this, SLOT(indexDeleteRequested(QModelIndex))); + disconnect(s_view, &LocationCompleterView::closed, this, &LocationCompleter::slotPopupClosed); + disconnect(s_view, &LocationCompleterView::indexActivated, this, &LocationCompleter::indexActivated); + disconnect(s_view, &LocationCompleterView::indexCtrlActivated, this, &LocationCompleter::indexCtrlActivated); + disconnect(s_view, &LocationCompleterView::indexShiftActivated, this, &LocationCompleter::indexShiftActivated); + disconnect(s_view, &LocationCompleterView::indexDeleteRequested, this, &LocationCompleter::indexDeleteRequested); disconnect(s_view, &LocationCompleterView::loadRequested, this, &LocationCompleter::loadRequested); disconnect(s_view, &LocationCompleterView::searchEnginesDialogRequested, this, &LocationCompleter::openSearchEnginesDialog); - disconnect(s_view->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(currentChanged(QModelIndex))); + disconnect(s_view->selectionModel(), &QItemSelectionModel::currentChanged, this, &LocationCompleter::currentChanged); emit popupClosed(); } @@ -404,14 +404,14 @@ void LocationCompleter::showPopup() s_view->setFocusProxy(m_locationBar); s_view->setCurrentIndex(QModelIndex()); - connect(s_view, SIGNAL(closed()), this, SLOT(slotPopupClosed())); - connect(s_view, SIGNAL(indexActivated(QModelIndex)), this, SLOT(indexActivated(QModelIndex))); - connect(s_view, SIGNAL(indexCtrlActivated(QModelIndex)), this, SLOT(indexCtrlActivated(QModelIndex))); - connect(s_view, SIGNAL(indexShiftActivated(QModelIndex)), this, SLOT(indexShiftActivated(QModelIndex))); - connect(s_view, SIGNAL(indexDeleteRequested(QModelIndex)), this, SLOT(indexDeleteRequested(QModelIndex))); + connect(s_view, &LocationCompleterView::closed, this, &LocationCompleter::slotPopupClosed); + connect(s_view, &LocationCompleterView::indexActivated, this, &LocationCompleter::indexActivated); + connect(s_view, &LocationCompleterView::indexCtrlActivated, this, &LocationCompleter::indexCtrlActivated); + connect(s_view, &LocationCompleterView::indexShiftActivated, this, &LocationCompleter::indexShiftActivated); + connect(s_view, &LocationCompleterView::indexDeleteRequested, this, &LocationCompleter::indexDeleteRequested); connect(s_view, &LocationCompleterView::loadRequested, this, &LocationCompleter::loadRequested); connect(s_view, &LocationCompleterView::searchEnginesDialogRequested, this, &LocationCompleter::openSearchEnginesDialog); - connect(s_view->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(currentChanged(QModelIndex))); + connect(s_view->selectionModel(), &QItemSelectionModel::currentChanged, this, &LocationCompleter::currentChanged); s_view->createWinId(); s_view->windowHandle()->setTransientParent(m_window->windowHandle()); diff --git a/src/lib/navigation/completer/locationcompleterrefreshjob.cpp b/src/lib/navigation/completer/locationcompleterrefreshjob.cpp index 22687bb46..34c40877c 100644 --- a/src/lib/navigation/completer/locationcompleterrefreshjob.cpp +++ b/src/lib/navigation/completer/locationcompleterrefreshjob.cpp @@ -38,7 +38,7 @@ LocationCompleterRefreshJob::LocationCompleterRefreshJob(const QString &searchSt , m_jobCancelled(false) { m_watcher = new QFutureWatcher(this); - connect(m_watcher, SIGNAL(finished()), this, SLOT(slotFinished())); + connect(m_watcher, &QFutureWatcherBase::finished, this, &LocationCompleterRefreshJob::slotFinished); QFuture future = QtConcurrent::run(this, &LocationCompleterRefreshJob::runJob); m_watcher->setFuture(future); diff --git a/src/lib/navigation/locationbar.cpp b/src/lib/navigation/locationbar.cpp index 138d5d433..cb2c1d8b9 100644 --- a/src/lib/navigation/locationbar.cpp +++ b/src/lib/navigation/locationbar.cpp @@ -72,9 +72,9 @@ LocationBar::LocationBar(QWidget *parent) m_completer = new LocationCompleter(this); m_completer->setLocationBar(this); - connect(m_completer, SIGNAL(showCompletion(QString,bool)), this, SLOT(showCompletion(QString,bool))); - connect(m_completer, SIGNAL(showDomainCompletion(QString)), this, SLOT(showDomainCompletion(QString))); - connect(m_completer, SIGNAL(clearCompletion()), this, SLOT(clearCompletion())); + connect(m_completer, &LocationCompleter::showCompletion, this, &LocationBar::showCompletion); + connect(m_completer, &LocationCompleter::showDomainCompletion, this, &LocationBar::showDomainCompletion); + connect(m_completer, &LocationCompleter::clearCompletion, this, &LocationBar::clearCompletion); connect(m_completer, &LocationCompleter::loadRequested, this, &LocationBar::loadRequest); connect(m_completer, &LocationCompleter::popupClosed, this, &LocationBar::updateSiteIcon); @@ -91,14 +91,14 @@ LocationBar::LocationBar(QWidget *parent) editAction(PasteAndGo)->setText(tr("Paste And &Go")); editAction(PasteAndGo)->setIcon(QIcon::fromTheme(QSL("edit-paste"))); - connect(editAction(PasteAndGo), SIGNAL(triggered()), this, SLOT(pasteAndGo())); + connect(editAction(PasteAndGo), &QAction::triggered, this, &LocationBar::pasteAndGo); connect(this, SIGNAL(textEdited(QString)), this, SLOT(textEdited(QString))); - connect(m_goIcon, SIGNAL(clicked(QPoint)), this, SLOT(requestLoadUrl())); - connect(down, SIGNAL(clicked(QPoint)), m_completer, SLOT(showMostVisited())); - connect(mApp->searchEnginesManager(), SIGNAL(activeEngineChanged()), this, SLOT(updatePlaceHolderText())); - connect(mApp->searchEnginesManager(), SIGNAL(defaultEngineChanged()), this, SLOT(updatePlaceHolderText())); - connect(mApp, SIGNAL(settingsReloaded()), SLOT(loadSettings())); + connect(m_goIcon, &ClickableLabel::clicked, this, &LocationBar::requestLoadUrl); + connect(down, &ClickableLabel::clicked, m_completer, &LocationCompleter::showMostVisited); + connect(mApp->searchEnginesManager(), &SearchEnginesManager::activeEngineChanged, this, &LocationBar::updatePlaceHolderText); + connect(mApp->searchEnginesManager(), &SearchEnginesManager::defaultEngineChanged, this, &LocationBar::updatePlaceHolderText); + connect(mApp, &MainApplication::settingsReloaded, this, &LocationBar::loadSettings); loadSettings(); @@ -108,7 +108,7 @@ LocationBar::LocationBar(QWidget *parent) m_goIcon->setVisible(qzSettings->alwaysShowGoIcon); m_autofillIcon->hide(); - QTimer::singleShot(0, this, SLOT(updatePlaceHolderText())); + QTimer::singleShot(0, this, &LocationBar::updatePlaceHolderText); } BrowserWindow *LocationBar::browserWindow() const @@ -136,11 +136,11 @@ void LocationBar::setWebView(TabbedWebView* view) m_siteIcon->setWebView(m_webView); m_autofillIcon->setWebView(m_webView); - connect(m_webView, SIGNAL(loadStarted()), SLOT(loadStarted())); - connect(m_webView, SIGNAL(loadProgress(int)), SLOT(loadProgress(int))); - connect(m_webView, SIGNAL(loadFinished(bool)), SLOT(loadFinished())); - connect(m_webView, SIGNAL(urlChanged(QUrl)), this, SLOT(showUrl(QUrl))); - connect(m_webView, SIGNAL(privacyChanged(bool)), this, SLOT(setPrivacyState(bool))); + connect(m_webView, &QWebEngineView::loadStarted, this, &LocationBar::loadStarted); + connect(m_webView, &QWebEngineView::loadProgress, this, &LocationBar::loadProgress); + connect(m_webView, &QWebEngineView::loadFinished, this, &LocationBar::loadFinished); + connect(m_webView, &QWebEngineView::urlChanged, this, &LocationBar::showUrl); + connect(m_webView, &WebView::privacyChanged, this, &LocationBar::setPrivacyState); } void LocationBar::setText(const QString &text) diff --git a/src/lib/navigation/navigationbar.cpp b/src/lib/navigation/navigationbar.cpp index 88294b297..1ec89dbc1 100644 --- a/src/lib/navigation/navigationbar.cpp +++ b/src/lib/navigation/navigationbar.cpp @@ -120,12 +120,12 @@ NavigationBar::NavigationBar(BrowserWindow* window) m_menuBack = new Menu(this); m_menuBack->setCloseOnMiddleClick(true); m_buttonBack->setMenu(m_menuBack); - connect(m_buttonBack, SIGNAL(aboutToShowMenu()), this, SLOT(aboutToShowHistoryBackMenu())); + connect(m_buttonBack, &ToolButton::aboutToShowMenu, this, &NavigationBar::aboutToShowHistoryBackMenu); m_menuForward = new Menu(this); m_menuForward->setCloseOnMiddleClick(true); m_buttonForward->setMenu(m_menuForward); - connect(m_buttonForward, SIGNAL(aboutToShowMenu()), this, SLOT(aboutToShowHistoryNextMenu())); + connect(m_buttonForward, &ToolButton::aboutToShowMenu, this, &NavigationBar::aboutToShowHistoryNextMenu); ToolButton *buttonTools = new ToolButton(this); buttonTools->setObjectName("navigation-button-tools"); @@ -169,23 +169,23 @@ NavigationBar::NavigationBar(BrowserWindow* window) m_exitFullscreen->setVisible(false); setContextMenuPolicy(Qt::CustomContextMenu); - connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequested(QPoint))); + connect(this, &QWidget::customContextMenuRequested, this, &NavigationBar::contextMenuRequested); - connect(m_buttonBack, SIGNAL(clicked()), this, SLOT(goBack())); - connect(m_buttonBack, SIGNAL(middleMouseClicked()), this, SLOT(goBackInNewTab())); - connect(m_buttonBack, SIGNAL(controlClicked()), this, SLOT(goBackInNewTab())); - connect(m_buttonForward, SIGNAL(clicked()), this, SLOT(goForward())); - connect(m_buttonForward, SIGNAL(middleMouseClicked()), this, SLOT(goForwardInNewTab())); - connect(m_buttonForward, SIGNAL(controlClicked()), this, SLOT(goForwardInNewTab())); + connect(m_buttonBack, &QAbstractButton::clicked, this, &NavigationBar::goBack); + connect(m_buttonBack, &ToolButton::middleMouseClicked, this, &NavigationBar::goBackInNewTab); + connect(m_buttonBack, &ToolButton::controlClicked, this, &NavigationBar::goBackInNewTab); + connect(m_buttonForward, &QAbstractButton::clicked, this, &NavigationBar::goForward); + connect(m_buttonForward, &ToolButton::middleMouseClicked, this, &NavigationBar::goForwardInNewTab); + connect(m_buttonForward, &ToolButton::controlClicked, this, &NavigationBar::goForwardInNewTab); - connect(m_reloadStop, SIGNAL(stopClicked()), this, SLOT(stop())); - connect(m_reloadStop, SIGNAL(reloadClicked()), this, SLOT(reload())); - connect(buttonHome, SIGNAL(clicked()), m_window, SLOT(goHome())); - connect(buttonHome, SIGNAL(middleMouseClicked()), m_window, SLOT(goHomeInNewTab())); - connect(buttonHome, SIGNAL(controlClicked()), m_window, SLOT(goHomeInNewTab())); - connect(buttonAddTab, SIGNAL(clicked()), m_window, SLOT(addTab())); - connect(buttonAddTab, SIGNAL(middleMouseClicked()), m_window->tabWidget(), SLOT(addTabFromClipboard())); - connect(m_exitFullscreen, SIGNAL(clicked(bool)), m_window, SLOT(toggleFullScreen())); + connect(m_reloadStop, &ReloadStopButton::stopClicked, this, &NavigationBar::stop); + connect(m_reloadStop, &ReloadStopButton::reloadClicked, this, &NavigationBar::reload); + connect(buttonHome, &QAbstractButton::clicked, m_window, &BrowserWindow::goHome); + connect(buttonHome, &ToolButton::middleMouseClicked, m_window, &BrowserWindow::goHomeInNewTab); + connect(buttonHome, &ToolButton::controlClicked, m_window, &BrowserWindow::goHomeInNewTab); + connect(buttonAddTab, &QAbstractButton::clicked, m_window, &BrowserWindow::addTab); + connect(buttonAddTab, &ToolButton::middleMouseClicked, m_window->tabWidget(), &TabWidget::addTabFromClipboard); + connect(m_exitFullscreen, &QAbstractButton::clicked, m_window, &BrowserWindow::toggleFullScreen); addWidget(backNextWidget, QSL("button-backforward"), tr("Back and Forward buttons")); addWidget(m_reloadStop, QSL("button-reloadstop"), tr("Reload button")); @@ -378,7 +378,7 @@ void NavigationBar::aboutToShowHistoryBackMenu() const QIcon icon = iconForPage(item.url(), IconProvider::standardIcon(QStyle::SP_ArrowBack)); Action* act = new Action(icon, title); act->setData(i); - connect(act, SIGNAL(triggered()), this, SLOT(loadHistoryIndex())); + connect(act, &QAction::triggered, this, &NavigationBar::loadHistoryIndex); connect(act, SIGNAL(ctrlTriggered()), this, SLOT(loadHistoryIndexInNewTab())); m_menuBack->addAction(act); } @@ -390,7 +390,7 @@ void NavigationBar::aboutToShowHistoryBackMenu() } m_menuBack->addSeparator(); - m_menuBack->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear history"), this, SLOT(clearHistory())); + m_menuBack->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear history"), this, &NavigationBar::clearHistory); } void NavigationBar::aboutToShowHistoryNextMenu() @@ -412,7 +412,7 @@ void NavigationBar::aboutToShowHistoryNextMenu() const QIcon icon = iconForPage(item.url(), IconProvider::standardIcon(QStyle::SP_ArrowForward)); Action* act = new Action(icon, title); act->setData(i); - connect(act, SIGNAL(triggered()), this, SLOT(loadHistoryIndex())); + connect(act, &QAction::triggered, this, &NavigationBar::loadHistoryIndex); connect(act, SIGNAL(ctrlTriggered()), this, SLOT(loadHistoryIndexInNewTab())); m_menuForward->addAction(act); } @@ -424,7 +424,7 @@ void NavigationBar::aboutToShowHistoryNextMenu() } m_menuForward->addSeparator(); - m_menuForward->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear history"), this, SLOT(clearHistory())); + m_menuForward->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear history"), this, &NavigationBar::clearHistory); } void NavigationBar::aboutToShowToolsMenu() @@ -447,7 +447,7 @@ void NavigationBar::aboutToShowToolsMenu() } m_menuTools->addSeparator(); - m_menuTools->addAction(IconProvider::settingsIcon(), tr("Configure Toolbar"), this, SLOT(openConfigurationDialog())); + m_menuTools->addAction(IconProvider::settingsIcon(), tr("Configure Toolbar"), this, &NavigationBar::openConfigurationDialog); } void NavigationBar::clearHistory() @@ -461,7 +461,7 @@ void NavigationBar::contextMenuRequested(const QPoint &pos) QMenu menu; m_window->createToolbarsMenu(&menu); menu.addSeparator(); - menu.addAction(IconProvider::settingsIcon(), tr("Configure Toolbar"), this, SLOT(openConfigurationDialog())); + menu.addAction(IconProvider::settingsIcon(), tr("Configure Toolbar"), this, &NavigationBar::openConfigurationDialog); menu.exec(mapToGlobal(pos)); } diff --git a/src/lib/navigation/reloadstopbutton.cpp b/src/lib/navigation/reloadstopbutton.cpp index efe57f1aa..ce48006c9 100644 --- a/src/lib/navigation/reloadstopbutton.cpp +++ b/src/lib/navigation/reloadstopbutton.cpp @@ -32,9 +32,9 @@ ReloadStopButton::ReloadStopButton(QWidget* parent) m_updateTimer = new QTimer(this); m_updateTimer->setInterval(50); m_updateTimer->setSingleShot(true); - connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(updateButton())); + connect(m_updateTimer, &QTimer::timeout, this, &ReloadStopButton::updateButton); - connect(this, SIGNAL(clicked()), this, SLOT(buttonClicked())); + connect(this, &QAbstractButton::clicked, this, &ReloadStopButton::buttonClicked); updateButton(); } diff --git a/src/lib/navigation/siteicon.cpp b/src/lib/navigation/siteicon.cpp index c487311cd..49cb69bb2 100644 --- a/src/lib/navigation/siteicon.cpp +++ b/src/lib/navigation/siteicon.cpp @@ -43,7 +43,7 @@ SiteIcon::SiteIcon(LocationBar *parent) m_updateTimer = new QTimer(this); m_updateTimer->setInterval(100); m_updateTimer->setSingleShot(true); - connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(updateIcon())); + connect(m_updateTimer, &QTimer::timeout, this, &SiteIcon::updateIcon); } void SiteIcon::setBrowserWindow(BrowserWindow *window) @@ -173,7 +173,7 @@ bool SiteIcon::showPopup() SiteInfoWidget* info = new SiteInfoWidget(m_window); info->showAt(parentWidget()); - connect(info, SIGNAL(destroyed()), this, SLOT(popupClosed())); + connect(info, &QObject::destroyed, this, &SiteIcon::popupClosed); return true; } diff --git a/src/lib/navigation/websearchbar.cpp b/src/lib/navigation/websearchbar.cpp index 518748037..09add2d59 100644 --- a/src/lib/navigation/websearchbar.cpp +++ b/src/lib/navigation/websearchbar.cpp @@ -75,14 +75,14 @@ WebSearchBar::WebSearchBar(BrowserWindow* window) addWidget(m_buttonSearch, LineEdit::RightSide); - connect(m_buttonSearch, SIGNAL(clicked(QPoint)), this, SLOT(search())); - connect(m_buttonSearch, SIGNAL(middleClicked(QPoint)), this, SLOT(searchInNewTab())); - connect(m_boxSearchType, SIGNAL(activeItemChanged(ButtonWithMenu::Item)), this, SLOT(searchChanged(ButtonWithMenu::Item))); + connect(m_buttonSearch, &ClickableLabel::clicked, this, &WebSearchBar::search); + connect(m_buttonSearch, &ClickableLabel::middleClicked, this, &WebSearchBar::searchInNewTab); + connect(m_boxSearchType, &ButtonWithMenu::activeItemChanged, this, &WebSearchBar::searchChanged); setWidgetSpacing(0); m_searchManager = mApp->searchEnginesManager(); - connect(m_boxSearchType->menu(), SIGNAL(aboutToShow()), this, SLOT(aboutToShowMenu())); + connect(m_boxSearchType->menu(), &QMenu::aboutToShow, this, &WebSearchBar::aboutToShowMenu); m_completer = new QCompleter(this); m_completer->setCompletionMode(QCompleter::UnfilteredPopupCompletion); @@ -94,14 +94,14 @@ WebSearchBar::WebSearchBar(BrowserWindow* window) m_openSearchEngine = new OpenSearchEngine(this); m_openSearchEngine->setNetworkAccessManager(mApp->networkManager()); - connect(m_openSearchEngine, SIGNAL(suggestions(QStringList)), this, SLOT(addSuggestions(QStringList))); - connect(this, SIGNAL(textEdited(QString)), m_openSearchEngine, SLOT(requestSuggestions(QString))); + connect(m_openSearchEngine, &OpenSearchEngine::suggestions, this, &WebSearchBar::addSuggestions); + connect(this, &QLineEdit::textEdited, m_openSearchEngine, &OpenSearchEngine::requestSuggestions); editAction(PasteAndGo)->setText(tr("Paste And &Search")); editAction(PasteAndGo)->setIcon(QIcon::fromTheme(QSL("edit-paste"))); - connect(editAction(PasteAndGo), SIGNAL(triggered()), this, SLOT(pasteAndGo())); + connect(editAction(PasteAndGo), &QAction::triggered, this, &WebSearchBar::pasteAndGo); - QTimer::singleShot(0, this, SLOT(setupEngines())); + QTimer::singleShot(0, this, &WebSearchBar::setupEngines); } void WebSearchBar::aboutToShowMenu() @@ -123,11 +123,11 @@ void WebSearchBar::aboutToShowMenu() if (title.isEmpty()) title = m_window->weView()->title(); - menu->addAction(m_window->weView()->icon(), tr("Add %1 ...").arg(title), this, SLOT(addEngineFromAction()))->setData(url); + menu->addAction(m_window->weView()->icon(), tr("Add %1 ...").arg(title), this, &WebSearchBar::addEngineFromAction)->setData(url); } menu->addSeparator(); - menu->addAction(IconProvider::settingsIcon(), tr("Manage Search Engines"), this, SLOT(openSearchEnginesDialog())); + menu->addAction(IconProvider::settingsIcon(), tr("Manage Search Engines"), this, &WebSearchBar::openSearchEnginesDialog); }); } @@ -163,7 +163,7 @@ void WebSearchBar::enableSearchSuggestions(bool enable) void WebSearchBar::setupEngines() { - disconnect(m_searchManager, SIGNAL(enginesChanged()), this, SLOT(setupEngines())); + disconnect(m_searchManager, &SearchEnginesManager::enginesChanged, this, &WebSearchBar::setupEngines); m_reloadingEngines = true; QString activeEngine = m_searchManager->startingEngineName(); @@ -191,7 +191,7 @@ void WebSearchBar::setupEngines() searchChanged(m_boxSearchType->currentItem()); - connect(m_searchManager, SIGNAL(enginesChanged()), this, SLOT(setupEngines())); + connect(m_searchManager, &SearchEnginesManager::enginesChanged, this, &WebSearchBar::setupEngines); m_reloadingEngines = false; } @@ -259,12 +259,12 @@ void WebSearchBar::contextMenuEvent(QContextMenuEvent* event) QAction* act = menu->addAction(tr("Show suggestions")); act->setCheckable(true); act->setChecked(qzSettings->showWSBSearchSuggestions); - connect(act, SIGNAL(triggered(bool)), this, SLOT(enableSearchSuggestions(bool))); + connect(act, &QAction::triggered, this, &WebSearchBar::enableSearchSuggestions); QAction* instantSearch = menu->addAction(tr("Search when engine changed")); instantSearch->setCheckable(true); instantSearch->setChecked(qzSettings->searchOnEngineChange); - connect(instantSearch, SIGNAL(triggered(bool)), this, SLOT(instantSearchChanged(bool))); + connect(instantSearch, &QAction::triggered, this, &WebSearchBar::instantSearchChanged); // Prevent choosing first option with double rightclick QPoint pos = event->globalPos(); diff --git a/src/lib/network/networkmanager.cpp b/src/lib/network/networkmanager.cpp index 0c28c857a..ce34ac44a 100644 --- a/src/lib/network/networkmanager.cpp +++ b/src/lib/network/networkmanager.cpp @@ -126,8 +126,8 @@ void NetworkManager::authentication(const QUrl &url, QAuthenticator *auth, QWidg QDialogButtonBox* box = new QDialogButtonBox(dialog); box->addButton(QDialogButtonBox::Ok); box->addButton(QDialogButtonBox::Cancel); - connect(box, SIGNAL(rejected()), dialog, SLOT(reject())); - connect(box, SIGNAL(accepted()), dialog, SLOT(accept())); + connect(box, &QDialogButtonBox::rejected, dialog, &QDialog::reject); + connect(box, &QDialogButtonBox::accepted, dialog, &QDialog::accept); label->setText(tr("A username and password are being requested by %1. " "The site says: \"%2\"").arg(url.host(), auth->realm().toHtmlEscaped())); @@ -210,8 +210,8 @@ void NetworkManager::proxyAuthentication(const QString &proxyHost, QAuthenticato QDialogButtonBox* box = new QDialogButtonBox(dialog); box->addButton(QDialogButtonBox::Ok); box->addButton(QDialogButtonBox::Cancel); - connect(box, SIGNAL(rejected()), dialog, SLOT(reject())); - connect(box, SIGNAL(accepted()), dialog, SLOT(accept())); + connect(box, &QDialogButtonBox::rejected, dialog, &QDialog::reject); + connect(box, &QDialogButtonBox::accepted, dialog, &QDialog::accept); label->setText(tr("A username and password are being requested by proxy %1. ").arg(proxyHost)); formLa->addRow(label); diff --git a/src/lib/network/sslerrordialog.cpp b/src/lib/network/sslerrordialog.cpp index 6dd5f6af5..e6b63fcb2 100644 --- a/src/lib/network/sslerrordialog.cpp +++ b/src/lib/network/sslerrordialog.cpp @@ -32,7 +32,7 @@ SslErrorDialog::SslErrorDialog(QWidget* parent) //ui->buttonBox->addButton(tr("Only for this session"), QDialogButtonBox::ApplyRole); ui->buttonBox->button(QDialogButtonBox::No)->setFocus(); - connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(buttonClicked(QAbstractButton*))); + connect(ui->buttonBox, &QDialogButtonBox::clicked, this, &SslErrorDialog::buttonClicked); } SslErrorDialog::~SslErrorDialog() diff --git a/src/lib/notifications/desktopnotification.cpp b/src/lib/notifications/desktopnotification.cpp index b1f3f4e1c..b55a98d1d 100644 --- a/src/lib/notifications/desktopnotification.cpp +++ b/src/lib/notifications/desktopnotification.cpp @@ -33,7 +33,7 @@ DesktopNotification::DesktopNotification(bool setPosition) setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint); m_timer->setSingleShot(true); - connect(m_timer, SIGNAL(timeout()), this, SLOT(close())); + connect(m_timer, &QTimer::timeout, this, &QWidget::close); if (m_settingPosition) { setCursor(Qt::OpenHandCursor); diff --git a/src/lib/opensearch/editsearchengine.cpp b/src/lib/opensearch/editsearchengine.cpp index e3116e23f..25a5683a2 100644 --- a/src/lib/opensearch/editsearchengine.cpp +++ b/src/lib/opensearch/editsearchengine.cpp @@ -28,7 +28,7 @@ EditSearchEngine::EditSearchEngine(const QString &title, QWidget* parent) setWindowTitle(title); ui->setupUi(this); - connect(ui->iconFromFile, SIGNAL(clicked()), this, SLOT(chooseIcon())); + connect(ui->iconFromFile, &QAbstractButton::clicked, this, &EditSearchEngine::chooseIcon); ui->buttonBox->setFocus(); diff --git a/src/lib/opensearch/opensearchengine.cpp b/src/lib/opensearch/opensearchengine.cpp index d339d8809..092f0f1ed 100644 --- a/src/lib/opensearch/opensearchengine.cpp +++ b/src/lib/opensearch/opensearchengine.cpp @@ -427,7 +427,7 @@ void OpenSearchEngine::loadImage() const } QNetworkReply* reply = m_networkAccessManager->get(QNetworkRequest(QUrl::fromEncoded(m_imageUrl.toUtf8()))); - connect(reply, SIGNAL(finished()), this, SLOT(imageObtained())); + connect(reply, &QNetworkReply::finished, this, &OpenSearchEngine::imageObtained); } void OpenSearchEngine::imageObtained() @@ -583,7 +583,7 @@ void OpenSearchEngine::requestSuggestions(const QString &searchTerm) m_suggestionsReply = m_networkAccessManager->post(QNetworkRequest(suggestionsUrl(searchTerm)), data); } - connect(m_suggestionsReply, SIGNAL(finished()), this, SLOT(suggestionsObtained())); + connect(m_suggestionsReply, &QNetworkReply::finished, this, &OpenSearchEngine::suggestionsObtained); } /*! diff --git a/src/lib/opensearch/searchenginesdialog.cpp b/src/lib/opensearch/searchenginesdialog.cpp index ba13ae7ac..7f6f7375b 100644 --- a/src/lib/opensearch/searchenginesdialog.cpp +++ b/src/lib/opensearch/searchenginesdialog.cpp @@ -32,15 +32,15 @@ SearchEnginesDialog::SearchEnginesDialog(QWidget* parent) ui->setupUi(this); - connect(ui->add, SIGNAL(clicked()), this, SLOT(addEngine())); - connect(ui->remove, SIGNAL(clicked()), this, SLOT(removeEngine())); - connect(ui->edit, SIGNAL(clicked()), this, SLOT(editEngine())); - connect(ui->setAsDefault, SIGNAL(clicked()), this, SLOT(setDefaultEngine())); - connect(ui->defaults, SIGNAL(clicked()), this, SLOT(defaults())); - connect(ui->moveUp, SIGNAL(clicked()), this, SLOT(moveUp())); - connect(ui->moveDown, SIGNAL(clicked()), this, SLOT(moveDown())); + connect(ui->add, &QAbstractButton::clicked, this, &SearchEnginesDialog::addEngine); + connect(ui->remove, &QAbstractButton::clicked, this, &SearchEnginesDialog::removeEngine); + connect(ui->edit, &QAbstractButton::clicked, this, &SearchEnginesDialog::editEngine); + connect(ui->setAsDefault, &QAbstractButton::clicked, this, &SearchEnginesDialog::setDefaultEngine); + connect(ui->defaults, &QAbstractButton::clicked, this, &SearchEnginesDialog::defaults); + connect(ui->moveUp, &QAbstractButton::clicked, this, &SearchEnginesDialog::moveUp); + connect(ui->moveDown, &QAbstractButton::clicked, this, &SearchEnginesDialog::moveDown); - connect(ui->treeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(editEngine())); + connect(ui->treeWidget, &QTreeWidget::itemDoubleClicked, this, &SearchEnginesDialog::editEngine); ui->treeWidget->setItemDelegate(new RemoveItemFocusDelegate(ui->treeWidget)); ui->treeWidget->sortByColumn(-1); diff --git a/src/lib/opensearch/searchenginesmanager.cpp b/src/lib/opensearch/searchenginesmanager.cpp index e634d28aa..723a37c98 100644 --- a/src/lib/opensearch/searchenginesmanager.cpp +++ b/src/lib/opensearch/searchenginesmanager.cpp @@ -75,7 +75,7 @@ SearchEnginesManager::SearchEnginesManager(QObject* parent) m_defaultEngineName = settings.value("DefaultEngine", "DuckDuckGo").toString(); settings.endGroup(); - connect(this, SIGNAL(enginesChanged()), this, SLOT(scheduleSave())); + connect(this, &SearchEnginesManager::enginesChanged, this, &SearchEnginesManager::scheduleSave); } void SearchEnginesManager::loadSettings() @@ -357,7 +357,7 @@ void SearchEnginesManager::addEngine(OpenSearchEngine* engine) addEngine(en); - connect(engine, SIGNAL(imageChanged()), this, SLOT(engineChangedImage())); + connect(engine, &OpenSearchEngine::imageChanged, this, &SearchEnginesManager::engineChangedImage); } void SearchEnginesManager::addEngine(const QUrl &url) @@ -372,7 +372,7 @@ void SearchEnginesManager::addEngine(const QUrl &url) QNetworkReply* reply = mApp->networkManager()->get(QNetworkRequest(url)); reply->setParent(this); - connect(reply, SIGNAL(finished()), this, SLOT(replyFinished())); + connect(reply, &QNetworkReply::finished, this, &SearchEnginesManager::replyFinished); } void SearchEnginesManager::replyFinished() diff --git a/src/lib/other/browsinglibrary.cpp b/src/lib/other/browsinglibrary.cpp index 0ad6d9712..4dd5667da 100644 --- a/src/lib/other/browsinglibrary.cpp +++ b/src/lib/other/browsinglibrary.cpp @@ -58,12 +58,12 @@ BrowsingLibrary::BrowsingLibrary(BrowserWindow* window, QWidget* parent) ui->tabs->setFocus(); QMenu* m = new QMenu(this); - m->addAction(tr("Import Bookmarks..."), this, SLOT(importBookmarks())); - m->addAction(tr("Export Bookmarks..."), this, SLOT(exportBookmarks())); + m->addAction(tr("Import Bookmarks..."), this, &BrowsingLibrary::importBookmarks); + m->addAction(tr("Export Bookmarks..."), this, &BrowsingLibrary::exportBookmarks); ui->importExport->setMenu(m); connect(ui->tabs, &FancyTabWidget::CurrentChanged, ui->searchLine, &QLineEdit::clear); - connect(ui->searchLine, SIGNAL(textChanged(QString)), this, SLOT(search())); + connect(ui->searchLine, &QLineEdit::textChanged, this, &BrowsingLibrary::search); QzTools::setWmClass("Browsing Library", this); } diff --git a/src/lib/other/clearprivatedata.cpp b/src/lib/other/clearprivatedata.cpp index 3df5020d6..d39991077 100644 --- a/src/lib/other/clearprivatedata.cpp +++ b/src/lib/other/clearprivatedata.cpp @@ -47,10 +47,10 @@ ClearPrivateData::ClearPrivateData(QWidget* parent) ui->setupUi(this); ui->buttonBox->setFocus(); - connect(ui->history, SIGNAL(clicked(bool)), this, SLOT(historyClicked(bool))); - connect(ui->clear, SIGNAL(clicked(bool)), this, SLOT(dialogAccepted())); - connect(ui->optimizeDb, SIGNAL(clicked(bool)), this, SLOT(optimizeDb())); - connect(ui->editCookies, SIGNAL(clicked()), this, SLOT(showCookieManager())); + connect(ui->history, &QAbstractButton::clicked, this, &ClearPrivateData::historyClicked); + connect(ui->clear, &QAbstractButton::clicked, this, &ClearPrivateData::dialogAccepted); + connect(ui->optimizeDb, &QAbstractButton::clicked, this, &ClearPrivateData::optimizeDb); + connect(ui->editCookies, &QAbstractButton::clicked, this, &ClearPrivateData::showCookieManager); Settings settings; settings.beginGroup("ClearPrivateData"); @@ -153,7 +153,7 @@ void ClearPrivateData::dialogAccepted() ui->clear->setEnabled(false); ui->clear->setText(tr("Done")); - QTimer::singleShot(1000, this, SLOT(close())); + QTimer::singleShot(1000, this, &QWidget::close); } void ClearPrivateData::optimizeDb() diff --git a/src/lib/other/iconchooser.cpp b/src/lib/other/iconchooser.cpp index ba66e6fbe..39cc28aa7 100644 --- a/src/lib/other/iconchooser.cpp +++ b/src/lib/other/iconchooser.cpp @@ -32,8 +32,8 @@ IconChooser::IconChooser(QWidget* parent) ui->iconList->setItemDelegate(new IconChooserDelegate(ui->iconList)); - connect(ui->chooseFile, SIGNAL(clicked()), this, SLOT(chooseFile())); - connect(ui->siteUrl, SIGNAL(textChanged(QString)), this, SLOT(searchIcon(QString))); + connect(ui->chooseFile, &QAbstractButton::clicked, this, &IconChooser::chooseFile); + connect(ui->siteUrl, &QLineEdit::textChanged, this, &IconChooser::searchIcon); } void IconChooser::chooseFile() diff --git a/src/lib/other/licenseviewer.cpp b/src/lib/other/licenseviewer.cpp index b49152892..32dedb0b5 100644 --- a/src/lib/other/licenseviewer.cpp +++ b/src/lib/other/licenseviewer.cpp @@ -37,7 +37,7 @@ LicenseViewer::LicenseViewer(QWidget* parent) QDialogButtonBox* buttonBox = new QDialogButtonBox(this); buttonBox->setStandardButtons(QDialogButtonBox::Close); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(close())); + connect(buttonBox, &QDialogButtonBox::rejected, this, &QWidget::close); QVBoxLayout* l = new QVBoxLayout(this); l->addWidget(m_textBrowser); diff --git a/src/lib/other/siteinfowidget.cpp b/src/lib/other/siteinfowidget.cpp index 7859408af..8724809ab 100644 --- a/src/lib/other/siteinfowidget.cpp +++ b/src/lib/other/siteinfowidget.cpp @@ -81,7 +81,7 @@ SiteInfoWidget::SiteInfoWidget(BrowserWindow* window, QWidget* parent) } } - connect(ui->pushButton, SIGNAL(clicked()), m_window->action(QSL("Tools/SiteInfo")), SLOT(trigger())); + connect(ui->pushButton, &QAbstractButton::clicked, m_window->action(QSL("Tools/SiteInfo")), &QAction::trigger); } SiteInfoWidget::~SiteInfoWidget() diff --git a/src/lib/other/statusbar.cpp b/src/lib/other/statusbar.cpp index f2ff58cb3..d8e691cdc 100644 --- a/src/lib/other/statusbar.cpp +++ b/src/lib/other/statusbar.cpp @@ -120,7 +120,7 @@ TipLabel::TipLabel(QWidget* parent) m_timer = new QTimer(this); m_timer->setSingleShot(true); m_timer->setInterval(500); - connect(m_timer, SIGNAL(timeout()), this, SLOT(hide())); + connect(m_timer, &QTimer::timeout, this, &QWidget::hide); } void TipLabel::show(QWidget* widget) diff --git a/src/lib/other/updater.cpp b/src/lib/other/updater.cpp index 1711c2409..28d1b03bd 100644 --- a/src/lib/other/updater.cpp +++ b/src/lib/other/updater.cpp @@ -115,7 +115,7 @@ Updater::Updater(BrowserWindow* window, QObject* parent) : QObject(parent) , m_window(window) { - QTimer::singleShot(60 * 1000, this, SLOT(start())); // Start checking after 1 minute + QTimer::singleShot(60 * 1000, this, &Updater::start); // Start checking after 1 minute } void Updater::start() @@ -131,7 +131,7 @@ void Updater::startDownloadingUpdateInfo(const QUrl &url) { QNetworkReply *reply = mApp->networkManager()->get(QNetworkRequest(QUrl(url))); - connect(reply, SIGNAL(finished()), this, SLOT(downCompleted())); + connect(reply, &QNetworkReply::finished, this, &Updater::downCompleted); } void Updater::downCompleted() diff --git a/src/lib/plugins/speeddial.cpp b/src/lib/plugins/speeddial.cpp index 39cb673c2..5e7a4dc71 100644 --- a/src/lib/plugins/speeddial.cpp +++ b/src/lib/plugins/speeddial.cpp @@ -40,8 +40,8 @@ SpeedDial::SpeedDial(QObject* parent) , m_regenerateScript(true) { m_autoSaver = new AutoSaver(this); - connect(m_autoSaver, SIGNAL(save()), this, SLOT(saveSettings())); - connect(this, SIGNAL(pagesChanged()), m_autoSaver, SLOT(changeOccurred())); + connect(m_autoSaver, &AutoSaver::save, this, &SpeedDial::saveSettings); + connect(this, &SpeedDial::pagesChanged, m_autoSaver, &AutoSaver::changeOccurred); } SpeedDial::~SpeedDial() @@ -261,7 +261,7 @@ void SpeedDial::loadThumbnail(const QString &url, bool loadTitle) PageThumbnailer* thumbnailer = new PageThumbnailer(this); thumbnailer->setUrl(QUrl::fromEncoded(url.toUtf8())); thumbnailer->setLoadTitle(loadTitle); - connect(thumbnailer, SIGNAL(thumbnailCreated(QPixmap)), this, SLOT(thumbnailCreated(QPixmap))); + connect(thumbnailer, &PageThumbnailer::thumbnailCreated, this, &SpeedDial::thumbnailCreated); thumbnailer->start(); } diff --git a/src/lib/popupwindow/popupwebview.cpp b/src/lib/popupwindow/popupwebview.cpp index 4a053a004..f47fa18be 100644 --- a/src/lib/popupwindow/popupwebview.cpp +++ b/src/lib/popupwindow/popupwebview.cpp @@ -97,7 +97,7 @@ void PopupWebView::_contextMenuEvent(QContextMenuEvent *event) if (WebInspector::isEnabled()) { m_menu->addSeparator(); - m_menu->addAction(tr("Inspect Element"), this, SLOT(inspectElement())); + m_menu->addAction(tr("Inspect Element"), this, &PopupWebView::inspectElement); } if (!m_menu->isEmpty()) { diff --git a/src/lib/popupwindow/popupwindow.cpp b/src/lib/popupwindow/popupwindow.cpp index 41835c401..bbef550c4 100644 --- a/src/lib/popupwindow/popupwindow.cpp +++ b/src/lib/popupwindow/popupwindow.cpp @@ -81,10 +81,10 @@ PopupWindow::PopupWindow(PopupWebView* view) m_menuBar = new QMenuBar(this); QMenu* menuFile = new QMenu(tr("File")); - menuFile->addAction(QIcon::fromTheme("mail-message-new"), tr("Send Link..."), m_view, SLOT(sendPageByMail())); - menuFile->addAction(QIcon::fromTheme("document-print"), tr("&Print..."), m_view, SLOT(printPage()))->setShortcut(QKeySequence("Ctrl+P")); + menuFile->addAction(QIcon::fromTheme("mail-message-new"), tr("Send Link..."), m_view, &WebView::sendPageByMail); + menuFile->addAction(QIcon::fromTheme("document-print"), tr("&Print..."), m_view, &WebView::printPage)->setShortcut(QKeySequence("Ctrl+P")); menuFile->addSeparator(); - menuFile->addAction(QIcon::fromTheme("window-close"), tr("Close"), this, SLOT(close()))->setShortcut(QKeySequence("Ctrl+W")); + menuFile->addAction(QIcon::fromTheme("window-close"), tr("Close"), this, &QWidget::close)->setShortcut(QKeySequence("Ctrl+W")); m_menuBar->addMenu(menuFile); m_menuEdit = new QMenu(tr("Edit")); @@ -96,20 +96,20 @@ PopupWindow::PopupWindow(PopupWebView* view) m_menuEdit->addAction(m_view->pageAction(QWebEnginePage::Paste)); m_menuEdit->addSeparator(); m_menuEdit->addAction(m_view->pageAction(QWebEnginePage::SelectAll)); - m_menuEdit->addAction(QIcon::fromTheme("edit-find"), tr("Find"), this, SLOT(searchOnPage()))->setShortcut(QKeySequence("Ctrl+F")); + m_menuEdit->addAction(QIcon::fromTheme("edit-find"), tr("Find"), this, &PopupWindow::searchOnPage)->setShortcut(QKeySequence("Ctrl+F")); m_menuBar->addMenu(m_menuEdit); m_menuView = new QMenu(tr("View")); - m_actionStop = m_menuView->addAction(QIcon::fromTheme(QSL("process-stop")), tr("&Stop"), m_view, SLOT(stop())); + m_actionStop = m_menuView->addAction(QIcon::fromTheme(QSL("process-stop")), tr("&Stop"), m_view, &QWebEngineView::stop); m_actionStop->setShortcut(QKeySequence("Esc")); - m_actionReload = m_menuView->addAction(QIcon::fromTheme(QSL("view-refresh")), tr("&Reload"), m_view, SLOT(reload())); + m_actionReload = m_menuView->addAction(QIcon::fromTheme(QSL("view-refresh")), tr("&Reload"), m_view, &QWebEngineView::reload); m_actionReload->setShortcut(QKeySequence("F5")); m_menuView->addSeparator(); - m_menuView->addAction(QIcon::fromTheme("zoom-in"), tr("Zoom &In"), m_view, SLOT(zoomIn()))->setShortcut(QKeySequence("Ctrl++")); - m_menuView->addAction(QIcon::fromTheme("zoom-out"), tr("Zoom &Out"), m_view, SLOT(zoomOut()))->setShortcut(QKeySequence("Ctrl+-")); - m_menuView->addAction(QIcon::fromTheme("zoom-original"), tr("Reset"), m_view, SLOT(zoomReset()))->setShortcut(QKeySequence("Ctrl+0")); + m_menuView->addAction(QIcon::fromTheme("zoom-in"), tr("Zoom &In"), m_view, &WebView::zoomIn)->setShortcut(QKeySequence("Ctrl++")); + m_menuView->addAction(QIcon::fromTheme("zoom-out"), tr("Zoom &Out"), m_view, &WebView::zoomOut)->setShortcut(QKeySequence("Ctrl+-")); + m_menuView->addAction(QIcon::fromTheme("zoom-original"), tr("Reset"), m_view, &WebView::zoomReset)->setShortcut(QKeySequence("Ctrl+0")); m_menuView->addSeparator(); - m_menuView->addAction(QIcon::fromTheme("text-html"), tr("&Page Source"), m_view, SLOT(showSource()))->setShortcut(QKeySequence("Ctrl+U")); + m_menuView->addAction(QIcon::fromTheme("text-html"), tr("&Page Source"), m_view, &WebView::showSource)->setShortcut(QKeySequence("Ctrl+U")); m_menuBar->addMenu(m_menuView); // Make shortcuts available even with hidden menubar diff --git a/src/lib/preferences/acceptlanguage.cpp b/src/lib/preferences/acceptlanguage.cpp index de11316d0..631b2fcb1 100644 --- a/src/lib/preferences/acceptlanguage.cpp +++ b/src/lib/preferences/acceptlanguage.cpp @@ -105,10 +105,10 @@ AcceptLanguage::AcceptLanguage(QWidget* parent) ui->listWidget->addItem(label); } - connect(ui->add, SIGNAL(clicked()), this, SLOT(addLanguage())); - connect(ui->remove, SIGNAL(clicked()), this, SLOT(removeLanguage())); - connect(ui->up, SIGNAL(clicked()), this, SLOT(upLanguage())); - connect(ui->down, SIGNAL(clicked()), this, SLOT(downLanguage())); + connect(ui->add, &QAbstractButton::clicked, this, &AcceptLanguage::addLanguage); + connect(ui->remove, &QAbstractButton::clicked, this, &AcceptLanguage::removeLanguage); + connect(ui->up, &QAbstractButton::clicked, this, &AcceptLanguage::upLanguage); + connect(ui->down, &QAbstractButton::clicked, this, &AcceptLanguage::downLanguage); } QStringList AcceptLanguage::expand(const QLocale::Language &language) @@ -150,7 +150,7 @@ void AcceptLanguage::addLanguage() acceptLangUi.listWidget->addItems(allLanguages); - connect(acceptLangUi.listWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), &dialog, SLOT(accept())); + connect(acceptLangUi.listWidget, &QListWidget::itemDoubleClicked, &dialog, &QDialog::accept); if (dialog.exec() == QDialog::Rejected) { return; diff --git a/src/lib/preferences/autofillmanager.cpp b/src/lib/preferences/autofillmanager.cpp index 9a2fbccd5..48e9fc8cf 100644 --- a/src/lib/preferences/autofillmanager.cpp +++ b/src/lib/preferences/autofillmanager.cpp @@ -48,24 +48,24 @@ AutoFillManager::AutoFillManager(QWidget* parent) ui->treeExcept->setLayoutDirection(Qt::LeftToRight); } - connect(ui->removePass, SIGNAL(clicked()), this, SLOT(removePass())); - connect(ui->removeAllPass, SIGNAL(clicked()), this, SLOT(removeAllPass())); - connect(ui->editPass, SIGNAL(clicked()), this, SLOT(editPass())); - connect(ui->showPasswords, SIGNAL(clicked()), this, SLOT(showPasswords())); - connect(ui->search, SIGNAL(textChanged(QString)), ui->treePass, SLOT(filterString(QString))); - connect(ui->changeBackend, SIGNAL(clicked()), this, SLOT(changePasswordBackend())); - connect(ui->backendOptions, SIGNAL(clicked()), this, SLOT(showBackendOptions())); - connect(m_passwordManager, SIGNAL(passwordBackendChanged()), this, SLOT(currentPasswordBackendChanged())); + connect(ui->removePass, &QAbstractButton::clicked, this, &AutoFillManager::removePass); + connect(ui->removeAllPass, &QAbstractButton::clicked, this, &AutoFillManager::removeAllPass); + connect(ui->editPass, &QAbstractButton::clicked, this, &AutoFillManager::editPass); + connect(ui->showPasswords, &QAbstractButton::clicked, this, &AutoFillManager::showPasswords); + connect(ui->search, &QLineEdit::textChanged, ui->treePass, &TreeWidget::filterString); + connect(ui->changeBackend, &QAbstractButton::clicked, this, &AutoFillManager::changePasswordBackend); + connect(ui->backendOptions, &QAbstractButton::clicked, this, &AutoFillManager::showBackendOptions); + connect(m_passwordManager, &PasswordManager::passwordBackendChanged, this, &AutoFillManager::currentPasswordBackendChanged); - connect(ui->removeExcept, SIGNAL(clicked()), this, SLOT(removeExcept())); - connect(ui->removeAllExcept, SIGNAL(clicked()), this, SLOT(removeAllExcept())); + connect(ui->removeExcept, &QAbstractButton::clicked, this, &AutoFillManager::removeExcept); + connect(ui->removeAllExcept, &QAbstractButton::clicked, this, &AutoFillManager::removeAllExcept); ui->treePass->setContextMenuPolicy(Qt::CustomContextMenu); connect(ui->treePass, &TreeWidget::customContextMenuRequested, this, &AutoFillManager::passwordContextMenu); QMenu* menu = new QMenu(this); - menu->addAction(tr("Import Passwords from File..."), this, SLOT(importPasswords())); - menu->addAction(tr("Export Passwords to File..."), this, SLOT(exportPasswords())); + menu->addAction(tr("Import Passwords from File..."), this, &AutoFillManager::importPasswords); + menu->addAction(tr("Export Passwords to File..."), this, &AutoFillManager::exportPasswords); ui->importExport->setMenu(menu); ui->search->setPlaceholderText(tr("Search")); @@ -74,7 +74,7 @@ AutoFillManager::AutoFillManager(QWidget* parent) ui->backendOptions->setVisible(m_passwordManager->activeBackend()->hasSettings()); // Load passwords - QTimer::singleShot(0, this, SLOT(loadPasswords())); + QTimer::singleShot(0, this, &AutoFillManager::loadPasswords); } void AutoFillManager::loadPasswords() @@ -304,7 +304,7 @@ void AutoFillManager::importPasswords() return; } - QTimer::singleShot(0, this, SLOT(slotImportPasswords())); + QTimer::singleShot(0, this, &AutoFillManager::slotImportPasswords); } void AutoFillManager::exportPasswords() @@ -315,7 +315,7 @@ void AutoFillManager::exportPasswords() return; } - QTimer::singleShot(0, this, SLOT(slotExportPasswords())); + QTimer::singleShot(0, this, &AutoFillManager::slotExportPasswords); } void AutoFillManager::slotImportPasswords() @@ -362,7 +362,7 @@ void AutoFillManager::currentPasswordBackendChanged() ui->currentBackend->setText(QString("%1").arg(m_passwordManager->activeBackend()->name())); ui->backendOptions->setVisible(m_passwordManager->activeBackend()->hasSettings()); - QTimer::singleShot(0, this, SLOT(loadPasswords())); + QTimer::singleShot(0, this, &AutoFillManager::loadPasswords); } void AutoFillManager::passwordContextMenu(const QPoint &pos) diff --git a/src/lib/preferences/pluginsmanager.cpp b/src/lib/preferences/pluginsmanager.cpp index 540bf7583..a1e1fdae0 100644 --- a/src/lib/preferences/pluginsmanager.cpp +++ b/src/lib/preferences/pluginsmanager.cpp @@ -47,9 +47,9 @@ PluginsManager::PluginsManager(QWidget* parent) ui->list->setEnabled(appPluginsEnabled); - connect(ui->butSettings, SIGNAL(clicked()), this, SLOT(settingsClicked())); - connect(ui->list, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(currentChanged(QListWidgetItem*))); - connect(ui->list, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*))); + connect(ui->butSettings, &QAbstractButton::clicked, this, &PluginsManager::settingsClicked); + connect(ui->list, &QListWidget::currentItemChanged, this, &PluginsManager::currentChanged); + connect(ui->list, &QListWidget::itemChanged, this, &PluginsManager::itemChanged); ui->list->setItemDelegate(new PluginListDelegate(ui->list)); } @@ -88,7 +88,7 @@ void PluginsManager::refresh() { ui->list->clear(); ui->butSettings->setEnabled(false); - disconnect(ui->list, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*))); + disconnect(ui->list, &QListWidget::itemChanged, this, &PluginsManager::itemChanged); const QList &allPlugins = mApp->plugins()->getAvailablePlugins(); @@ -119,7 +119,7 @@ void PluginsManager::refresh() sortItems(); - connect(ui->list, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*))); + connect(ui->list, &QListWidget::itemChanged, this, &PluginsManager::itemChanged); } void PluginsManager::sortItems() @@ -177,7 +177,7 @@ void PluginsManager::itemChanged(QListWidgetItem* item) mApp->plugins()->unloadPlugin(&plugin); } - disconnect(ui->list, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*))); + disconnect(ui->list, &QListWidget::itemChanged, this, &PluginsManager::itemChanged); if (item->checkState() == Qt::Checked && !plugin.isLoaded()) { item->setCheckState(Qt::Unchecked); @@ -186,7 +186,7 @@ void PluginsManager::itemChanged(QListWidgetItem* item) item->setData(Qt::UserRole + 10, QVariant::fromValue(plugin)); - connect(ui->list, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*))); + connect(ui->list, &QListWidget::itemChanged, this, &PluginsManager::itemChanged); currentChanged(ui->list->currentItem()); diff --git a/src/lib/preferences/preferences.cpp b/src/lib/preferences/preferences.cpp index 8a5ca9a62..ec1961a11 100644 --- a/src/lib/preferences/preferences.cpp +++ b/src/lib/preferences/preferences.cpp @@ -195,8 +195,8 @@ Preferences::Preferences(BrowserWindow* window) connect(ui->afterLaunch, SIGNAL(currentIndexChanged(int)), this, SLOT(afterLaunchChanged(int))); connect(ui->newTab, SIGNAL(currentIndexChanged(int)), this, SLOT(newTabChanged(int))); if (m_window) { - connect(ui->useCurrentBut, SIGNAL(clicked()), this, SLOT(useActualHomepage())); - connect(ui->newTabUseCurrent, SIGNAL(clicked()), this, SLOT(useActualNewTab())); + connect(ui->useCurrentBut, &QAbstractButton::clicked, this, &Preferences::useActualHomepage); + connect(ui->newTabUseCurrent, &QAbstractButton::clicked, this, &Preferences::useActualNewTab); } else { ui->useCurrentBut->setEnabled(false); @@ -214,8 +214,8 @@ Preferences::Preferences(BrowserWindow* window) } } - connect(ui->createProfile, SIGNAL(clicked()), this, SLOT(createProfile())); - connect(ui->deleteProfile, SIGNAL(clicked()), this, SLOT(deleteProfile())); + connect(ui->createProfile, &QAbstractButton::clicked, this, &Preferences::createProfile); + connect(ui->deleteProfile, &QAbstractButton::clicked, this, &Preferences::deleteProfile); connect(ui->startProfile, SIGNAL(currentIndexChanged(int)), this, SLOT(startProfileIndexChanged(int))); startProfileIndexChanged(ui->startProfile->currentIndex()); @@ -227,8 +227,8 @@ Preferences::Preferences(BrowserWindow* window) ui->showBookmarksToolbar->setChecked(settings.value("showBookmarksToolbar", false).toBool()); ui->instantBookmarksToolbar->setDisabled(settings.value("showBookmarksToolbar", false).toBool()); ui->showBookmarksToolbar->setDisabled(settings.value("instantBookmarksToolbar").toBool()); - connect(ui->instantBookmarksToolbar, SIGNAL(toggled(bool)), ui->showBookmarksToolbar, SLOT(setDisabled(bool))); - connect(ui->showBookmarksToolbar, SIGNAL(toggled(bool)), ui->instantBookmarksToolbar, SLOT(setDisabled(bool))); + connect(ui->instantBookmarksToolbar, &QAbstractButton::toggled, ui->showBookmarksToolbar, &QWidget::setDisabled); + connect(ui->showBookmarksToolbar, &QAbstractButton::toggled, ui->instantBookmarksToolbar, &QWidget::setDisabled); ui->showNavigationToolbar->setChecked(settings.value("showNavigationToolbar", true).toBool()); int currentSettingsPage = settings.value("settingsDialogPage", 0).toInt(0); settings.endGroup(); @@ -265,7 +265,7 @@ Preferences::Preferences(BrowserWindow* window) ui->progressBarColorSelector->setEnabled(pbInABuseCC); QColor pbColor = settings.value("CustomProgressColor", palette().color(QPalette::Highlight)).value(); setProgressBarColorIcon(pbColor); - connect(ui->customColorToolButton, SIGNAL(clicked(bool)), SLOT(selectCustomProgressBarColor())); + connect(ui->customColorToolButton, &QAbstractButton::clicked, this, &Preferences::selectCustomProgressBarColor); connect(ui->resetProgressBarcolor, SIGNAL(clicked()), SLOT(setProgressBarColorIcon())); settings.endGroup(); @@ -276,7 +276,7 @@ Preferences::Preferences(BrowserWindow* window) ui->searchWithDefaultEngine->setChecked(settings.value("SearchWithDefaultEngine", false).toBool()); ui->showABSearchSuggestions->setEnabled(searchFromAB); ui->showABSearchSuggestions->setChecked(settings.value("showSearchSuggestions", true).toBool()); - connect(ui->searchFromAddressBar, SIGNAL(toggled(bool)), this, SLOT(searchFromAddressBarChanged(bool))); + connect(ui->searchFromAddressBar, &QAbstractButton::toggled, this, &Preferences::searchFromAddressBarChanged); settings.endGroup(); // BROWSING @@ -305,8 +305,8 @@ Preferences::Preferences(BrowserWindow* window) ui->removeCache->setChecked(settings.value("deleteCacheOnClose", false).toBool()); ui->cacheMB->setValue(settings.value("LocalCacheSize", 50).toInt()); ui->cachePath->setText(settings.value("CachePath", QWebEngineProfile::defaultProfile()->cachePath()).toString()); - connect(ui->allowCache, SIGNAL(clicked(bool)), this, SLOT(allowCacheChanged(bool))); - connect(ui->changeCachePath, SIGNAL(clicked()), this, SLOT(changeCachePathClicked())); + connect(ui->allowCache, &QAbstractButton::clicked, this, &Preferences::allowCacheChanged); + connect(ui->changeCachePath, &QAbstractButton::clicked, this, &Preferences::changeCachePathClicked); allowCacheChanged(ui->allowCache->isChecked()); //PASSWORD MANAGER @@ -320,18 +320,18 @@ Preferences::Preferences(BrowserWindow* window) if (!ui->saveHistory->isChecked()) { ui->deleteHistoryOnClose->setEnabled(false); } - connect(ui->saveHistory, SIGNAL(toggled(bool)), this, SLOT(saveHistoryChanged(bool))); + connect(ui->saveHistory, &QAbstractButton::toggled, this, &Preferences::saveHistoryChanged); // Html5Storage ui->html5storage->setChecked(settings.value("HTML5StorageEnabled", true).toBool()); ui->deleteHtml5storageOnClose->setChecked(settings.value("deleteHTML5StorageOnClose", false).toBool()); - connect(ui->html5storage, SIGNAL(toggled(bool)), this, SLOT(allowHtml5storageChanged(bool))); + connect(ui->html5storage, &QAbstractButton::toggled, this, &Preferences::allowHtml5storageChanged); // Other ui->doNotTrack->setChecked(settings.value("DoNotTrack", false).toBool()); //CSS Style ui->userStyleSheet->setText(settings.value("userStyleSheet", "").toString()); - connect(ui->chooseUserStylesheet, SIGNAL(clicked()), this, SLOT(chooseUserStyleClicked())); + connect(ui->chooseUserStylesheet, &QAbstractButton::clicked, this, &Preferences::chooseUserStyleClicked); settings.endGroup(); //DOWNLOADS @@ -348,12 +348,12 @@ Preferences::Preferences(BrowserWindow* window) ui->externalDownExecutable->setText(settings.value("ExternalManagerExecutable", "").toString()); ui->externalDownArguments->setText(settings.value("ExternalManagerArguments", "").toString()); - connect(ui->useExternalDownManager, SIGNAL(toggled(bool)), this, SLOT(useExternalDownManagerChanged(bool))); + connect(ui->useExternalDownManager, &QAbstractButton::toggled, this, &Preferences::useExternalDownManagerChanged); - connect(ui->useDefined, SIGNAL(toggled(bool)), this, SLOT(downLocChanged(bool))); - connect(ui->downButt, SIGNAL(clicked()), this, SLOT(chooseDownPath())); - connect(ui->chooseExternalDown, SIGNAL(clicked()), this, SLOT(chooseExternalDownloadManager())); + connect(ui->useDefined, &QAbstractButton::toggled, this, &Preferences::downLocChanged); + connect(ui->downButt, &QAbstractButton::clicked, this, &Preferences::chooseDownPath); + connect(ui->chooseExternalDown, &QAbstractButton::clicked, this, &Preferences::chooseExternalDownloadManager); downLocChanged(ui->useDefined->isChecked()); useExternalDownManagerChanged(ui->useExternalDownManager->isChecked()); settings.endGroup(); @@ -501,19 +501,19 @@ Preferences::Preferences(BrowserWindow* window) settings.endGroup(); setManualProxyConfigurationEnabled(ui->manualProxy->isChecked()); - connect(ui->manualProxy, SIGNAL(toggled(bool)), this, SLOT(setManualProxyConfigurationEnabled(bool))); + connect(ui->manualProxy, &QAbstractButton::toggled, this, &Preferences::setManualProxyConfigurationEnabled); //CONNECTS - connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(buttonClicked(QAbstractButton*))); - connect(ui->cookieManagerBut, SIGNAL(clicked()), this, SLOT(showCookieManager())); - connect(ui->html5permissions, SIGNAL(clicked()), this, SLOT(showHtml5Permissions())); - connect(ui->preferredLanguages, SIGNAL(clicked()), this, SLOT(showAcceptLanguage())); - connect(ui->deleteHtml5storage, SIGNAL(clicked()), this, SLOT(deleteHtml5storage())); - connect(ui->uaManager, SIGNAL(clicked()), this, SLOT(openUserAgentManager())); - connect(ui->jsOptionsButton, SIGNAL(clicked()), this, SLOT(openJsOptions())); - connect(ui->searchEngines, SIGNAL(clicked()), this, SLOT(openSearchEnginesManager())); + connect(ui->buttonBox, &QDialogButtonBox::clicked, this, &Preferences::buttonClicked); + connect(ui->cookieManagerBut, &QAbstractButton::clicked, this, &Preferences::showCookieManager); + connect(ui->html5permissions, &QAbstractButton::clicked, this, &Preferences::showHtml5Permissions); + connect(ui->preferredLanguages, &QAbstractButton::clicked, this, &Preferences::showAcceptLanguage); + connect(ui->deleteHtml5storage, &QAbstractButton::clicked, this, &Preferences::deleteHtml5storage); + connect(ui->uaManager, &QAbstractButton::clicked, this, &Preferences::openUserAgentManager); + connect(ui->jsOptionsButton, &QAbstractButton::clicked, this, &Preferences::openJsOptions); + connect(ui->searchEngines, &QAbstractButton::clicked, this, &Preferences::openSearchEnginesManager); - connect(ui->listWidget, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(showStackedPage(QListWidgetItem*))); + connect(ui->listWidget, &QListWidget::currentItemChanged, this, &Preferences::showStackedPage); ui->listWidget->setItemSelected(ui->listWidget->itemAt(5, 5), true); ui->listWidget->setCurrentRow(currentSettingsPage); diff --git a/src/lib/preferences/thememanager.cpp b/src/lib/preferences/thememanager.cpp index 2b6dc4263..4b185d7ed 100644 --- a/src/lib/preferences/thememanager.cpp +++ b/src/lib/preferences/thememanager.cpp @@ -65,8 +65,8 @@ ThemeManager::ThemeManager(QWidget* parent, Preferences* preferences) } } - connect(ui->listWidget, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(currentChanged())); - connect(ui->license, SIGNAL(clicked(QPoint)), this, SLOT(showLicense())); + connect(ui->listWidget, &QListWidget::currentItemChanged, this, &ThemeManager::currentChanged); + connect(ui->license, &ClickableLabel::clicked, this, &ThemeManager::showLicense); currentChanged(); } diff --git a/src/lib/preferences/useragentdialog.cpp b/src/lib/preferences/useragentdialog.cpp index be0138f78..bf492e50b 100644 --- a/src/lib/preferences/useragentdialog.cpp +++ b/src/lib/preferences/useragentdialog.cpp @@ -79,13 +79,13 @@ UserAgentDialog::UserAgentDialog(QWidget* parent) ui->table->sortByColumn(-1); - connect(ui->add, SIGNAL(clicked()), this, SLOT(addSite())); - connect(ui->remove, SIGNAL(clicked()), this, SLOT(removeSite())); - connect(ui->edit, SIGNAL(clicked()), this, SLOT(editSite())); - connect(ui->table, SIGNAL(itemDoubleClicked(QTableWidgetItem*)), this, SLOT(editSite())); + connect(ui->add, &QAbstractButton::clicked, this, &UserAgentDialog::addSite); + connect(ui->remove, &QAbstractButton::clicked, this, &UserAgentDialog::removeSite); + connect(ui->edit, &QAbstractButton::clicked, this, &UserAgentDialog::editSite); + connect(ui->table, &QTableWidget::itemDoubleClicked, this, &UserAgentDialog::editSite); - connect(ui->changeGlobal, SIGNAL(clicked(bool)), this, SLOT(enableGlobalComboBox(bool))); - connect(ui->changePerSite, SIGNAL(clicked(bool)), this, SLOT(enablePerSiteFrame(bool))); + connect(ui->changeGlobal, &QAbstractButton::clicked, this, &UserAgentDialog::enableGlobalComboBox); + connect(ui->changePerSite, &QAbstractButton::clicked, this, &UserAgentDialog::enablePerSiteFrame); enableGlobalComboBox(ui->changeGlobal->isChecked()); enablePerSiteFrame(ui->changePerSite->isChecked()); @@ -210,8 +210,8 @@ bool UserAgentDialog::showEditDialog(const QString &title, QString* rSite, QStri box->addButton(QDialogButtonBox::Ok); box->addButton(QDialogButtonBox::Cancel); - connect(box, SIGNAL(rejected()), dialog, SLOT(reject())); - connect(box, SIGNAL(accepted()), dialog, SLOT(accept())); + connect(box, &QDialogButtonBox::rejected, dialog, &QDialog::reject); + connect(box, &QDialogButtonBox::accepted, dialog, &QDialog::accept); layout->addRow(new QLabel(tr("Site domain: ")), editSite); layout->addRow(new QLabel(tr("User Agent: ")), editAgent); diff --git a/src/lib/session/sessionmanager.cpp b/src/lib/session/sessionmanager.cpp index ca6163700..51589e7b1 100644 --- a/src/lib/session/sessionmanager.cpp +++ b/src/lib/session/sessionmanager.cpp @@ -43,7 +43,7 @@ SessionManager::SessionManager(QObject* parent) , m_secondBackupSession(DataPaths::currentProfilePath() + QL1S("/session.dat.old1")) { QFileSystemWatcher* sessionFilesWatcher = new QFileSystemWatcher({DataPaths::path(DataPaths::Sessions)}, this); - connect(sessionFilesWatcher, SIGNAL(directoryChanged(QString)), this, SLOT(sessionsDirectoryChanged())); + connect(sessionFilesWatcher, &QFileSystemWatcher::directoryChanged, this, &SessionManager::sessionsDirectoryChanged); connect(sessionFilesWatcher, &QFileSystemWatcher::directoryChanged, this, &SessionManager::sessionsMetaDataChanged); loadSettings(); diff --git a/src/lib/sidebar/bookmarkssidebar.cpp b/src/lib/sidebar/bookmarkssidebar.cpp index 0df13dc91..73eb7d4ae 100644 --- a/src/lib/sidebar/bookmarkssidebar.cpp +++ b/src/lib/sidebar/bookmarkssidebar.cpp @@ -34,12 +34,12 @@ BookmarksSidebar::BookmarksSidebar(BrowserWindow* window, QWidget* parent) ui->setupUi(this); ui->tree->setViewType(BookmarksTreeView::BookmarksSidebarViewType); - connect(ui->tree, SIGNAL(bookmarkActivated(BookmarkItem*)), this, SLOT(bookmarkActivated(BookmarkItem*))); - connect(ui->tree, SIGNAL(bookmarkCtrlActivated(BookmarkItem*)), this, SLOT(bookmarkCtrlActivated(BookmarkItem*))); - connect(ui->tree, SIGNAL(bookmarkShiftActivated(BookmarkItem*)), this, SLOT(bookmarkShiftActivated(BookmarkItem*))); - connect(ui->tree, SIGNAL(contextMenuRequested(QPoint)), this, SLOT(createContextMenu(QPoint))); + connect(ui->tree, &BookmarksTreeView::bookmarkActivated, this, &BookmarksSidebar::bookmarkActivated); + connect(ui->tree, &BookmarksTreeView::bookmarkCtrlActivated, this, &BookmarksSidebar::bookmarkCtrlActivated); + connect(ui->tree, &BookmarksTreeView::bookmarkShiftActivated, this, &BookmarksSidebar::bookmarkShiftActivated); + connect(ui->tree, &BookmarksTreeView::contextMenuRequested, this, &BookmarksSidebar::createContextMenu); - connect(ui->search, SIGNAL(textChanged(QString)), ui->tree, SLOT(search(QString))); + connect(ui->search, &QLineEdit::textChanged, ui->tree, &BookmarksTreeView::search); } BookmarksSidebar::~BookmarksSidebar() @@ -110,7 +110,7 @@ void BookmarksSidebar::createContextMenu(const QPoint &pos) connect(actNewTab, SIGNAL(triggered()), this, SLOT(openBookmarkInNewTab())); connect(actNewWindow, SIGNAL(triggered()), this, SLOT(openBookmarkInNewWindow())); connect(actNewPrivateWindow, SIGNAL(triggered()), this, SLOT(openBookmarkInNewPrivateWindow())); - connect(actDelete, SIGNAL(triggered()), this, SLOT(deleteBookmarks())); + connect(actDelete, &QAction::triggered, this, &BookmarksSidebar::deleteBookmarks); bool canBeDeleted = false; QList items = ui->tree->selectedBookmarks(); diff --git a/src/lib/sidebar/historysidebar.cpp b/src/lib/sidebar/historysidebar.cpp index e23161762..4680c1ca7 100644 --- a/src/lib/sidebar/historysidebar.cpp +++ b/src/lib/sidebar/historysidebar.cpp @@ -32,12 +32,12 @@ HistorySideBar::HistorySideBar(BrowserWindow* window, QWidget* parent) ui->setupUi(this); ui->historyTree->setViewType(HistoryTreeView::HistorySidebarViewType); - connect(ui->historyTree, SIGNAL(urlActivated(QUrl)), this, SLOT(urlActivated(QUrl))); - connect(ui->historyTree, SIGNAL(urlCtrlActivated(QUrl)), this, SLOT(urlCtrlActivated(QUrl))); - connect(ui->historyTree, SIGNAL(urlShiftActivated(QUrl)), this, SLOT(urlShiftActivated(QUrl))); - connect(ui->historyTree, SIGNAL(contextMenuRequested(QPoint)), this, SLOT(createContextMenu(QPoint))); + connect(ui->historyTree, &HistoryTreeView::urlActivated, this, &HistorySideBar::urlActivated); + connect(ui->historyTree, &HistoryTreeView::urlCtrlActivated, this, &HistorySideBar::urlCtrlActivated); + connect(ui->historyTree, &HistoryTreeView::urlShiftActivated, this, &HistorySideBar::urlShiftActivated); + connect(ui->historyTree, &HistoryTreeView::contextMenuRequested, this, &HistorySideBar::createContextMenu); - connect(ui->search, SIGNAL(textEdited(QString)), ui->historyTree, SLOT(search(QString))); + connect(ui->search, &QLineEdit::textEdited, ui->historyTree, &HistoryTreeView::search); } void HistorySideBar::urlActivated(const QUrl &url) @@ -92,7 +92,7 @@ void HistorySideBar::createContextMenu(const QPoint &pos) connect(actNewTab, SIGNAL(triggered()), this, SLOT(openUrlInNewTab())); connect(actNewWindow, SIGNAL(triggered()), this, SLOT(openUrlInNewWindow())); connect(actNewPrivateWindow, SIGNAL(triggered()), this, SLOT(openUrlInNewPrivateWindow())); - connect(actDelete, SIGNAL(triggered()), ui->historyTree, SLOT(removeSelectedItems())); + connect(actDelete, &QAction::triggered, ui->historyTree, &HistoryTreeView::removeSelectedItems); if (ui->historyTree->selectedUrl().isEmpty()) { actNewTab->setDisabled(true); diff --git a/src/lib/sidebar/sidebar.cpp b/src/lib/sidebar/sidebar.cpp index 43394e26b..4e1a991ef 100644 --- a/src/lib/sidebar/sidebar.cpp +++ b/src/lib/sidebar/sidebar.cpp @@ -104,14 +104,14 @@ void SideBarManager::createMenu(QMenu* menu) QActionGroup *group = new QActionGroup(menu); - QAction* act = menu->addAction(SideBar::tr("Bookmarks"), this, SLOT(slotShowSideBar())); + QAction* act = menu->addAction(SideBar::tr("Bookmarks"), this, &SideBarManager::slotShowSideBar); act->setCheckable(true); act->setShortcut(QKeySequence("Ctrl+Shift+B")); act->setData("Bookmarks"); act->setChecked(m_activeBar == QL1S("Bookmarks")); group->addAction(act); - act = menu->addAction(SideBar::tr("History"), this, SLOT(slotShowSideBar())); + act = menu->addAction(SideBar::tr("History"), this, &SideBarManager::slotShowSideBar); act->setCheckable(true); act->setShortcut(QKeySequence("Ctrl+H")); act->setData("History"); @@ -123,7 +123,7 @@ void SideBarManager::createMenu(QMenu* menu) QAction* act = sidebar.data()->createMenuAction(); act->setData(s_sidebars.key(sidebar)); act->setChecked(m_activeBar == s_sidebars.key(sidebar)); - connect(act, SIGNAL(triggered()), this, SLOT(slotShowSideBar())); + connect(act, &QAction::triggered, this, &SideBarManager::slotShowSideBar); menu->addAction(act); group->addAction(act); } diff --git a/src/lib/tabwidget/combotabbar.cpp b/src/lib/tabwidget/combotabbar.cpp index 96168b6ab..8a309072d 100644 --- a/src/lib/tabwidget/combotabbar.cpp +++ b/src/lib/tabwidget/combotabbar.cpp @@ -62,10 +62,10 @@ ComboTabBar::ComboTabBar(QWidget* parent) m_mainTabBar->setScrollArea(m_mainTabBarWidget->scrollArea()); m_pinnedTabBar->setScrollArea(m_pinnedTabBarWidget->scrollArea()); - connect(m_mainTabBarWidget->scrollBar(), SIGNAL(rangeChanged(int,int)), this, SLOT(setMinimumWidths())); - connect(m_mainTabBarWidget->scrollBar(), SIGNAL(valueChanged(int)), this, SIGNAL(scrollBarValueChanged(int))); - connect(m_pinnedTabBarWidget->scrollBar(), SIGNAL(rangeChanged(int,int)), this, SLOT(setMinimumWidths())); - connect(m_pinnedTabBarWidget->scrollBar(), SIGNAL(valueChanged(int)), this, SIGNAL(scrollBarValueChanged(int))); + connect(m_mainTabBarWidget->scrollBar(), &QAbstractSlider::rangeChanged, this, &ComboTabBar::setMinimumWidths); + connect(m_mainTabBarWidget->scrollBar(), &QAbstractSlider::valueChanged, this, &ComboTabBar::scrollBarValueChanged); + connect(m_pinnedTabBarWidget->scrollBar(), &QAbstractSlider::rangeChanged, this, &ComboTabBar::setMinimumWidths); + connect(m_pinnedTabBarWidget->scrollBar(), &QAbstractSlider::valueChanged, this, &ComboTabBar::scrollBarValueChanged); connect(this, SIGNAL(overFlowChanged(bool)), m_mainTabBarWidget, SLOT(overFlowChanged(bool))); m_mainTabBar->setActiveTabBar(true); @@ -92,13 +92,13 @@ ComboTabBar::ComboTabBar(QWidget* parent) m_mainLayout->addWidget(m_rightContainer); setLayout(m_mainLayout); - connect(m_mainTabBar, SIGNAL(currentChanged(int)), this, SLOT(slotCurrentChanged(int))); - connect(m_mainTabBar, SIGNAL(tabCloseRequested(int)), this, SLOT(slotTabCloseRequested(int))); - connect(m_mainTabBar, SIGNAL(tabMoved(int,int)), this, SLOT(slotTabMoved(int,int))); + connect(m_mainTabBar, &QTabBar::currentChanged, this, &ComboTabBar::slotCurrentChanged); + connect(m_mainTabBar, &QTabBar::tabCloseRequested, this, &ComboTabBar::slotTabCloseRequested); + connect(m_mainTabBar, &QTabBar::tabMoved, this, &ComboTabBar::slotTabMoved); - connect(m_pinnedTabBar, SIGNAL(currentChanged(int)), this, SLOT(slotCurrentChanged(int))); - connect(m_pinnedTabBar, SIGNAL(tabCloseRequested(int)), this, SLOT(slotTabCloseRequested(int))); - connect(m_pinnedTabBar, SIGNAL(tabMoved(int,int)), this, SLOT(slotTabMoved(int,int))); + connect(m_pinnedTabBar, &QTabBar::currentChanged, this, &ComboTabBar::slotCurrentChanged); + connect(m_pinnedTabBar, &QTabBar::tabCloseRequested, this, &ComboTabBar::slotTabCloseRequested); + connect(m_pinnedTabBar, &QTabBar::tabMoved, this, &ComboTabBar::slotTabMoved); setAutoFillBackground(false); m_mainTabBar->setAutoFillBackground(false); @@ -561,7 +561,7 @@ void ComboTabBar::insertCloseButton(int index) QAbstractButton* closeButton = new CloseButton(this); closeButton->setFixedSize(closeButtonSize()); closeButton->setToolTip(m_closeButtonsToolTip); - connect(closeButton, SIGNAL(clicked()), this, SLOT(closeTabFromButton())); + connect(closeButton, &QAbstractButton::clicked, this, &ComboTabBar::closeTabFromButton); m_mainTabBar->setTabButton(index, closeButtonPosition(), closeButton); } @@ -978,7 +978,7 @@ void ComboTabBar::setMinimumWidths() if (realTabBarWidth <= width()) { if (m_mainBarOverFlowed) { m_mainBarOverFlowed = false; - QTimer::singleShot(0, this, SLOT(emitOverFlowChanged())); + QTimer::singleShot(0, this, &ComboTabBar::emitOverFlowChanged); } m_mainTabBar->useFastTabSizeHint(false); @@ -987,7 +987,7 @@ void ComboTabBar::setMinimumWidths() else { if (!m_mainBarOverFlowed) { m_mainBarOverFlowed = true; - QTimer::singleShot(0, this, SLOT(emitOverFlowChanged())); + QTimer::singleShot(0, this, &ComboTabBar::emitOverFlowChanged); } // All tabs have now same width, we can use fast tabSizeHint @@ -1558,8 +1558,8 @@ TabBarScrollWidget::TabBarScrollWidget(QTabBar* tabBar, QWidget* parent) m_leftScrollButton->setAutoRepeat(true); m_leftScrollButton->setAutoRepeatDelay(200); m_leftScrollButton->setAutoRepeatInterval(200); - connect(m_leftScrollButton, SIGNAL(pressed()), this, SLOT(scrollStart())); - connect(m_leftScrollButton, SIGNAL(doubleClicked()), this, SLOT(scrollToLeftEdge())); + connect(m_leftScrollButton, &QAbstractButton::pressed, this, &TabBarScrollWidget::scrollStart); + connect(m_leftScrollButton, &ToolButton::doubleClicked, this, &TabBarScrollWidget::scrollToLeftEdge); connect(m_leftScrollButton, SIGNAL(middleMouseClicked()), this, SLOT(ensureVisible())); m_rightScrollButton = new ToolButton(this); @@ -1569,8 +1569,8 @@ TabBarScrollWidget::TabBarScrollWidget(QTabBar* tabBar, QWidget* parent) m_rightScrollButton->setAutoRepeat(true); m_rightScrollButton->setAutoRepeatDelay(200); m_rightScrollButton->setAutoRepeatInterval(200); - connect(m_rightScrollButton, SIGNAL(pressed()), this, SLOT(scrollStart())); - connect(m_rightScrollButton, SIGNAL(doubleClicked()), this, SLOT(scrollToRightEdge())); + connect(m_rightScrollButton, &QAbstractButton::pressed, this, &TabBarScrollWidget::scrollStart); + connect(m_rightScrollButton, &ToolButton::doubleClicked, this, &TabBarScrollWidget::scrollToRightEdge); connect(m_rightScrollButton, SIGNAL(middleMouseClicked()), this, SLOT(ensureVisible())); QHBoxLayout* hLayout = new QHBoxLayout; @@ -1582,7 +1582,7 @@ TabBarScrollWidget::TabBarScrollWidget(QTabBar* tabBar, QWidget* parent) setLayout(hLayout); m_scrollArea->viewport()->setAutoFillBackground(false); - connect(m_scrollBar, SIGNAL(valueChanged(int)), this, SLOT(updateScrollButtonsState())); + connect(m_scrollBar, &QAbstractSlider::valueChanged, this, &TabBarScrollWidget::updateScrollButtonsState); updateScrollButtonsState(); overFlowChanged(false); diff --git a/src/lib/tabwidget/tabbar.cpp b/src/lib/tabwidget/tabbar.cpp index 5aa5d4026..c66e0b47a 100644 --- a/src/lib/tabwidget/tabbar.cpp +++ b/src/lib/tabwidget/tabbar.cpp @@ -104,12 +104,12 @@ TabBar::TabBar(BrowserWindow* window, TabWidget* tabWidget) setDrawBase(false); setMovable(true); - connect(this, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int))); + connect(this, &ComboTabBar::currentChanged, this, &TabBar::currentTabChanged); // ComboTabBar features setUsesScrollButtons(true); setCloseButtonsToolTip(BrowserWindow::tr("Close Tab")); - connect(this, SIGNAL(overFlowChanged(bool)), this, SLOT(overflowChanged(bool))); + connect(this, &ComboTabBar::overFlowChanged, this, &TabBar::overflowChanged); tabMetrics()->init(); diff --git a/src/lib/tabwidget/tabcontextmenu.cpp b/src/lib/tabwidget/tabcontextmenu.cpp index b5f795bef..ccfa7cd2e 100644 --- a/src/lib/tabwidget/tabcontextmenu.cpp +++ b/src/lib/tabwidget/tabcontextmenu.cpp @@ -36,7 +36,7 @@ TabContextMenu::TabContextMenu(int index, BrowserWindow *window, Options options setObjectName("tabcontextmenu"); TabWidget *tabWidget = m_window->tabWidget(); - connect(this, SIGNAL(tabCloseRequested(int)), tabWidget->tabBar(), SIGNAL(tabCloseRequested(int))); + connect(this, &TabContextMenu::tabCloseRequested, tabWidget->tabBar(), &ComboTabBar::tabCloseRequested); connect(this, SIGNAL(reloadTab(int)), tabWidget, SLOT(reloadTab(int))); connect(this, SIGNAL(stopTab(int)), tabWidget, SLOT(stopTab(int))); connect(this, SIGNAL(closeAllButCurrent(int)), tabWidget, SLOT(closeAllButCurrent(int))); @@ -126,8 +126,8 @@ void TabContextMenu::init() addAction(QIcon::fromTheme("tab-detach"), tr("D&etach Tab"), this, SLOT(detachTab())); } - addAction(webTab->isPinned() ? tr("Un&pin Tab") : tr("&Pin Tab"), this, SLOT(pinTab())); - addAction(webTab->isMuted() ? tr("Un&mute Tab") : tr("&Mute Tab"), this, SLOT(muteTab())); + addAction(webTab->isPinned() ? tr("Un&pin Tab") : tr("&Pin Tab"), this, &TabContextMenu::pinTab); + addAction(webTab->isMuted() ? tr("Un&mute Tab") : tr("&Mute Tab"), this, &TabContextMenu::muteTab); if (!webTab->isRestored()) { addAction(tr("Load Tab"), this, SLOT(loadTab())); @@ -136,8 +136,8 @@ void TabContextMenu::init() } addSeparator(); - addAction(tr("Re&load All Tabs"), tabWidget, SLOT(reloadAllTabs())); - addAction(tr("Bookmark &All Tabs"), m_window, SLOT(bookmarkAllTabs())); + addAction(tr("Re&load All Tabs"), tabWidget, &TabWidget::reloadAllTabs); + addAction(tr("Bookmark &All Tabs"), m_window, &BrowserWindow::bookmarkAllTabs); addSeparator(); if (m_options & ShowCloseOtherTabsActions) { @@ -148,12 +148,12 @@ void TabContextMenu::init() } addAction(m_window->action(QSL("Other/RestoreClosedTab"))); - addAction(QIcon::fromTheme("window-close"), tr("Cl&ose Tab"), this, SLOT(closeTab())); + addAction(QIcon::fromTheme("window-close"), tr("Cl&ose Tab"), this, &TabContextMenu::closeTab); } else { - addAction(IconProvider::newTabIcon(), tr("&New tab"), m_window, SLOT(addTab())); + addAction(IconProvider::newTabIcon(), tr("&New tab"), m_window, &BrowserWindow::addTab); addSeparator(); - addAction(tr("Reloa&d All Tabs"), tabWidget, SLOT(reloadAllTabs())); - addAction(tr("Bookmark &All Tabs"), m_window, SLOT(bookmarkAllTabs())); + addAction(tr("Reloa&d All Tabs"), tabWidget, &TabWidget::reloadAllTabs); + addAction(tr("Bookmark &All Tabs"), m_window, &BrowserWindow::bookmarkAllTabs); addSeparator(); addAction(m_window->action(QSL("Other/RestoreClosedTab"))); } diff --git a/src/lib/tabwidget/tabicon.cpp b/src/lib/tabwidget/tabicon.cpp index e42015b6e..710979b05 100644 --- a/src/lib/tabwidget/tabicon.cpp +++ b/src/lib/tabwidget/tabicon.cpp @@ -36,7 +36,7 @@ TabIcon::TabIcon(QWidget* parent) m_updateTimer = new QTimer(this); m_updateTimer->setInterval(data()->animationInterval); - connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(updateAnimationFrame())); + connect(m_updateTimer, &QTimer::timeout, this, &TabIcon::updateAnimationFrame); m_hideTimer = new QTimer(this); m_hideTimer->setInterval(250); @@ -49,8 +49,8 @@ void TabIcon::setWebTab(WebTab* tab) { m_tab = tab; - connect(m_tab->webView(), SIGNAL(loadStarted()), this, SLOT(showLoadingAnimation())); - connect(m_tab->webView(), SIGNAL(loadFinished(bool)), this, SLOT(hideLoadingAnimation())); + connect(m_tab->webView(), &QWebEngineView::loadStarted, this, &TabIcon::showLoadingAnimation); + connect(m_tab->webView(), &QWebEngineView::loadFinished, this, &TabIcon::hideLoadingAnimation); connect(m_tab->webView(), &WebView::iconChanged, this, &TabIcon::updateIcon); connect(m_tab->webView(), &WebView::backgroundActivityChanged, this, [this]() { update(); }); diff --git a/src/lib/tabwidget/tabstackedwidget.cpp b/src/lib/tabwidget/tabstackedwidget.cpp index ff7b93231..6074a9251 100644 --- a/src/lib/tabwidget/tabstackedwidget.cpp +++ b/src/lib/tabwidget/tabstackedwidget.cpp @@ -44,7 +44,7 @@ TabStackedWidget::TabStackedWidget(QWidget* parent) m_mainLayout->addWidget(m_stack); setLayout(m_mainLayout); - connect(m_stack, SIGNAL(widgetRemoved(int)), this, SLOT(tabWasRemoved(int))); + connect(m_stack, &QStackedWidget::widgetRemoved, this, &TabStackedWidget::tabWasRemoved); } TabStackedWidget::~TabStackedWidget() @@ -70,12 +70,12 @@ void TabStackedWidget::setTabBar(ComboTabBar* tb) m_tabBar = tb; setFocusProxy(m_tabBar); - connect(m_tabBar, SIGNAL(currentChanged(int)), this, SLOT(showTab(int))); + connect(m_tabBar, &ComboTabBar::currentChanged, this, &TabStackedWidget::showTab); connect(m_tabBar, &ComboTabBar::tabMoved, this, &TabStackedWidget::tabWasMoved); - connect(m_tabBar, SIGNAL(overFlowChanged(bool)), this, SLOT(setUpLayout())); + connect(m_tabBar, &ComboTabBar::overFlowChanged, this, &TabStackedWidget::setUpLayout); if (m_tabBar->tabsClosable()) { - connect(m_tabBar, SIGNAL(tabCloseRequested(int)), this, SIGNAL(tabCloseRequested(int))); + connect(m_tabBar, &ComboTabBar::tabCloseRequested, this, &TabStackedWidget::tabCloseRequested); } setDocumentMode(m_tabBar->documentMode()); @@ -227,7 +227,7 @@ int TabStackedWidget::insertTab(int index, QWidget* w, const QString &label, boo if (m_currentIndex >= index) ++m_currentIndex; - QTimer::singleShot(0, this, SLOT(setUpLayout())); + QTimer::singleShot(0, this, &TabStackedWidget::setUpLayout); return index; } diff --git a/src/lib/tabwidget/tabwidget.cpp b/src/lib/tabwidget/tabwidget.cpp index ac7aaede8..d08d8a9e8 100644 --- a/src/lib/tabwidget/tabwidget.cpp +++ b/src/lib/tabwidget/tabwidget.cpp @@ -96,28 +96,28 @@ TabWidget::TabWidget(BrowserWindow *window, QWidget *parent) connect(this, &TabWidget::changed, mApp, &MainApplication::changeOccurred); connect(this, &TabStackedWidget::pinStateChanged, this, &TabWidget::changed); - connect(m_tabBar, SIGNAL(tabCloseRequested(int)), this, SLOT(requestCloseTab(int))); + connect(m_tabBar, &ComboTabBar::tabCloseRequested, this, &TabWidget::requestCloseTab); connect(m_tabBar, &TabBar::tabMoved, this, &TabWidget::tabWasMoved); - connect(m_tabBar, SIGNAL(moveAddTabButton(int)), this, SLOT(moveAddTabButton(int))); + connect(m_tabBar, &TabBar::moveAddTabButton, this, &TabWidget::moveAddTabButton); - connect(mApp, SIGNAL(settingsReloaded()), this, SLOT(loadSettings())); + connect(mApp, &MainApplication::settingsReloaded, this, &TabWidget::loadSettings); m_menuTabs = new MenuTabs(this); - connect(m_menuTabs, SIGNAL(closeTab(int)), this, SLOT(requestCloseTab(int))); + connect(m_menuTabs, &MenuTabs::closeTab, this, &TabWidget::requestCloseTab); m_menuClosedTabs = new QMenu(this); // AddTab button displayed next to last tab m_buttonAddTab = new AddTabButton(this, m_tabBar); m_buttonAddTab->setProperty("outside-tabbar", false); - connect(m_buttonAddTab, SIGNAL(clicked()), m_window, SLOT(addTab())); + connect(m_buttonAddTab, &QAbstractButton::clicked, m_window, &BrowserWindow::addTab); // AddTab button displayed outside tabbar (as corner widget) m_buttonAddTab2 = new AddTabButton(this, m_tabBar); m_buttonAddTab2->setProperty("outside-tabbar", true); m_buttonAddTab2->hide(); - connect(m_buttonAddTab2, SIGNAL(clicked()), m_window, SLOT(addTab())); + connect(m_buttonAddTab2, &QAbstractButton::clicked, m_window, &BrowserWindow::addTab); // ClosedTabs button displayed as a permanent corner widget m_buttonClosedTabs = new ToolButton(m_tabBar); @@ -128,7 +128,7 @@ TabWidget::TabWidget(BrowserWindow *window, QWidget *parent) m_buttonClosedTabs->setAutoRaise(true); m_buttonClosedTabs->setFocusPolicy(Qt::NoFocus); m_buttonClosedTabs->setShowMenuInside(true); - connect(m_buttonClosedTabs, SIGNAL(aboutToShowMenu()), this, SLOT(aboutToShowClosedTabsMenu())); + connect(m_buttonClosedTabs, &ToolButton::aboutToShowMenu, this, &TabWidget::aboutToShowClosedTabsMenu); // ListTabs button is showed only when tabbar overflows m_buttonListTabs = new ToolButton(m_tabBar); @@ -140,12 +140,12 @@ TabWidget::TabWidget(BrowserWindow *window, QWidget *parent) m_buttonListTabs->setFocusPolicy(Qt::NoFocus); m_buttonListTabs->setShowMenuInside(true); m_buttonListTabs->hide(); - connect(m_buttonListTabs, SIGNAL(aboutToShowMenu()), this, SLOT(aboutToShowTabsMenu())); + connect(m_buttonListTabs, &ToolButton::aboutToShowMenu, this, &TabWidget::aboutToShowTabsMenu); m_tabBar->addCornerWidget(m_buttonAddTab2, Qt::TopRightCorner); m_tabBar->addCornerWidget(m_buttonClosedTabs, Qt::TopRightCorner); m_tabBar->addCornerWidget(m_buttonListTabs, Qt::TopRightCorner); - connect(m_tabBar, SIGNAL(overFlowChanged(bool)), this, SLOT(tabBarOverFlowChanged(bool))); + connect(m_tabBar, &ComboTabBar::overFlowChanged, this, &TabWidget::tabBarOverFlowChanged); loadSettings(); } @@ -275,7 +275,7 @@ void TabWidget::aboutToShowTabsMenu() action->setText(QzTools::truncatedText(title, 40)); action->setData(QVariant::fromValue(qobject_cast(tab))); - connect(action, SIGNAL(triggered()), this, SLOT(actionChangeIndex())); + connect(action, &QAction::triggered, this, &TabWidget::actionChangeIndex); m_menuTabs->addAction(action); } } @@ -296,8 +296,8 @@ void TabWidget::aboutToShowClosedTabsMenu() } else { m_menuClosedTabs->addSeparator(); - m_menuClosedTabs->addAction(tr("Restore All Closed Tabs"), this, SLOT(restoreAllClosedTabs())); - m_menuClosedTabs->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear list"), this, SLOT(clearClosedTabsList())); + m_menuClosedTabs->addAction(tr("Restore All Closed Tabs"), this, &TabWidget::restoreAllClosedTabs); + m_menuClosedTabs->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear list"), this, &TabWidget::clearClosedTabsList); } } @@ -361,9 +361,9 @@ int TabWidget::addView(const LoadRequest &req, const QString &title, const Qz::N m_lastBackgroundTab = webTab; } - connect(webTab->webView(), SIGNAL(wantsCloseTab(int)), this, SLOT(closeTab(int))); - connect(webTab->webView(), SIGNAL(urlChanged(QUrl)), this, SIGNAL(changed())); - connect(webTab->webView(), SIGNAL(ipChanged(QString)), m_window->ipLabel(), SLOT(setText(QString))); + connect(webTab->webView(), &TabbedWebView::wantsCloseTab, this, &TabWidget::closeTab); + connect(webTab->webView(), &QWebEngineView::urlChanged, this, &TabWidget::changed); + connect(webTab->webView(), &TabbedWebView::ipChanged, m_window->ipLabel(), &QLabel::setText); connect(webTab->webView(), &WebView::urlChanged, this, [this](const QUrl &url) { if (url != m_urlOnNewTab) m_currentTabFresh = false; @@ -410,9 +410,9 @@ int TabWidget::insertView(int index, WebTab *tab, const Qz::NewTabPositionFlags m_lastBackgroundTab = tab; } - connect(tab->webView(), SIGNAL(wantsCloseTab(int)), this, SLOT(closeTab(int))); - connect(tab->webView(), SIGNAL(urlChanged(QUrl)), this, SIGNAL(changed())); - connect(tab->webView(), SIGNAL(ipChanged(QString)), m_window->ipLabel(), SLOT(setText(QString))); + connect(tab->webView(), &TabbedWebView::wantsCloseTab, this, &TabWidget::closeTab); + connect(tab->webView(), &QWebEngineView::urlChanged, this, &TabWidget::changed); + connect(tab->webView(), &TabbedWebView::ipChanged, m_window->ipLabel(), &QLabel::setText); // Make sure user notice opening new background tabs if (!(openFlags & Qz::NT_SelectedTab)) { @@ -454,9 +454,9 @@ void TabWidget::closeTab(int index) TabbedWebView *webView = webTab->webView(); m_locationBars->removeWidget(webView->webTab()->locationBar()); - disconnect(webView, SIGNAL(wantsCloseTab(int)), this, SLOT(closeTab(int))); - disconnect(webView, SIGNAL(urlChanged(QUrl)), this, SIGNAL(changed())); - disconnect(webView, SIGNAL(ipChanged(QString)), m_window->ipLabel(), SLOT(setText(QString))); + disconnect(webView, &TabbedWebView::wantsCloseTab, this, &TabWidget::closeTab); + disconnect(webView, &QWebEngineView::urlChanged, this, &TabWidget::changed); + disconnect(webView, &TabbedWebView::ipChanged, m_window->ipLabel(), &QLabel::setText); m_lastBackgroundTab = nullptr; @@ -690,9 +690,9 @@ void TabWidget::detachTab(WebTab* tab) } m_locationBars->removeWidget(tab->locationBar()); - disconnect(tab->webView(), SIGNAL(wantsCloseTab(int)), this, SLOT(closeTab(int))); - disconnect(tab->webView(), SIGNAL(urlChanged(QUrl)), this, SIGNAL(changed())); - disconnect(tab->webView(), SIGNAL(ipChanged(QString)), m_window->ipLabel(), SLOT(setText(QString))); + disconnect(tab->webView(), &TabbedWebView::wantsCloseTab, this, &TabWidget::closeTab); + disconnect(tab->webView(), &QWebEngineView::urlChanged, this, &TabWidget::changed); + disconnect(tab->webView(), &TabbedWebView::ipChanged, m_window->ipLabel(), &QLabel::setText); const int index = tab->tabIndex(); diff --git a/src/lib/tools/animatedwidget.cpp b/src/lib/tools/animatedwidget.cpp index cdae42f35..6c2b247b3 100644 --- a/src/lib/tools/animatedwidget.cpp +++ b/src/lib/tools/animatedwidget.cpp @@ -29,7 +29,7 @@ AnimatedWidget::AnimatedWidget(const Direction &direction, int duration, QWidget { m_timeLine.setDuration(duration); m_timeLine.setFrameRange(0, 100); - connect(&m_timeLine, SIGNAL(frameChanged(int)), this, SLOT(animateFrame(int))); + connect(&m_timeLine, &QTimeLine::frameChanged, this, &AnimatedWidget::animateFrame); setMaximumHeight(0); } @@ -73,7 +73,7 @@ void AnimatedWidget::hide() m_timeLine.setDirection(QTimeLine::Backward); m_timeLine.start(); - connect(&m_timeLine, SIGNAL(finished()), this, SLOT(close())); + connect(&m_timeLine, &QTimeLine::finished, this, &QWidget::close); QWidget* p = parentWidget(); if (p) { diff --git a/src/lib/tools/buttonwithmenu.cpp b/src/lib/tools/buttonwithmenu.cpp index ace851a3b..5cf2ff6ed 100644 --- a/src/lib/tools/buttonwithmenu.cpp +++ b/src/lib/tools/buttonwithmenu.cpp @@ -27,7 +27,7 @@ ButtonWithMenu::ButtonWithMenu(QWidget* parent) setCursor(Qt::ArrowCursor); setFocusPolicy(Qt::NoFocus); - connect(this, SIGNAL(aboutToShowMenu()), this, SLOT(generateMenu())); + connect(this, &ToolButton::aboutToShowMenu, this, &ButtonWithMenu::generateMenu); connect(m_menu, &QMenu::aboutToShow, this, std::bind(&ButtonWithMenu::setDown, this, true)); connect(m_menu, &QMenu::aboutToHide, this, std::bind(&ButtonWithMenu::setDown, this, false)); } diff --git a/src/lib/tools/delayedfilewatcher.cpp b/src/lib/tools/delayedfilewatcher.cpp index d351c8bc0..45828b477 100644 --- a/src/lib/tools/delayedfilewatcher.cpp +++ b/src/lib/tools/delayedfilewatcher.cpp @@ -33,20 +33,20 @@ DelayedFileWatcher::DelayedFileWatcher(const QStringList &paths, QObject* parent void DelayedFileWatcher::init() { - connect(this, SIGNAL(directoryChanged(QString)), this, SLOT(slotDirectoryChanged(QString))); - connect(this, SIGNAL(fileChanged(QString)), this, SLOT(slotFileChanged(QString))); + connect(this, &QFileSystemWatcher::directoryChanged, this, &DelayedFileWatcher::slotDirectoryChanged); + connect(this, &QFileSystemWatcher::fileChanged, this, &DelayedFileWatcher::slotFileChanged); } void DelayedFileWatcher::slotDirectoryChanged(const QString &path) { m_dirQueue.enqueue(path); - QTimer::singleShot(500, this, SLOT(dequeueDirectory())); + QTimer::singleShot(500, this, &DelayedFileWatcher::dequeueDirectory); } void DelayedFileWatcher::slotFileChanged(const QString &path) { m_fileQueue.enqueue(path); - QTimer::singleShot(500, this, SLOT(dequeueFile())); + QTimer::singleShot(500, this, &DelayedFileWatcher::dequeueFile); } void DelayedFileWatcher::dequeueDirectory() diff --git a/src/lib/tools/docktitlebarwidget.cpp b/src/lib/tools/docktitlebarwidget.cpp index 975dfd4ab..9ba5b290c 100644 --- a/src/lib/tools/docktitlebarwidget.cpp +++ b/src/lib/tools/docktitlebarwidget.cpp @@ -24,7 +24,7 @@ DockTitleBarWidget::DockTitleBarWidget(const QString &title, QWidget* parent) setupUi(this); closeButton->setIcon(QIcon(IconProvider::standardIcon(QStyle::SP_DialogCloseButton).pixmap(16))); label->setText(title); - connect(closeButton, SIGNAL(clicked()), parent, SLOT(close())); + connect(closeButton, &QAbstractButton::clicked, parent, &QWidget::close); setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); } diff --git a/src/lib/tools/headerview.cpp b/src/lib/tools/headerview.cpp index 5ace75c23..28289110c 100644 --- a/src/lib/tools/headerview.cpp +++ b/src/lib/tools/headerview.cpp @@ -71,7 +71,7 @@ void HeaderView::contextMenuEvent(QContextMenuEvent* event) act->setCheckable(true); act->setData(i); - connect(act, SIGNAL(triggered()), this, SLOT(toggleSectionVisibility())); + connect(act, &QAction::triggered, this, &HeaderView::toggleSectionVisibility); m_menu->addAction(act); } } diff --git a/src/lib/tools/html5permissions/html5permissionsnotification.cpp b/src/lib/tools/html5permissions/html5permissionsnotification.cpp index b32374324..7ada0bd9f 100644 --- a/src/lib/tools/html5permissions/html5permissionsnotification.cpp +++ b/src/lib/tools/html5permissions/html5permissionsnotification.cpp @@ -68,9 +68,9 @@ HTML5PermissionsNotification::HTML5PermissionsNotification(const QUrl &origin, Q break; } - connect(ui->allow, SIGNAL(clicked()), this, SLOT(grantPermissions())); - connect(ui->deny, SIGNAL(clicked()), this, SLOT(denyPermissions())); - connect(ui->close, SIGNAL(clicked()), this, SLOT(denyPermissions())); + connect(ui->allow, &QAbstractButton::clicked, this, &HTML5PermissionsNotification::grantPermissions); + connect(ui->deny, &QAbstractButton::clicked, this, &HTML5PermissionsNotification::denyPermissions); + connect(ui->close, &QAbstractButton::clicked, this, &HTML5PermissionsNotification::denyPermissions); connect(m_page.data(), &QWebEnginePage::loadStarted, this, &QObject::deleteLater); connect(m_page.data(), &QWebEnginePage::featurePermissionRequestCanceled, this, [this](const QUrl &origin, QWebEnginePage::Feature feature) { diff --git a/src/lib/tools/iconprovider.cpp b/src/lib/tools/iconprovider.cpp index d21a79108..c8dd160ed 100644 --- a/src/lib/tools/iconprovider.cpp +++ b/src/lib/tools/iconprovider.cpp @@ -39,7 +39,7 @@ IconProvider::IconProvider() : QWidget() { m_autoSaver = new AutoSaver(this); - connect(m_autoSaver, SIGNAL(save()), this, SLOT(saveIconsToDatabase())); + connect(m_autoSaver, &AutoSaver::save, this, &IconProvider::saveIconsToDatabase); } void IconProvider::saveIcon(WebView* view) diff --git a/src/lib/tools/menubar.cpp b/src/lib/tools/menubar.cpp index b129181df..e4da09c95 100644 --- a/src/lib/tools/menubar.cpp +++ b/src/lib/tools/menubar.cpp @@ -26,8 +26,8 @@ MenuBar::MenuBar(BrowserWindow* parent) setCursor(Qt::ArrowCursor); setContextMenuPolicy(Qt::CustomContextMenu); - connect(this, SIGNAL(customContextMenuRequested(QPoint)), - this, SLOT(contextMenuRequested(QPoint))); + connect(this, &QWidget::customContextMenuRequested, + this, &MenuBar::contextMenuRequested); } void MenuBar::contextMenuRequested(const QPoint &pos) diff --git a/src/lib/tools/toolbutton.cpp b/src/lib/tools/toolbutton.cpp index bfcb37133..e888b4edd 100644 --- a/src/lib/tools/toolbutton.cpp +++ b/src/lib/tools/toolbutton.cpp @@ -101,10 +101,10 @@ void ToolButton::setMenu(QMenu* menu) Q_ASSERT(menu); if (m_menu) - disconnect(m_menu, SIGNAL(aboutToHide()), this, SLOT(menuAboutToHide())); + disconnect(m_menu, &QMenu::aboutToHide, this, &ToolButton::menuAboutToHide); m_menu = menu; - connect(m_menu, SIGNAL(aboutToHide()), this, SLOT(menuAboutToHide())); + connect(m_menu, &QMenu::aboutToHide, this, &ToolButton::menuAboutToHide); } bool ToolButton::showMenuInside() const diff --git a/src/lib/tools/treewidget.cpp b/src/lib/tools/treewidget.cpp index 166578ecb..16dad56e4 100644 --- a/src/lib/tools/treewidget.cpp +++ b/src/lib/tools/treewidget.cpp @@ -24,7 +24,7 @@ TreeWidget::TreeWidget(QWidget* parent) , m_refreshAllItemsNeeded(true) , m_showMode(ItemsCollapsed) { - connect(this, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(sheduleRefresh())); + connect(this, &QTreeWidget::itemChanged, this, &TreeWidget::sheduleRefresh); } void TreeWidget::clear() diff --git a/src/lib/webengine/webpage.cpp b/src/lib/webengine/webpage.cpp index 1d32e69b2..8e2f536f5 100644 --- a/src/lib/webengine/webpage.cpp +++ b/src/lib/webengine/webpage.cpp @@ -272,7 +272,7 @@ void WebPage::finished() if (info.isFile()) { if (!m_fileWatcher) { m_fileWatcher = new DelayedFileWatcher(this); - connect(m_fileWatcher, SIGNAL(delayedFileChanged(QString)), this, SLOT(watchedFileChanged(QString))); + connect(m_fileWatcher, &DelayedFileWatcher::delayedFileChanged, this, &WebPage::watchedFileChanged); } const QString filePath = url().toLocalFile(); @@ -522,7 +522,7 @@ bool WebPage::javaScriptPrompt(const QUrl &securityOrigin, const QString &msg, c QEventLoop eLoop; m_runningLoop = &eLoop; - connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), &eLoop, SLOT(quit())); + connect(ui->buttonBox, &QDialogButtonBox::clicked, &eLoop, &QEventLoop::quit); if (eLoop.exec() == 1) { return result; @@ -568,7 +568,7 @@ bool WebPage::javaScriptConfirm(const QUrl &securityOrigin, const QString &msg) QEventLoop eLoop; m_runningLoop = &eLoop; - connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), &eLoop, SLOT(quit())); + connect(ui->buttonBox, &QDialogButtonBox::clicked, &eLoop, &QEventLoop::quit); if (eLoop.exec() == 1) { return false; @@ -623,7 +623,7 @@ void WebPage::javaScriptAlert(const QUrl &securityOrigin, const QString &msg) QEventLoop eLoop; m_runningLoop = &eLoop; - connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), &eLoop, SLOT(quit())); + connect(ui->buttonBox, &QDialogButtonBox::clicked, &eLoop, &QEventLoop::quit); if (eLoop.exec() == 1) { return; diff --git a/src/lib/webengine/webview.cpp b/src/lib/webengine/webview.cpp index a2506c1c8..b965fe0b8 100644 --- a/src/lib/webengine/webview.cpp +++ b/src/lib/webengine/webview.cpp @@ -753,10 +753,10 @@ void WebView::createPageContextMenu(QMenu* menu) // Special menu for Speed Dial page if (url().toString() == QL1S("falkon:speeddial")) { menu->addSeparator(); - menu->addAction(QIcon::fromTheme("list-add"), tr("&Add New Page"), this, SLOT(addSpeedDial())); - menu->addAction(IconProvider::settingsIcon(), tr("&Configure Speed Dial"), this, SLOT(configureSpeedDial())); + menu->addAction(QIcon::fromTheme("list-add"), tr("&Add New Page"), this, &WebView::addSpeedDial); + menu->addAction(IconProvider::settingsIcon(), tr("&Configure Speed Dial"), this, &WebView::configureSpeedDial); menu->addSeparator(); - menu->addAction(QIcon::fromTheme(QSL("view-refresh")), tr("Reload All Dials"), this, SLOT(reloadAllSpeedDials())); + menu->addAction(QIcon::fromTheme(QSL("view-refresh")), tr("Reload All Dials"), this, &WebView::reloadAllSpeedDials); return; } @@ -775,22 +775,22 @@ void WebView::createPageContextMenu(QMenu* menu) }); menu->addSeparator(); - menu->addAction(QIcon::fromTheme("bookmark-new"), tr("Book&mark page"), this, SLOT(bookmarkLink())); - menu->addAction(QIcon::fromTheme("document-save"), tr("&Save page as..."), this, SLOT(savePageAs())); - menu->addAction(QIcon::fromTheme("edit-copy"), tr("&Copy page link"), this, SLOT(copyLinkToClipboard()))->setData(url()); - menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send page link..."), this, SLOT(sendPageByMail())); + menu->addAction(QIcon::fromTheme("bookmark-new"), tr("Book&mark page"), this, &WebView::bookmarkLink); + menu->addAction(QIcon::fromTheme("document-save"), tr("&Save page as..."), this, &WebView::savePageAs); + menu->addAction(QIcon::fromTheme("edit-copy"), tr("&Copy page link"), this, &WebView::copyLinkToClipboard)->setData(url()); + menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send page link..."), this, &WebView::sendPageByMail); menu->addSeparator(); - menu->addAction(QIcon::fromTheme("edit-select-all"), tr("Select &all"), this, SLOT(editSelectAll())); + menu->addAction(QIcon::fromTheme("edit-select-all"), tr("Select &all"), this, &WebView::editSelectAll); menu->addSeparator(); const QString scheme = url().scheme(); if (scheme != QL1S("view-source") && WebPage::internalSchemes().contains(scheme)) { - menu->addAction(QIcon::fromTheme("text-html"), tr("Show so&urce code"), this, SLOT(showSource())); + menu->addAction(QIcon::fromTheme("text-html"), tr("Show so&urce code"), this, &WebView::showSource); } if (SiteInfo::canShowSiteInfo(url())) - menu->addAction(QIcon::fromTheme("dialog-information"), tr("Show info ab&out site"), this, SLOT(showSiteInfo())); + menu->addAction(QIcon::fromTheme("dialog-information"), tr("Show info ab&out site"), this, &WebView::showSiteInfo); } void WebView::createLinkContextMenu(QMenu* menu, const WebHitTestResult &hitTest) @@ -801,17 +801,17 @@ void WebView::createLinkContextMenu(QMenu* menu, const WebHitTestResult &hitTest connect(act, SIGNAL(triggered()), this, SLOT(userDefinedOpenUrlInNewTab())); connect(act, SIGNAL(ctrlTriggered()), this, SLOT(userDefinedOpenUrlInBgTab())); menu->addAction(act); - menu->addAction(IconProvider::newWindowIcon(), tr("Open link in new &window"), this, SLOT(openUrlInNewWindow()))->setData(hitTest.linkUrl()); + menu->addAction(IconProvider::newWindowIcon(), tr("Open link in new &window"), this, &WebView::openUrlInNewWindow)->setData(hitTest.linkUrl()); menu->addAction(IconProvider::privateBrowsingIcon(), tr("Open link in &private window"), mApp, SLOT(startPrivateBrowsing()))->setData(hitTest.linkUrl()); menu->addSeparator(); QVariantList bData; bData << hitTest.linkUrl() << hitTest.linkTitle(); - menu->addAction(QIcon::fromTheme("bookmark-new"), tr("B&ookmark link"), this, SLOT(bookmarkLink()))->setData(bData); + menu->addAction(QIcon::fromTheme("bookmark-new"), tr("B&ookmark link"), this, &WebView::bookmarkLink)->setData(bData); - menu->addAction(QIcon::fromTheme("document-save"), tr("&Save link as..."), this, SLOT(downloadLinkToDisk())); - menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send link..."), this, SLOT(sendTextByMail()))->setData(hitTest.linkUrl().toEncoded()); - menu->addAction(QIcon::fromTheme("edit-copy"), tr("&Copy link address"), this, SLOT(copyLinkToClipboard()))->setData(hitTest.linkUrl()); + menu->addAction(QIcon::fromTheme("document-save"), tr("&Save link as..."), this, &WebView::downloadLinkToDisk); + menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send link..."), this, &WebView::sendTextByMail)->setData(hitTest.linkUrl().toEncoded()); + menu->addAction(QIcon::fromTheme("edit-copy"), tr("&Copy link address"), this, &WebView::copyLinkToClipboard)->setData(hitTest.linkUrl()); menu->addSeparator(); if (!selectedText().isEmpty()) { @@ -826,15 +826,15 @@ void WebView::createImageContextMenu(QMenu* menu, const WebHitTestResult &hitTes if (hitTest.imageUrl() != url()) { Action *act = new Action(tr("Show i&mage")); act->setData(hitTest.imageUrl()); - connect(act, SIGNAL(triggered()), this, SLOT(openActionUrl())); + connect(act, &QAction::triggered, this, &WebView::openActionUrl); connect(act, SIGNAL(ctrlTriggered()), this, SLOT(userDefinedOpenUrlInNewTab())); menu->addAction(act); } - menu->addAction(tr("Copy image"), this, SLOT(copyImageToClipboard())); - menu->addAction(QIcon::fromTheme("edit-copy"), tr("Copy image ad&dress"), this, SLOT(copyLinkToClipboard()))->setData(hitTest.imageUrl()); + menu->addAction(tr("Copy image"), this, &WebView::copyImageToClipboard); + menu->addAction(QIcon::fromTheme("edit-copy"), tr("Copy image ad&dress"), this, &WebView::copyLinkToClipboard)->setData(hitTest.imageUrl()); menu->addSeparator(); - menu->addAction(QIcon::fromTheme("document-save"), tr("&Save image as..."), this, SLOT(downloadImageToDisk())); - menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send image..."), this, SLOT(sendTextByMail()))->setData(hitTest.imageUrl().toEncoded()); + menu->addAction(QIcon::fromTheme("document-save"), tr("&Save image as..."), this, &WebView::downloadImageToDisk); + menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send image..."), this, &WebView::sendTextByMail)->setData(hitTest.imageUrl().toEncoded()); menu->addSeparator(); if (!selectedText().isEmpty()) { @@ -853,7 +853,7 @@ void WebView::createSelectedTextContextMenu(QMenu* menu, const WebHitTestResult if (!menu->actions().contains(pageAction(QWebEnginePage::Copy))) { menu->addAction(pageAction(QWebEnginePage::Copy)); } - menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send text..."), this, SLOT(sendTextByMail()))->setData(selectedText); + menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send text..."), this, &WebView::sendTextByMail)->setData(selectedText); menu->addSeparator(); // #379: Remove newlines @@ -868,7 +868,7 @@ void WebView::createSelectedTextContextMenu(QMenu* menu, const WebHitTestResult Action* act = new Action(QIcon::fromTheme("document-open-remote"), tr("Go to &web address")); act->setData(guessedUrl); - connect(act, SIGNAL(triggered()), this, SLOT(openActionUrl())); + connect(act, &QAction::triggered, this, &WebView::openActionUrl); connect(act, SIGNAL(ctrlTriggered()), this, SLOT(userDefinedOpenUrlInNewTab())); menu->addAction(act); } @@ -880,8 +880,8 @@ void WebView::createSelectedTextContextMenu(QMenu* menu, const WebHitTestResult SearchEngine engine = mApp->searchEnginesManager()->defaultEngine(); Action* act = new Action(engine.icon, tr("Search \"%1 ..\" with %2").arg(selectedText, engine.name)); - connect(act, SIGNAL(triggered()), this, SLOT(searchSelectedText())); - connect(act, SIGNAL(ctrlTriggered()), this, SLOT(searchSelectedTextInBackgroundTab())); + connect(act, &QAction::triggered, this, &WebView::searchSelectedText); + connect(act, &Action::ctrlTriggered, this, &WebView::searchSelectedTextInBackgroundTab); menu->addAction(act); // Search with ... @@ -892,8 +892,8 @@ void WebView::createSelectedTextContextMenu(QMenu* menu, const WebHitTestResult Action* act = new Action(en.icon, en.name); act->setData(QVariant::fromValue(en)); - connect(act, SIGNAL(triggered()), this, SLOT(searchSelectedText())); - connect(act, SIGNAL(ctrlTriggered()), this, SLOT(searchSelectedTextInBackgroundTab())); + connect(act, &QAction::triggered, this, &WebView::searchSelectedText); + connect(act, &Action::ctrlTriggered, this, &WebView::searchSelectedTextInBackgroundTab); swMenu->addAction(act); } @@ -906,12 +906,12 @@ void WebView::createMediaContextMenu(QMenu *menu, const WebHitTestResult &hitTes bool muted = hitTest.mediaMuted(); menu->addSeparator(); - menu->addAction(paused ? tr("&Play") : tr("&Pause"), this, SLOT(toggleMediaPause()))->setIcon(QIcon::fromTheme(paused ? "media-playback-start" : "media-playback-pause")); - menu->addAction(muted ? tr("Un&mute") : tr("&Mute"), this, SLOT(toggleMediaMute()))->setIcon(QIcon::fromTheme(muted ? "audio-volume-muted" : "audio-volume-high")); + menu->addAction(paused ? tr("&Play") : tr("&Pause"), this, &WebView::toggleMediaPause)->setIcon(QIcon::fromTheme(paused ? "media-playback-start" : "media-playback-pause")); + menu->addAction(muted ? tr("Un&mute") : tr("&Mute"), this, &WebView::toggleMediaMute)->setIcon(QIcon::fromTheme(muted ? "audio-volume-muted" : "audio-volume-high")); menu->addSeparator(); - menu->addAction(QIcon::fromTheme("edit-copy"), tr("&Copy Media Address"), this, SLOT(copyLinkToClipboard()))->setData(hitTest.mediaUrl()); - menu->addAction(QIcon::fromTheme("mail-message-new"), tr("&Send Media Address"), this, SLOT(sendTextByMail()))->setData(hitTest.mediaUrl().toEncoded()); - menu->addAction(QIcon::fromTheme("document-save"), tr("Save Media To &Disk"), this, SLOT(downloadMediaToDisk())); + menu->addAction(QIcon::fromTheme("edit-copy"), tr("&Copy Media Address"), this, &WebView::copyLinkToClipboard)->setData(hitTest.mediaUrl()); + menu->addAction(QIcon::fromTheme("mail-message-new"), tr("&Send Media Address"), this, &WebView::sendTextByMail)->setData(hitTest.mediaUrl().toEncoded()); + menu->addAction(QIcon::fromTheme("document-save"), tr("Save Media To &Disk"), this, &WebView::downloadMediaToDisk); } void WebView::checkForForm(QAction *action, const QPoint &pos) diff --git a/src/lib/webtab/searchtoolbar.cpp b/src/lib/webtab/searchtoolbar.cpp index 7304f9bfd..37bb7b848 100644 --- a/src/lib/webtab/searchtoolbar.cpp +++ b/src/lib/webtab/searchtoolbar.cpp @@ -41,17 +41,17 @@ SearchToolBar::SearchToolBar(WebView* view, QWidget* parent) ui->previous->setShortcut(QKeySequence("Ctrl+Shift+G")); connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(close())); - connect(ui->lineEdit, SIGNAL(textEdited(QString)), this, SLOT(findNext())); - connect(ui->lineEdit, SIGNAL(returnPressed()), this, SLOT(findNext())); - connect(ui->next, SIGNAL(clicked()), this, SLOT(findNext())); - connect(ui->previous, SIGNAL(clicked()), this, SLOT(findPrevious())); - connect(ui->caseSensitive, SIGNAL(clicked()), this, SLOT(caseSensitivityChanged())); + connect(ui->lineEdit, &QLineEdit::textEdited, this, &SearchToolBar::findNext); + connect(ui->lineEdit, &QLineEdit::returnPressed, this, &SearchToolBar::findNext); + connect(ui->next, &QAbstractButton::clicked, this, &SearchToolBar::findNext); + connect(ui->previous, &QAbstractButton::clicked, this, &SearchToolBar::findPrevious); + connect(ui->caseSensitive, &QAbstractButton::clicked, this, &SearchToolBar::caseSensitivityChanged); QShortcut* findNextAction = new QShortcut(QKeySequence("F3"), this); - connect(findNextAction, SIGNAL(activated()), this, SLOT(findNext())); + connect(findNextAction, &QShortcut::activated, this, &SearchToolBar::findNext); QShortcut* findPreviousAction = new QShortcut(QKeySequence("Shift+F3"), this); - connect(findPreviousAction, SIGNAL(activated()), this, SLOT(findPrevious())); + connect(findPreviousAction, &QShortcut::activated, this, &SearchToolBar::findPrevious); parent->installEventFilter(this); } diff --git a/src/lib/webtab/tabbedwebview.cpp b/src/lib/webtab/tabbedwebview.cpp index ea5389bfd..6f410503c 100644 --- a/src/lib/webtab/tabbedwebview.cpp +++ b/src/lib/webtab/tabbedwebview.cpp @@ -191,7 +191,7 @@ void TabbedWebView::_contextMenuEvent(QContextMenuEvent *event) if (WebInspector::isEnabled()) { m_menu->addSeparator(); - m_menu->addAction(tr("Inspect Element"), this, SLOT(inspectElement())); + m_menu->addAction(tr("Inspect Element"), this, &TabbedWebView::inspectElement); } if (!m_menu->isEmpty()) { diff --git a/src/lib/webtab/webtab.cpp b/src/lib/webtab/webtab.cpp index 9a3e0e87a..797b58ab5 100644 --- a/src/lib/webtab/webtab.cpp +++ b/src/lib/webtab/webtab.cpp @@ -177,8 +177,8 @@ WebTab::WebTab(QWidget *parent) nlayout->setContentsMargins(0, 0, 0, 0); nlayout->setSpacing(1); - connect(m_webView, SIGNAL(showNotification(QWidget*)), this, SLOT(showNotification(QWidget*))); - connect(m_webView, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished())); + connect(m_webView, &WebView::showNotification, this, &WebTab::showNotification); + connect(m_webView, &QWebEngineView::loadFinished, this, &WebTab::loadFinished); connect(m_webView, &TabbedWebView::titleChanged, this, &WebTab::titleWasChanged); connect(m_webView, &TabbedWebView::titleChanged, this, &WebTab::titleChanged); connect(m_webView, &TabbedWebView::iconChanged, this, &WebTab::iconChanged); diff --git a/src/plugins/AutoScroll/autoscrollsettings.cpp b/src/plugins/AutoScroll/autoscrollsettings.cpp index 17f9ba64d..c6b9d2e01 100644 --- a/src/plugins/AutoScroll/autoscrollsettings.cpp +++ b/src/plugins/AutoScroll/autoscrollsettings.cpp @@ -32,7 +32,7 @@ AutoScrollSettings::AutoScrollSettings(AutoScroller* scroller, QWidget* parent) ui->iconLabel->setPixmap(QIcon(QStringLiteral(":/autoscroll/data/scroll_all.png")).pixmap(32)); connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accepted())); - connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(close())); + connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QWidget::close); } AutoScrollSettings::~AutoScrollSettings() diff --git a/src/plugins/AutoScroll/framescroller.cpp b/src/plugins/AutoScroll/framescroller.cpp index 9599c94b9..152f5c226 100644 --- a/src/plugins/AutoScroll/framescroller.cpp +++ b/src/plugins/AutoScroll/framescroller.cpp @@ -30,7 +30,7 @@ FrameScroller::FrameScroller(QObject* parent) { m_timer = new QTimer(this); m_timer->setInterval(10); - connect(m_timer, SIGNAL(timeout()), this, SLOT(scrollStep())); + connect(m_timer, &QTimer::timeout, this, &FrameScroller::scrollStep); } void FrameScroller::setPage(WebPage *page) diff --git a/src/plugins/FlashCookieManager/fcm_dialog.cpp b/src/plugins/FlashCookieManager/fcm_dialog.cpp index 4726d5667..213f5f395 100644 --- a/src/plugins/FlashCookieManager/fcm_dialog.cpp +++ b/src/plugins/FlashCookieManager/fcm_dialog.cpp @@ -49,22 +49,22 @@ FCM_Dialog::FCM_Dialog(FCM_Plugin* manager, QWidget* parent) ui->blackList->setLayoutDirection(Qt::LeftToRight); } - connect(ui->flashCookieTree, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*))); - connect(ui->removeAll, SIGNAL(clicked()), this, SLOT(removeAll())); - connect(ui->removeOne, SIGNAL(clicked()), this, SLOT(removeCookie())); - connect(ui->close, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); - connect(ui->close2, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); - connect(ui->close3, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); - connect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString))); - connect(ui->reloadFromDisk, SIGNAL(clicked()), this, SLOT(reloadFromDisk())); + connect(ui->flashCookieTree, &QTreeWidget::currentItemChanged, this, &FCM_Dialog::currentItemChanged); + connect(ui->removeAll, &QAbstractButton::clicked, this, &FCM_Dialog::removeAll); + connect(ui->removeOne, &QAbstractButton::clicked, this, &FCM_Dialog::removeCookie); + connect(ui->close, &QDialogButtonBox::clicked, this, &QWidget::close); + connect(ui->close2, &QDialogButtonBox::clicked, this, &QWidget::close); + connect(ui->close3, &QDialogButtonBox::clicked, this, &QWidget::close); + connect(ui->search, &QLineEdit::textChanged, this, &FCM_Dialog::filterString); + connect(ui->reloadFromDisk, &QAbstractButton::clicked, this, &FCM_Dialog::reloadFromDisk); connect(ui->whiteAdd, SIGNAL(clicked()), this, SLOT(addWhitelist())); - connect(ui->whiteRemove, SIGNAL(clicked()), this, SLOT(removeWhitelist())); + connect(ui->whiteRemove, &QAbstractButton::clicked, this, &FCM_Dialog::removeWhitelist); connect(ui->blackAdd, SIGNAL(clicked()), this, SLOT(addBlacklist())); - connect(ui->blackRemove, SIGNAL(clicked()), this, SLOT(removeBlacklist())); + connect(ui->blackRemove, &QAbstractButton::clicked, this, &FCM_Dialog::removeBlacklist); - connect(ui->autoMode, SIGNAL(toggled(bool)), ui->notification, SLOT(setEnabled(bool))); - connect(ui->autoMode, SIGNAL(toggled(bool)), ui->labelNotification, SLOT(setEnabled(bool))); + connect(ui->autoMode, &QAbstractButton::toggled, ui->notification, &QWidget::setEnabled); + connect(ui->autoMode, &QAbstractButton::toggled, ui->labelNotification, &QWidget::setEnabled); ui->autoMode->setChecked(m_manager->readSettings().value(QL1S("autoMode")).toBool()); ui->notification->setEnabled(m_manager->readSettings().value(QL1S("autoMode")).toBool()); @@ -80,10 +80,10 @@ FCM_Dialog::FCM_Dialog(FCM_Plugin* manager, QWidget* parent) ui->flashCookieTree->setFocus(); ui->flashCookieTree->setContextMenuPolicy(Qt::CustomContextMenu); - connect(ui->flashCookieTree, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(cookieTreeContextMenuRequested(QPoint))); + connect(ui->flashCookieTree, &QWidget::customContextMenuRequested, this, &FCM_Dialog::cookieTreeContextMenuRequested); QShortcut* removeShortcut = new QShortcut(QKeySequence("Del"), this); - connect(removeShortcut, SIGNAL(activated()), this, SLOT(deletePressed())); + connect(removeShortcut, &QShortcut::activated, this, &FCM_Dialog::deletePressed); QzTools::setWmClass("FlashCookies", this); } @@ -180,18 +180,18 @@ void FCM_Dialog::currentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem* p void FCM_Dialog::refreshView(bool forceReload) { - disconnect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString))); + disconnect(ui->search, &QLineEdit::textChanged, this, &FCM_Dialog::filterString); ui->search->clear(); ui->textEdit->clear(); - connect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString))); + connect(ui->search, &QLineEdit::textChanged, this, &FCM_Dialog::filterString); if (forceReload) { m_manager->clearCache(); m_manager->clearNewOrigins(); } - QTimer::singleShot(0, this, SLOT(refreshFlashCookiesTree())); - QTimer::singleShot(0, this, SLOT(refreshFilters())); + QTimer::singleShot(0, this, &FCM_Dialog::refreshFlashCookiesTree); + QTimer::singleShot(0, this, &FCM_Dialog::refreshFilters); } void FCM_Dialog::showPage(int index) diff --git a/src/plugins/FlashCookieManager/fcm_plugin.cpp b/src/plugins/FlashCookieManager/fcm_plugin.cpp index e262430a6..5a2a20ac6 100644 --- a/src/plugins/FlashCookieManager/fcm_plugin.cpp +++ b/src/plugins/FlashCookieManager/fcm_plugin.cpp @@ -74,12 +74,12 @@ void FCM_Plugin::init(InitState state, const QString &settingsPath) { m_settingsPath = settingsPath; - connect(mApp->plugins(), SIGNAL(mainWindowCreated(BrowserWindow*)), this, SLOT(mainWindowCreated(BrowserWindow*))); - connect(mApp->plugins(), SIGNAL(mainWindowDeleted(BrowserWindow*)), this, SLOT(mainWindowDeleted(BrowserWindow*))); + connect(mApp->plugins(), &PluginProxy::mainWindowCreated, this, &FCM_Plugin::mainWindowCreated); + connect(mApp->plugins(), &PluginProxy::mainWindowDeleted, this, &FCM_Plugin::mainWindowDeleted); m_timer = new QTimer(this); m_timer->setInterval(refreshInterval); - connect(m_timer, SIGNAL(timeout()), this, SLOT(autoRefresh())); + connect(m_timer, &QTimer::timeout, this, &FCM_Plugin::autoRefresh); // start timer if needed startStopTimer(); @@ -130,7 +130,7 @@ void FCM_Plugin::showSettings(QWidget* parent) void FCM_Plugin::populateExtensionsMenu(QMenu* menu) { QAction* showFCM = new QAction(QIcon(":/flashcookiemanager/data/flash-cookie-manager.png"), tr("Flash Cookie Manager"), menu); - connect(showFCM, SIGNAL(triggered()), this, SLOT(showFlashCookieManager())); + connect(showFCM, &QAction::triggered, this, &FCM_Plugin::showFlashCookieManager); menu->addAction(showFCM); } diff --git a/src/plugins/GreaseMonkey/gm_addscriptdialog.cpp b/src/plugins/GreaseMonkey/gm_addscriptdialog.cpp index 5f8e5e177..c66a2d820 100644 --- a/src/plugins/GreaseMonkey/gm_addscriptdialog.cpp +++ b/src/plugins/GreaseMonkey/gm_addscriptdialog.cpp @@ -57,7 +57,7 @@ GM_AddScriptDialog::GM_AddScriptDialog(GM_Manager* manager, GM_Script* script, Q QString scriptInfo = QString("%1 %2
%3 %4 %5").arg(script->name(), script->version(), script->description(), runsAt, dontRunsAt); ui->textBrowser->setText(scriptInfo); - connect(ui->showSource, SIGNAL(clicked()), this, SLOT(showSource())); + connect(ui->showSource, &QAbstractButton::clicked, this, &GM_AddScriptDialog::showSource); connect(this, SIGNAL(accepted()), this, SLOT(accepted())); } diff --git a/src/plugins/GreaseMonkey/gm_notification.cpp b/src/plugins/GreaseMonkey/gm_notification.cpp index 6d518b769..2f80a0c9b 100644 --- a/src/plugins/GreaseMonkey/gm_notification.cpp +++ b/src/plugins/GreaseMonkey/gm_notification.cpp @@ -37,7 +37,7 @@ GM_Notification::GM_Notification(GM_Manager* manager, const QString &tmpfileName ui->iconLabel->setPixmap(QIcon(QSL(":gm/data/icon.svg")).pixmap(24)); ui->close->setIcon(IconProvider::standardIcon(QStyle::SP_DialogCloseButton)); - connect(ui->install, SIGNAL(clicked()), this, SLOT(installScript())); + connect(ui->install, &QAbstractButton::clicked, this, &GM_Notification::installScript); connect(ui->close, SIGNAL(clicked()), this, SLOT(hide())); startAnimation(); diff --git a/src/plugins/GreaseMonkey/gm_plugin.cpp b/src/plugins/GreaseMonkey/gm_plugin.cpp index 3a8dbde15..43379f6c6 100644 --- a/src/plugins/GreaseMonkey/gm_plugin.cpp +++ b/src/plugins/GreaseMonkey/gm_plugin.cpp @@ -41,8 +41,8 @@ void GM_Plugin::init(InitState state, const QString &settingsPath) { m_manager = new GM_Manager(settingsPath, this); - connect(mApp->plugins(), SIGNAL(mainWindowCreated(BrowserWindow*)), m_manager, SLOT(mainWindowCreated(BrowserWindow*))); - connect(mApp->plugins(), SIGNAL(mainWindowDeleted(BrowserWindow*)), m_manager, SLOT(mainWindowDeleted(BrowserWindow*))); + connect(mApp->plugins(), &PluginProxy::mainWindowCreated, m_manager, &GM_Manager::mainWindowCreated); + connect(mApp->plugins(), &PluginProxy::mainWindowDeleted, m_manager, &GM_Manager::mainWindowDeleted); // Make sure userscripts works also with already created WebPages if (state == LateInitState) { diff --git a/src/plugins/GreaseMonkey/gm_script.cpp b/src/plugins/GreaseMonkey/gm_script.cpp index 5079f8d63..11716af8e 100644 --- a/src/plugins/GreaseMonkey/gm_script.cpp +++ b/src/plugins/GreaseMonkey/gm_script.cpp @@ -46,7 +46,7 @@ GM_Script::GM_Script(GM_Manager* manager, const QString &filePath) { parseScript(); - connect(m_fileWatcher, SIGNAL(delayedFileChanged(QString)), this, SLOT(watchedFileChanged(QString))); + connect(m_fileWatcher, &DelayedFileWatcher::delayedFileChanged, this, &GM_Script::watchedFileChanged); } bool GM_Script::isValid() const diff --git a/src/plugins/GreaseMonkey/settings/gm_settings.cpp b/src/plugins/GreaseMonkey/settings/gm_settings.cpp index 3e73286ee..bf1162872 100644 --- a/src/plugins/GreaseMonkey/settings/gm_settings.cpp +++ b/src/plugins/GreaseMonkey/settings/gm_settings.cpp @@ -37,20 +37,20 @@ GM_Settings::GM_Settings(GM_Manager* manager, QWidget* parent) ui->setupUi(this); ui->iconLabel->setPixmap(QIcon(QSL(":gm/data/icon.svg")).pixmap(32)); - connect(ui->listWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), - this, SLOT(showItemInfo(QListWidgetItem*))); - connect(ui->listWidget, SIGNAL(updateItemRequested(QListWidgetItem*)), - this, SLOT(updateItem(QListWidgetItem*))); - connect(ui->listWidget, SIGNAL(removeItemRequested(QListWidgetItem*)), - this, SLOT(removeItem(QListWidgetItem*))); - connect(ui->openDirectory, SIGNAL(clicked()), - this, SLOT(openScriptsDirectory())); - connect(ui->newScript, SIGNAL(clicked()), - this, SLOT(newScript())); - connect(ui->link, SIGNAL(clicked(QPoint)), - this, SLOT(openUserJs())); - connect(manager, SIGNAL(scriptsChanged()), - this, SLOT(loadScripts())); + connect(ui->listWidget, &QListWidget::itemDoubleClicked, + this, &GM_Settings::showItemInfo); + connect(ui->listWidget, &GM_SettingsListWidget::updateItemRequested, + this, &GM_Settings::updateItem); + connect(ui->listWidget, &GM_SettingsListWidget::removeItemRequested, + this, &GM_Settings::removeItem); + connect(ui->openDirectory, &QAbstractButton::clicked, + this, &GM_Settings::openScriptsDirectory); + connect(ui->newScript, &QAbstractButton::clicked, + this, &GM_Settings::newScript); + connect(ui->link, &ClickableLabel::clicked, + this, &GM_Settings::openUserJs); + connect(manager, &GM_Manager::scriptsChanged, + this, &GM_Settings::loadScripts); loadScripts(); } @@ -147,8 +147,8 @@ void GM_Settings::newScript() void GM_Settings::loadScripts() { - disconnect(ui->listWidget, SIGNAL(itemChanged(QListWidgetItem*)), - this, SLOT(itemChanged(QListWidgetItem*))); + disconnect(ui->listWidget, &QListWidget::itemChanged, + this, &GM_Settings::itemChanged); ui->listWidget->clear(); @@ -188,7 +188,7 @@ void GM_Settings::loadScripts() } while (itemMoved); - connect(ui->listWidget, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*))); + connect(ui->listWidget, &QListWidget::itemChanged, this, &GM_Settings::itemChanged); } GM_Script* GM_Settings::getScript(QListWidgetItem* item) diff --git a/src/plugins/GreaseMonkey/settings/gm_settingsscriptinfo.cpp b/src/plugins/GreaseMonkey/settings/gm_settingsscriptinfo.cpp index 990f05140..2f916b6b3 100644 --- a/src/plugins/GreaseMonkey/settings/gm_settingsscriptinfo.cpp +++ b/src/plugins/GreaseMonkey/settings/gm_settingsscriptinfo.cpp @@ -31,8 +31,8 @@ GM_SettingsScriptInfo::GM_SettingsScriptInfo(GM_Script* script, QWidget* parent) ui->setupUi(this); loadScript(); - connect(m_script, SIGNAL(scriptChanged()), this, SLOT(loadScript())); - connect(ui->editInEditor, SIGNAL(clicked()), this, SLOT(editInTextEditor())); + connect(m_script, &GM_Script::scriptChanged, this, &GM_SettingsScriptInfo::loadScript); + connect(ui->editInEditor, &QAbstractButton::clicked, this, &GM_SettingsScriptInfo::editInTextEditor); } void GM_SettingsScriptInfo::editInTextEditor() diff --git a/src/plugins/MouseGestures/mousegestures.cpp b/src/plugins/MouseGestures/mousegestures.cpp index 01142c7a6..a6a0b010a 100644 --- a/src/plugins/MouseGestures/mousegestures.cpp +++ b/src/plugins/MouseGestures/mousegestures.cpp @@ -53,34 +53,34 @@ void MouseGestures::initFilter() m_filter = new QjtMouseGestureFilter(false, m_button, 20); QjtMouseGesture* upGesture = new QjtMouseGesture(DirectionList() << Up, m_filter); - connect(upGesture, SIGNAL(gestured()), this, SLOT(upGestured())); + connect(upGesture, &QjtMouseGesture::gestured, this, &MouseGestures::upGestured); QjtMouseGesture* downGesture = new QjtMouseGesture(DirectionList() << Down, m_filter); - connect(downGesture, SIGNAL(gestured()), this, SLOT(downGestured())); + connect(downGesture, &QjtMouseGesture::gestured, this, &MouseGestures::downGestured); QjtMouseGesture* leftGesture = new QjtMouseGesture(DirectionList() << Left, m_filter); - connect(leftGesture, SIGNAL(gestured()), this, SLOT(leftGestured())); + connect(leftGesture, &QjtMouseGesture::gestured, this, &MouseGestures::leftGestured); QjtMouseGesture* rightGesture = new QjtMouseGesture(DirectionList() << Right, m_filter); - connect(rightGesture, SIGNAL(gestured()), this, SLOT(rightGestured())); + connect(rightGesture, &QjtMouseGesture::gestured, this, &MouseGestures::rightGestured); QjtMouseGesture* downRightGesture = new QjtMouseGesture(DirectionList() << Down << Right, m_filter); - connect(downRightGesture, SIGNAL(gestured()), this, SLOT(downRightGestured())); + connect(downRightGesture, &QjtMouseGesture::gestured, this, &MouseGestures::downRightGestured); QjtMouseGesture* downLeftGesture = new QjtMouseGesture(DirectionList() << Down << Left, m_filter); - connect(downLeftGesture, SIGNAL(gestured()), this, SLOT(downLeftGestured())); + connect(downLeftGesture, &QjtMouseGesture::gestured, this, &MouseGestures::downLeftGestured); QjtMouseGesture* downUpGesture = new QjtMouseGesture(DirectionList() << Down << Up, m_filter); - connect(downUpGesture, SIGNAL(gestured()), this, SLOT(downUpGestured())); + connect(downUpGesture, &QjtMouseGesture::gestured, this, &MouseGestures::downUpGestured); QjtMouseGesture* upDownGesture = new QjtMouseGesture(DirectionList() << Up << Down, m_filter); - connect(upDownGesture, SIGNAL(gestured()), this, SLOT(upDownGestured())); + connect(upDownGesture, &QjtMouseGesture::gestured, this, &MouseGestures::upDownGestured); QjtMouseGesture* upLeftGesture = new QjtMouseGesture(DirectionList() << Up << Left, m_filter); - connect(upLeftGesture, SIGNAL(gestured()), this, SLOT(upLeftGestured())); + connect(upLeftGesture, &QjtMouseGesture::gestured, this, &MouseGestures::upLeftGestured); QjtMouseGesture* upRightGesture = new QjtMouseGesture(DirectionList() << Up << Right, m_filter); - connect(upRightGesture, SIGNAL(gestured()), this, SLOT(upRightGestured())); + connect(upRightGesture, &QjtMouseGesture::gestured, this, &MouseGestures::upRightGestured); m_filter->addGesture(upGesture); m_filter->addGesture(downGesture); diff --git a/src/plugins/MouseGestures/mousegesturessettingsdialog.cpp b/src/plugins/MouseGestures/mousegesturessettingsdialog.cpp index ced707543..8dd2f0012 100644 --- a/src/plugins/MouseGestures/mousegesturessettingsdialog.cpp +++ b/src/plugins/MouseGestures/mousegesturessettingsdialog.cpp @@ -44,8 +44,8 @@ MouseGesturesSettingsDialog::MouseGesturesSettingsDialog(MouseGestures* gestures setAttribute(Qt::WA_DeleteOnClose); connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accepted())); - connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(close())); - connect(ui->licenseButton, SIGNAL(clicked()), this, SLOT(showLicense())); + connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QWidget::close); + connect(ui->licenseButton, &QAbstractButton::clicked, this, &MouseGesturesSettingsDialog::showLicense); } MouseGesturesSettingsDialog::~MouseGesturesSettingsDialog() diff --git a/src/plugins/PIM/PIM_handler.cpp b/src/plugins/PIM/PIM_handler.cpp index 27e380271..ad6601601 100644 --- a/src/plugins/PIM/PIM_handler.cpp +++ b/src/plugins/PIM/PIM_handler.cpp @@ -91,7 +91,7 @@ void PIM_Handler::showSettings(QWidget* parent) if (!m_settings) { m_settings = new PIM_Settings(m_settingsFile, parent); - connect(m_settings.data(), SIGNAL(accepted()), this, SLOT(loadSettings())); + connect(m_settings.data(), &QDialog::accepted, this, &PIM_Handler::loadSettings); } m_settings.data()->show(); @@ -116,7 +116,7 @@ void PIM_Handler::populateWebViewMenu(QMenu* menu, WebView* view, const WebHitTe if (!m_allInfo[PI_FirstName].isEmpty() && !m_allInfo[PI_LastName].isEmpty()) { const QString fullname = m_allInfo[PI_FirstName] + " " + m_allInfo[PI_LastName]; - QAction* action = pimMenu->addAction(fullname, this, SLOT(pimInsert())); + QAction* action = pimMenu->addAction(fullname, this, &PIM_Handler::pimInsert); action->setData(fullname); } @@ -126,7 +126,7 @@ void PIM_Handler::populateWebViewMenu(QMenu* menu, WebView* view, const WebHitTe continue; } - QAction* action = pimMenu->addAction(info, this, SLOT(pimInsert())); + QAction* action = pimMenu->addAction(info, this, &PIM_Handler::pimInsert); action->setData(info); action->setStatusTip(m_translations[PI_Type(i)]); } @@ -179,7 +179,7 @@ void PIM_Handler::unloadPlugin() void PIM_Handler::webPageCreated(WebPage* page) { - connect(page, SIGNAL(loadFinished(bool)), this, SLOT(pageLoadFinished())); + connect(page, &QWebEnginePage::loadFinished, this, &PIM_Handler::pageLoadFinished); } void PIM_Handler::pimInsert() diff --git a/src/plugins/PIM/PIM_settings.cpp b/src/plugins/PIM/PIM_settings.cpp index 452a2dc39..403f8a47b 100644 --- a/src/plugins/PIM/PIM_settings.cpp +++ b/src/plugins/PIM/PIM_settings.cpp @@ -49,7 +49,7 @@ PIM_Settings::PIM_Settings(const QString &settingsFile, QWidget* parent) ui->pim_special3->setText(settings.value("Special3", QString()).toString()); settings.endGroup(); - connect(this, SIGNAL(accepted()), this, SLOT(dialogAccepted())); + connect(this, &QDialog::accepted, this, &PIM_Settings::dialogAccepted); } void PIM_Settings::dialogAccepted() diff --git a/src/plugins/StatusBarIcons/sbi_imagesicon.cpp b/src/plugins/StatusBarIcons/sbi_imagesicon.cpp index 8af287f09..db61f92ce 100644 --- a/src/plugins/StatusBarIcons/sbi_imagesicon.cpp +++ b/src/plugins/StatusBarIcons/sbi_imagesicon.cpp @@ -46,7 +46,7 @@ SBI_ImagesIcon::SBI_ImagesIcon(BrowserWindow* window, const QString &settingsPat updateIcon(); connect(m_window->tabWidget(), SIGNAL(currentChanged(int)), this, SLOT(updateIcon())); - connect(this, SIGNAL(clicked(QPoint)), this, SLOT(showMenu(QPoint))); + connect(this, &ClickableLabel::clicked, this, &SBI_ImagesIcon::showMenu); } void SBI_ImagesIcon::showMenu(const QPoint &point) @@ -58,10 +58,10 @@ void SBI_ImagesIcon::showMenu(const QPoint &point) menu.addAction(m_icon, tr("Current Page Settings"))->setFont(boldFont); if (testCurrentPageWebAttribute(QWebEngineSettings::AutoLoadImages)) { - menu.addAction(tr("Disable loading images (temporarily)"), this, SLOT(toggleLoadingImages())); + menu.addAction(tr("Disable loading images (temporarily)"), this, &SBI_ImagesIcon::toggleLoadingImages); } else { - menu.addAction(tr("Enable loading images (temporarily)"), this, SLOT(toggleLoadingImages())); + menu.addAction(tr("Enable loading images (temporarily)"), this, &SBI_ImagesIcon::toggleLoadingImages); } menu.addSeparator(); @@ -70,7 +70,7 @@ void SBI_ImagesIcon::showMenu(const QPoint &point) QAction* act = menu.addAction(tr("Automatically load images")); act->setCheckable(true); act->setChecked(m_loadingImages); - connect(act, SIGNAL(toggled(bool)), this, SLOT(setGlobalLoadingImages(bool))); + connect(act, &QAction::toggled, this, &SBI_ImagesIcon::setGlobalLoadingImages); menu.exec(point); } diff --git a/src/plugins/StatusBarIcons/sbi_javascripticon.cpp b/src/plugins/StatusBarIcons/sbi_javascripticon.cpp index c429f3432..c646af78b 100644 --- a/src/plugins/StatusBarIcons/sbi_javascripticon.cpp +++ b/src/plugins/StatusBarIcons/sbi_javascripticon.cpp @@ -37,7 +37,7 @@ SBI_JavaScriptIcon::SBI_JavaScriptIcon(BrowserWindow* window) setPixmap(m_icon.pixmap(16)); connect(m_window->tabWidget(), SIGNAL(currentChanged(int)), this, SLOT(updateIcon())); - connect(this, SIGNAL(clicked(QPoint)), this, SLOT(showMenu(QPoint))); + connect(this, &ClickableLabel::clicked, this, &SBI_JavaScriptIcon::showMenu); updateIcon(); } @@ -51,10 +51,10 @@ void SBI_JavaScriptIcon::showMenu(const QPoint &point) menu.addAction(m_icon, tr("Current Page Settings"))->setFont(boldFont); if (testCurrentPageWebAttribute(QWebEngineSettings::JavascriptEnabled)) { - menu.addAction(tr("Disable JavaScript (temporarily)"), this, SLOT(toggleJavaScript())); + menu.addAction(tr("Disable JavaScript (temporarily)"), this, &SBI_JavaScriptIcon::toggleJavaScript); } else { - menu.addAction(tr("Enable JavaScript (temporarily)"), this, SLOT(toggleJavaScript())); + menu.addAction(tr("Enable JavaScript (temporarily)"), this, &SBI_JavaScriptIcon::toggleJavaScript); } // JavaScript needs to be always enabled for falkon: sites @@ -64,7 +64,7 @@ void SBI_JavaScriptIcon::showMenu(const QPoint &point) menu.addSeparator(); menu.addAction(m_icon, tr("Global Settings"))->setFont(boldFont); - menu.addAction(tr("Manage JavaScript settings"), this, SLOT(openJavaScriptSettings())); + menu.addAction(tr("Manage JavaScript settings"), this, &SBI_JavaScriptIcon::openJavaScriptSettings); menu.exec(point); } diff --git a/src/plugins/StatusBarIcons/sbi_networkicon.cpp b/src/plugins/StatusBarIcons/sbi_networkicon.cpp index 38b28e296..80a72f987 100644 --- a/src/plugins/StatusBarIcons/sbi_networkicon.cpp +++ b/src/plugins/StatusBarIcons/sbi_networkicon.cpp @@ -34,8 +34,8 @@ SBI_NetworkIcon::SBI_NetworkIcon(BrowserWindow* window) onlineStateChanged(m_networkConfiguration->isOnline()); - connect(m_networkConfiguration, SIGNAL(onlineStateChanged(bool)), this, SLOT(onlineStateChanged(bool))); - connect(this, SIGNAL(clicked(QPoint)), this, SLOT(showMenu(QPoint))); + connect(m_networkConfiguration, &QNetworkConfigurationManager::onlineStateChanged, this, &SBI_NetworkIcon::onlineStateChanged); + connect(this, &ClickableLabel::clicked, this, &SBI_NetworkIcon::showMenu); } void SBI_NetworkIcon::onlineStateChanged(bool online) @@ -71,7 +71,7 @@ void SBI_NetworkIcon::showMenu(const QPoint &pos) QHashIterator it(proxies); while (it.hasNext()) { it.next(); - QAction* act = proxyMenu->addAction(it.key(), this, SLOT(useProxy())); + QAction* act = proxyMenu->addAction(it.key(), this, &SBI_NetworkIcon::useProxy); act->setData(it.key()); act->setCheckable(true); act->setChecked(it.value() == SBINetManager->currentProxy()); @@ -82,7 +82,7 @@ void SBI_NetworkIcon::showMenu(const QPoint &pos) } menu.addSeparator(); - menu.addAction(tr("Manage proxies"), this, SLOT(showDialog())); + menu.addAction(tr("Manage proxies"), this, &SBI_NetworkIcon::showDialog); menu.exec(pos); } diff --git a/src/plugins/StatusBarIcons/sbi_networkicondialog.cpp b/src/plugins/StatusBarIcons/sbi_networkicondialog.cpp index 5e2b67942..6536a369c 100644 --- a/src/plugins/StatusBarIcons/sbi_networkicondialog.cpp +++ b/src/plugins/StatusBarIcons/sbi_networkicondialog.cpp @@ -45,11 +45,11 @@ SBI_NetworkIconDialog::SBI_NetworkIconDialog(QWidget* parent) updateWidgets(); showProxy(ui->comboBox->currentText()); - connect(ui->addButton, SIGNAL(clicked()), this, SLOT(addProxy())); - connect(ui->removeButton, SIGNAL(clicked()), this, SLOT(removeProxy())); + connect(ui->addButton, &QAbstractButton::clicked, this, &SBI_NetworkIconDialog::addProxy); + connect(ui->removeButton, &QAbstractButton::clicked, this, &SBI_NetworkIconDialog::removeProxy); connect(ui->comboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(showProxy(QString))); - connect(ui->proxyButtonBox, SIGNAL(accepted()), this, SLOT(saveProxy())); - connect(ui->closeButton, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); + connect(ui->proxyButtonBox, &QDialogButtonBox::accepted, this, &SBI_NetworkIconDialog::saveProxy); + connect(ui->closeButton, &QDialogButtonBox::clicked, this, &QWidget::close); } void SBI_NetworkIconDialog::addProxy() diff --git a/src/plugins/StatusBarIcons/sbi_settingsdialog.cpp b/src/plugins/StatusBarIcons/sbi_settingsdialog.cpp index 8a2aecfa5..458d1c262 100644 --- a/src/plugins/StatusBarIcons/sbi_settingsdialog.cpp +++ b/src/plugins/StatusBarIcons/sbi_settingsdialog.cpp @@ -33,8 +33,8 @@ SBI_SettingsDialog::SBI_SettingsDialog(SBI_IconsManager* manager, QWidget* paren ui->showNetworkIcon->setChecked(m_manager->showNetworkIcon()); ui->showZoomWidget->setChecked(m_manager->showZoomWidget()); - connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(saveSettings())); - connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(close())); + connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &SBI_SettingsDialog::saveSettings); + connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QWidget::close); } void SBI_SettingsDialog::saveSettings() diff --git a/src/plugins/StatusBarIcons/sbi_zoomwidget.cpp b/src/plugins/StatusBarIcons/sbi_zoomwidget.cpp index 4b5f661c2..39becd94c 100644 --- a/src/plugins/StatusBarIcons/sbi_zoomwidget.cpp +++ b/src/plugins/StatusBarIcons/sbi_zoomwidget.cpp @@ -34,7 +34,7 @@ SBI_ZoomWidget::SBI_ZoomWidget(BrowserWindow* parent) setRange(0, WebView::zoomLevels().count() - 1); connect(this, SIGNAL(valueChanged(int)), this, SLOT(valueChanged(int))); - connect(m_window->tabWidget(), SIGNAL(currentChanged(int)), this, SLOT(currentViewChanged())); + connect(m_window->tabWidget(), &TabStackedWidget::currentChanged, this, &SBI_ZoomWidget::currentViewChanged); currentViewChanged(); } @@ -54,7 +54,7 @@ void SBI_ZoomWidget::currentViewChanged() TabbedWebView* view = m_window->weView(); if (view) { - connect(view, SIGNAL(zoomLevelChanged(int)), this, SLOT(setValue(int))); + connect(view, &WebView::zoomLevelChanged, this, &QAbstractSlider::setValue); setValue(view->zoomLevel()); } } diff --git a/src/plugins/StatusBarIcons/statusbariconsplugin.cpp b/src/plugins/StatusBarIcons/statusbariconsplugin.cpp index 4d054cd5f..45308db38 100644 --- a/src/plugins/StatusBarIcons/statusbariconsplugin.cpp +++ b/src/plugins/StatusBarIcons/statusbariconsplugin.cpp @@ -39,8 +39,8 @@ void StatusBarIconsPlugin::init(InitState state, const QString &settingsPath) { m_manager = new SBI_IconsManager(settingsPath); - connect(mApp->plugins(), SIGNAL(mainWindowCreated(BrowserWindow*)), m_manager, SLOT(mainWindowCreated(BrowserWindow*))); - connect(mApp->plugins(), SIGNAL(mainWindowDeleted(BrowserWindow*)), m_manager, SLOT(mainWindowDeleted(BrowserWindow*))); + connect(mApp->plugins(), &PluginProxy::mainWindowCreated, m_manager, &SBI_IconsManager::mainWindowCreated); + connect(mApp->plugins(), &PluginProxy::mainWindowDeleted, m_manager, &SBI_IconsManager::mainWindowDeleted); // Make sure icons are added also to already created windows if (state == LateInitState) { diff --git a/src/plugins/TabManager/tabmanagersettings.cpp b/src/plugins/TabManager/tabmanagersettings.cpp index a565db43a..71f3e2980 100644 --- a/src/plugins/TabManager/tabmanagersettings.cpp +++ b/src/plugins/TabManager/tabmanagersettings.cpp @@ -15,7 +15,7 @@ TabManagerSettings::TabManagerSettings(TabManagerPlugin* plugin, QWidget *parent ui->checkBox->setChecked(m_plugin->asTabBarReplacement()); connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept())); - connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); } TabManagerSettings::~TabManagerSettings() diff --git a/src/plugins/TabManager/tabmanagerwidget.cpp b/src/plugins/TabManager/tabmanagerwidget.cpp index 03c8dadec..516e84d95 100644 --- a/src/plugins/TabManager/tabmanagerwidget.cpp +++ b/src/plugins/TabManager/tabmanagerwidget.cpp @@ -85,9 +85,9 @@ TabManagerWidget::TabManagerWidget(BrowserWindow* mainClass, QWidget* parent, bo ui->treeWidget->setItemDelegate(new TabManagerDelegate(ui->treeWidget)); - connect(closeButton, SIGNAL(clicked(bool)), this, SLOT(filterBarClosed())); + connect(closeButton, &QAbstractButton::clicked, this, &TabManagerWidget::filterBarClosed); connect(ui->filterBar, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString))); - connect(ui->treeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(onItemActivated(QTreeWidgetItem*,int))); + connect(ui->treeWidget, &QTreeWidget::itemClicked, this, &TabManagerWidget::onItemActivated); connect(ui->treeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint))); connect(ui->treeWidget, SIGNAL(requestRefreshTree()), this, SLOT(delayedRefreshTree())); } @@ -152,7 +152,7 @@ void TabManagerWidget::delayedRefreshTree(WebPage* p) m_webPage = p; m_waitForRefresh = true; - QTimer::singleShot(50, this, SLOT(refreshTree())); + QTimer::singleShot(50, this, &TabManagerWidget::refreshTree); } void TabManagerWidget::refreshTree() @@ -304,17 +304,17 @@ void TabManagerWidget::customContextMenuRequested(const QPoint &pos) QAction* action; QMenu groupTypeSubmenu(tr("Group by")); - action = groupTypeSubmenu.addAction(tr("&Window"), this, SLOT(changeGroupType())); + action = groupTypeSubmenu.addAction(tr("&Window"), this, &TabManagerWidget::changeGroupType); action->setData(GroupByWindow); action->setCheckable(true); action->setChecked(m_groupType == GroupByWindow); - action = groupTypeSubmenu.addAction(tr("&Domain"), this, SLOT(changeGroupType())); + action = groupTypeSubmenu.addAction(tr("&Domain"), this, &TabManagerWidget::changeGroupType); action->setData(GroupByDomain); action->setCheckable(true); action->setChecked(m_groupType == GroupByDomain); - action = groupTypeSubmenu.addAction(tr("&Host"), this, SLOT(changeGroupType())); + action = groupTypeSubmenu.addAction(tr("&Host"), this, &TabManagerWidget::changeGroupType); action->setData(GroupByHost); action->setCheckable(true); action->setChecked(m_groupType == GroupByHost); @@ -322,16 +322,16 @@ void TabManagerWidget::customContextMenuRequested(const QPoint &pos) menu->addMenu(&groupTypeSubmenu); if (m_isDefaultWidget) { - menu->addAction(QIcon(":/tabmanager/data/side-by-side.png"), tr("&Show side by side"), this, SIGNAL(showSideBySide()))->setObjectName("sideBySide"); + menu->addAction(QIcon(":/tabmanager/data/side-by-side.png"), tr("&Show side by side"), this, &TabManagerWidget::showSideBySide)->setObjectName("sideBySide"); } menu->addSeparator(); if (isTabSelected()) { - menu->addAction(QIcon(":/tabmanager/data/tab-detach.png"), tr("&Detach checked tabs"), this, SLOT(processActions()))->setObjectName("detachSelection"); - menu->addAction(QIcon(":/tabmanager/data/tab-bookmark.png"), tr("Book&mark checked tabs"), this, SLOT(processActions()))->setObjectName("bookmarkSelection"); - menu->addAction(QIcon(":/tabmanager/data/tab-close.png"), tr("&Close checked tabs"), this, SLOT(processActions()))->setObjectName("closeSelection"); - menu->addAction(tr("&Unload checked tabs"), this, SLOT(processActions()))->setObjectName("unloadSelection"); + menu->addAction(QIcon(":/tabmanager/data/tab-detach.png"), tr("&Detach checked tabs"), this, &TabManagerWidget::processActions)->setObjectName("detachSelection"); + menu->addAction(QIcon(":/tabmanager/data/tab-bookmark.png"), tr("Book&mark checked tabs"), this, &TabManagerWidget::processActions)->setObjectName("bookmarkSelection"); + menu->addAction(QIcon(":/tabmanager/data/tab-close.png"), tr("&Close checked tabs"), this, &TabManagerWidget::processActions)->setObjectName("closeSelection"); + menu->addAction(tr("&Unload checked tabs"), this, &TabManagerWidget::processActions)->setObjectName("unloadSelection"); } menu->exec(ui->treeWidget->viewport()->mapToGlobal(pos)); @@ -576,8 +576,8 @@ bool TabManagerWidget::bookmarkSelectedTabs(const QHash QDialogButtonBox* box = new QDialogButtonBox(dialog); box->addButton(QDialogButtonBox::Ok); box->addButton(QDialogButtonBox::Cancel); - QObject::connect(box, SIGNAL(rejected()), dialog, SLOT(reject())); - QObject::connect(box, SIGNAL(accepted()), dialog, SLOT(accept())); + QObject::connect(box, &QDialogButtonBox::rejected, dialog, &QDialog::reject); + QObject::connect(box, &QDialogButtonBox::accepted, dialog, &QDialog::accept); layout->addWidget(label); layout->addWidget(folderButton); @@ -793,8 +793,8 @@ void TabItem::setWebTab(WebTab* webTab) else setIsSavedTab(true); - connect(m_webTab->webView(), SIGNAL(titleChanged(QString)), this, SLOT(setTitle(QString))); - connect(m_webTab->webView(), SIGNAL(iconChanged(QIcon)), this, SLOT(updateIcon())); + connect(m_webTab->webView(), &QWebEngineView::titleChanged, this, &TabItem::setTitle); + connect(m_webTab->webView(), &QWebEngineView::iconChanged, this, &TabItem::updateIcon); auto pageChanged = [this](WebPage *page) { connect(page, &WebPage::audioMutedChanged, this, &TabItem::updateIcon); diff --git a/src/plugins/VerticalTabs/verticaltabswidget.cpp b/src/plugins/VerticalTabs/verticaltabswidget.cpp index ca2962a75..05d40221e 100644 --- a/src/plugins/VerticalTabs/verticaltabswidget.cpp +++ b/src/plugins/VerticalTabs/verticaltabswidget.cpp @@ -58,7 +58,7 @@ VerticalTabsWidget::VerticalTabsWidget(BrowserWindow *window) buttonAddTab->setToolTip(tr("New Tab")); buttonAddTab->setIcon(QIcon::fromTheme(QSL("list-add"))); buttonAddTab->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); - connect(buttonAddTab, SIGNAL(clicked()), m_window, SLOT(addTab())); + connect(buttonAddTab, &QAbstractButton::clicked, m_window, &BrowserWindow::addTab); m_groupMenu = new QMenu(this); buttonAddTab->setMenu(m_groupMenu); diff --git a/tests/modeltest/modeltest.cpp b/tests/modeltest/modeltest.cpp index 1c67acd6b..11094f3cb 100644 --- a/tests/modeltest/modeltest.cpp +++ b/tests/modeltest/modeltest.cpp @@ -57,44 +57,44 @@ ModelTest::ModelTest(QAbstractItemModel* _model, QObject* parent) : QObject(pare { Q_ASSERT(model); - connect(model, SIGNAL(columnsAboutToBeInserted(const QModelIndex &, int, int)), - this, SLOT(runAllTests())); - connect(model, SIGNAL(columnsAboutToBeRemoved(const QModelIndex &, int, int)), - this, SLOT(runAllTests())); - connect(model, SIGNAL(columnsInserted(const QModelIndex &, int, int)), - this, SLOT(runAllTests())); - connect(model, SIGNAL(columnsRemoved(const QModelIndex &, int, int)), - this, SLOT(runAllTests())); - connect(model, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), - this, SLOT(runAllTests())); - connect(model, SIGNAL(headerDataChanged(Qt::Orientation, int, int)), - this, SLOT(runAllTests())); - connect(model, SIGNAL(layoutAboutToBeChanged()), this, SLOT(runAllTests())); - connect(model, SIGNAL(layoutChanged()), this, SLOT(runAllTests())); - connect(model, SIGNAL(modelReset()), this, SLOT(runAllTests())); - connect(model, SIGNAL(rowsAboutToBeInserted(const QModelIndex &, int, int)), - this, SLOT(runAllTests())); - connect(model, SIGNAL(rowsAboutToBeRemoved(const QModelIndex &, int, int)), - this, SLOT(runAllTests())); - connect(model, SIGNAL(rowsInserted(const QModelIndex &, int, int)), - this, SLOT(runAllTests())); - connect(model, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), - this, SLOT(runAllTests())); + connect(model, &QAbstractItemModel::columnsAboutToBeInserted, + this, &ModelTest::runAllTests); + connect(model, &QAbstractItemModel::columnsAboutToBeRemoved, + this, &ModelTest::runAllTests); + connect(model, &QAbstractItemModel::columnsInserted, + this, &ModelTest::runAllTests); + connect(model, &QAbstractItemModel::columnsRemoved, + this, &ModelTest::runAllTests); + connect(model, &QAbstractItemModel::dataChanged, + this, &ModelTest::runAllTests); + connect(model, &QAbstractItemModel::headerDataChanged, + this, &ModelTest::runAllTests); + connect(model, &QAbstractItemModel::layoutAboutToBeChanged, this, &ModelTest::runAllTests); + connect(model, &QAbstractItemModel::layoutChanged, this, &ModelTest::runAllTests); + connect(model, &QAbstractItemModel::modelReset, this, &ModelTest::runAllTests); + connect(model, &QAbstractItemModel::rowsAboutToBeInserted, + this, &ModelTest::runAllTests); + connect(model, &QAbstractItemModel::rowsAboutToBeRemoved, + this, &ModelTest::runAllTests); + connect(model, &QAbstractItemModel::rowsInserted, + this, &ModelTest::runAllTests); + connect(model, &QAbstractItemModel::rowsRemoved, + this, &ModelTest::runAllTests); // Special checks for inserting/removing - connect(model, SIGNAL(layoutAboutToBeChanged()), - this, SLOT(layoutAboutToBeChanged())); - connect(model, SIGNAL(layoutChanged()), - this, SLOT(layoutChanged())); + connect(model, &QAbstractItemModel::layoutAboutToBeChanged, + this, &ModelTest::layoutAboutToBeChanged); + connect(model, &QAbstractItemModel::layoutChanged, + this, &ModelTest::layoutChanged); - connect(model, SIGNAL(rowsAboutToBeInserted(const QModelIndex &, int, int)), - this, SLOT(rowsAboutToBeInserted(const QModelIndex &, int, int))); - connect(model, SIGNAL(rowsAboutToBeRemoved(const QModelIndex &, int, int)), - this, SLOT(rowsAboutToBeRemoved(const QModelIndex &, int, int))); - connect(model, SIGNAL(rowsInserted(const QModelIndex &, int, int)), - this, SLOT(rowsInserted(const QModelIndex &, int, int))); - connect(model, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), - this, SLOT(rowsRemoved(const QModelIndex &, int, int))); + connect(model, &QAbstractItemModel::rowsAboutToBeInserted, + this, &ModelTest::rowsAboutToBeInserted); + connect(model, &QAbstractItemModel::rowsAboutToBeRemoved, + this, &ModelTest::rowsAboutToBeRemoved); + connect(model, &QAbstractItemModel::rowsInserted, + this, &ModelTest::rowsInserted); + connect(model, &QAbstractItemModel::rowsRemoved, + this, &ModelTest::rowsRemoved); runAllTests(); }