YACReader/viewer: Convert a bunch of loosely related signals to new syntax

This commit is contained in:
Felix Kauselmann 2021-06-22 12:28:00 +02:00
parent d9ca26faf0
commit 5b66153390
4 changed files with 8 additions and 6 deletions

View File

@ -213,7 +213,7 @@ void MainWindowViewer::createActions()
openAction->setToolTip(tr("Open a comic"));
openAction->setData(OPEN_ACTION_Y);
openAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(OPEN_ACTION_Y));
connect(openAction, SIGNAL(triggered()), this, SLOT(open()));
connect(openAction, &QAction::triggered, this, QOverload<>::of(&MainWindowViewer::open));
#ifdef Q_OS_MAC
newInstanceAction = new QAction(tr("New instance"), this);
@ -438,7 +438,7 @@ void MainWindowViewer::createActions()
optionsAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(OPTIONS_ACTION_Y));
optionsAction->setIcon(QIcon(":/images/viewer_toolbar/options.png"));
connect(optionsAction, SIGNAL(triggered()), optionsDialog, SLOT(show()));
connect(optionsAction, &QAction::triggered, optionsDialog, &OptionsDialog::show);
helpAboutAction = new QAction(tr("Help"), this);
helpAboutAction->setToolTip(tr("Help, About YACReader"));

View File

@ -13,6 +13,7 @@
#include <QHBoxLayout>
#include <QVBoxLayout>
#include "translator.h"
#include "viewer.h"
#include "yacreader_busy_widget.h"
@ -33,7 +34,7 @@
#define APPID "417CEAD93449502CC3C9B69FED26C54118E62BCC"
YACReaderTranslator::YACReaderTranslator(QWidget *parent)
YACReaderTranslator::YACReaderTranslator(Viewer *parent)
: QWidget(parent), drag(false)
{
QString scrollBarStyle = "QScrollBar:vertical { border: none; background: #404040; width: 7px; margin: 0 3px 0 0; }"
@ -68,7 +69,7 @@ YACReaderTranslator::YACReaderTranslator(QWidget *parent)
titleBar->addWidget(close);
titleBar->setContentsMargins(0, 0, 0, 0);
titleBar->setSpacing(0);
connect(close, SIGNAL(clicked()), this->parent(), SLOT(animateHideTranslator()));
connect(close, &QAbstractButton::clicked, parent, &Viewer::animateHideTranslator);
layout->addLayout(titleBar);

View File

@ -13,6 +13,7 @@ class YACReaderBusyWidget;
#include <QWidget>
#include <QThread>
#include <QUrl>
#include "viewer.h"
#if QT_VERSION >= 0x050000
class QMediaPlayer;
@ -25,7 +26,7 @@ class YACReaderTranslator : public QWidget
{
Q_OBJECT
public:
YACReaderTranslator(QWidget *parent = nullptr);
YACReaderTranslator(Viewer *parent = nullptr);
~YACReaderTranslator() override;
public slots:

View File

@ -152,7 +152,7 @@ Viewer::~Viewer()
void Viewer::createConnections()
{
//magnifyingGlass (update mg after a background change
connect(this, SIGNAL(backgroundChanges()), mglass, SLOT(updateImage()));
connect(this, &Viewer::backgroundChanges, mglass, QOverload<>::of(&MagnifyingGlass::updateImage));
//goToDialog
connect(goToDialog, &GoToDialog::goToPage, this, &Viewer::goTo);