diff --git a/YACReaderLibrary/add_library_dialog.cpp b/YACReaderLibrary/add_library_dialog.cpp index 059bd82b..406927d2 100644 --- a/YACReaderLibrary/add_library_dialog.cpp +++ b/YACReaderLibrary/add_library_dialog.cpp @@ -28,7 +28,7 @@ void AddLibraryDialog::setupUI() connect(accept, &QAbstractButton::clicked, this, &AddLibraryDialog::add); cancel = new QPushButton(tr("Cancel")); - connect(cancel, SIGNAL(clicked()), this, SLOT(close())); + connect(cancel, &QPushButton::close, this, &AddLibraryDialog::close); find = new QPushButton(QIcon(":/images/find_folder.png"), ""); connect(find, &QAbstractButton::clicked, this, &AddLibraryDialog::findPath); diff --git a/YACReaderLibrary/create_library_dialog.cpp b/YACReaderLibrary/create_library_dialog.cpp index f5234a2a..c805493e 100644 --- a/YACReaderLibrary/create_library_dialog.cpp +++ b/YACReaderLibrary/create_library_dialog.cpp @@ -26,11 +26,11 @@ void CreateLibraryDialog::setupUI() accept = new QPushButton(tr("Create")); accept->setDisabled(true); - connect(accept, SIGNAL(clicked()), this, SLOT(create())); + connect(accept, &QAbstractButton::clicked, this, &CreateLibraryDialog::create); cancel = new QPushButton(tr("Cancel")); connect(cancel, &QAbstractButton::clicked, this, &CreateLibraryDialog::cancelCreate); - connect(cancel, SIGNAL(clicked()), this, SLOT(close())); + connect(cancel, &QAbstractButton::clicked, this, &CreateLibraryDialog::close); find = new QPushButton(QIcon(":/images/find_folder.png"), ""); connect(find, &QAbstractButton::clicked, this, &CreateLibraryDialog::findPath); @@ -161,7 +161,7 @@ UpdateLibraryDialog::UpdateLibraryDialog(QWidget *parent) bottom->addWidget(cancel = new QPushButton(tr("Cancel"))); connect(cancel, &QAbstractButton::clicked, this, &UpdateLibraryDialog::cancelUpdate); - connect(cancel, SIGNAL(clicked()), this, SLOT(close())); + connect(cancel, &QAbstractButton::clicked, this, &UpdateLibraryDialog::close); mainLayout->addStretch(); diff --git a/YACReaderLibrary/export_comics_info_dialog.cpp b/YACReaderLibrary/export_comics_info_dialog.cpp index 95d6711b..3535c08b 100644 --- a/YACReaderLibrary/export_comics_info_dialog.cpp +++ b/YACReaderLibrary/export_comics_info_dialog.cpp @@ -20,7 +20,7 @@ ExportComicsInfoDialog::ExportComicsInfoDialog(QWidget *parent) connect(accept, &QAbstractButton::clicked, this, &ExportComicsInfoDialog::exportComicsInfo); cancel = new QPushButton(tr("Cancel")); - connect(cancel, SIGNAL(clicked()), this, SLOT(close())); + connect(cancel, &QAbstractButton::clicked, this, &ExportComicsInfoDialog::close); connect(cancel, &QAbstractButton::clicked, this, &QDialog::rejected); find = new QPushButton(QIcon(":/images/find_folder.png"), ""); diff --git a/YACReaderLibrary/export_library_dialog.cpp b/YACReaderLibrary/export_library_dialog.cpp index e7013bd9..b9ba647d 100644 --- a/YACReaderLibrary/export_library_dialog.cpp +++ b/YACReaderLibrary/export_library_dialog.cpp @@ -17,7 +17,7 @@ ExportLibraryDialog::ExportLibraryDialog(QWidget *parent) connect(accept, &QAbstractButton::clicked, this, &ExportLibraryDialog::exportLibrary); cancel = new QPushButton(tr("Cancel")); - connect(cancel, SIGNAL(clicked()), this, SLOT(close())); + connect(cancel, &QAbstractButton::clicked, this, &ExportLibraryDialog::close); connect(cancel, &QAbstractButton::clicked, this, &QDialog::rejected); find = new QPushButton(QIcon(":/images/find_folder.png"), ""); diff --git a/YACReaderLibrary/import_comics_info_dialog.cpp b/YACReaderLibrary/import_comics_info_dialog.cpp index 3a9b6629..a7c0de5a 100644 --- a/YACReaderLibrary/import_comics_info_dialog.cpp +++ b/YACReaderLibrary/import_comics_info_dialog.cpp @@ -22,7 +22,7 @@ ImportComicsInfoDialog::ImportComicsInfoDialog(QWidget *parent) connect(accept, &QAbstractButton::clicked, this, &ImportComicsInfoDialog::import); cancel = new QPushButton(tr("Cancel")); - connect(cancel, SIGNAL(clicked()), this, SLOT(close())); + connect(cancel, &QAbstractButton::clicked, this, &ImportComicsInfoDialog::close); //connect(cancel,SIGNAL(clicked()),this,SIGNAL(rejected())); find = new QPushButton(QIcon(":/images/find_folder.png"), ""); @@ -85,7 +85,7 @@ void ImportComicsInfoDialog::import() auto importer = new Importer(); importer->source = path->text(); importer->dest = dest; - connect(importer, SIGNAL(finished()), this, SLOT(close())); + connect(importer, &QThread::finished, this, &ImportComicsInfoDialog::close); connect(importer, &QThread::finished, this, &QWidget::hide); importer->start(); } diff --git a/YACReaderLibrary/import_library_dialog.cpp b/YACReaderLibrary/import_library_dialog.cpp index ca99a7fa..220a3149 100644 --- a/YACReaderLibrary/import_library_dialog.cpp +++ b/YACReaderLibrary/import_library_dialog.cpp @@ -32,7 +32,7 @@ void ImportLibraryDialog::setupUI() connect(accept, &QAbstractButton::clicked, this, &ImportLibraryDialog::add); cancel = new QPushButton(tr("Cancel")); - connect(cancel, SIGNAL(clicked()), this, SLOT(close())); + connect(cancel, &QAbstractButton::clicked, this, &ImportLibraryDialog::close); //connect(cancel,SIGNAL(clicked()),this,SIGNAL(rejected())); find = new QPushButton(QIcon(":/images/find_folder.png"), ""); diff --git a/YACReaderLibrary/rename_library_dialog.cpp b/YACReaderLibrary/rename_library_dialog.cpp index ddbd55be..a643fb6d 100644 --- a/YACReaderLibrary/rename_library_dialog.cpp +++ b/YACReaderLibrary/rename_library_dialog.cpp @@ -22,10 +22,9 @@ void RenameLibraryDialog::setupUI() connect(accept, &QAbstractButton::clicked, this, &RenameLibraryDialog::rename); cancel = new QPushButton(tr("Cancel")); - connect(cancel, SIGNAL(clicked()), this, SLOT(close())); + connect(cancel, &QAbstractButton::clicked, this, &RenameLibraryDialog::close); auto nameLayout = new QHBoxLayout; - nameLayout->addWidget(newNameLabel); nameLayout->addWidget(newNameEdit); @@ -71,4 +70,4 @@ void RenameLibraryDialog::close() newNameEdit->clear(); //accept->setEnabled(false); QDialog::close(); -} \ No newline at end of file +} diff --git a/custom_widgets/yacreader_options_dialog.cpp b/custom_widgets/yacreader_options_dialog.cpp index f553ec18..b793c1e6 100644 --- a/custom_widgets/yacreader_options_dialog.cpp +++ b/custom_widgets/yacreader_options_dialog.cpp @@ -40,7 +40,7 @@ YACReaderOptionsDialog::YACReaderOptionsDialog(QWidget *parent) connect(shortcutsButton, &QAbstractButton::clicked, this, &YACReaderOptionsDialog::editShortcuts); connect(accept, &QAbstractButton::clicked, this, &YACReaderOptionsDialog::saveOptions); - connect(cancel, SIGNAL(clicked()), this, SLOT(restoreOptions())); //TODO fix this + connect(cancel, &QAbstractButton::clicked, this, QOverload<>::of(&YACReaderOptionsDialog::restoreOptions)); connect(cancel, &QAbstractButton::clicked, this, &QWidget::close); #ifndef NO_OPENGL useGL = new QCheckBox(tr("Use hardware acceleration (restart needed)"));