"));
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();
}