diff --git a/databaseview.cpp b/databaseview.cpp index 7bea690..8082074 100644 --- a/databaseview.cpp +++ b/databaseview.cpp @@ -308,7 +308,7 @@ DataBaseView::DataBaseView(Database *database, QWidget *parent) : QWidget(parent } QPushButton *filterButton = new QPushButton(tr("Filter"), this); - connect(filterButton, SIGNAL(pressed()), this, SLOT(applyFilter())); + connect(filterButton, &QPushButton::pressed, this, &DataBaseView::applyFilter); hlayout->addWidget(filterButton); connect(m_database, &Database::databaseChanged, [this, &addFilterItems](){ diff --git a/imageringlist.cpp b/imageringlist.cpp index 4cb5f2b..0617e91 100644 --- a/imageringlist.cpp +++ b/imageringlist.cpp @@ -115,7 +115,7 @@ ImageRingList::ImageRingList(Database *database, const QStringList &nameFilter, , m_nameFilter(nameFilter) , m_fileSuffix(nameFilter) { - connect(&m_fileSystemWatcher, SIGNAL(directoryChanged(QString)), this, SLOT(dirChanged(QString))); + connect(&m_fileSystemWatcher, &QFileSystemWatcher::directoryChanged, this, &ImageRingList::dirChanged); m_nameFilter.replaceInStrings(QRegularExpression("^"), "*."); m_loadPool = new QThreadPool(this); m_loadPool->setThreadPriority(QThread::LowPriority); @@ -505,8 +505,8 @@ void ImageRingList::setFilesPrivate(const QStringList files, const QString &curr for(const QString &file : files) { ImagePtr ptr = make_shared(file, i++, this); - connect(ptr.get(), SIGNAL(pixmapLoaded(Image*)), this, SLOT(imageLoaded(Image*))); - connect(ptr.get(), SIGNAL(thumbnailLoaded(Image*)), this, SIGNAL(thumbnailLoaded(Image*))); + connect(ptr.get(), &Image::pixmapLoaded, this, &ImageRingList::imageLoaded); + connect(ptr.get(), &Image::thumbnailLoaded, this, &ImageRingList::thumbnailLoaded); m_images.append(ptr); } diff --git a/imagescrollarea.cpp b/imagescrollarea.cpp index b4c41c1..00d1757 100644 --- a/imagescrollarea.cpp +++ b/imagescrollarea.cpp @@ -27,8 +27,8 @@ ImageScrollArea::ImageScrollArea(Database *database, QWidget *parent) : QWidget( layout->addWidget(m_verticalScrollBar, 0, 1); layout->addWidget(m_horizontalScrollBar, 1, 0); - connect(m_verticalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(scrollEvent())); - connect(m_horizontalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(scrollEvent())); + connect(m_verticalScrollBar, &QScrollBar::valueChanged, this, &ImageScrollArea::scrollEvent); + connect(m_horizontalScrollBar, &QScrollBar::valueChanged, this, &ImageScrollArea::scrollEvent); if(imageWidgetGL) { diff --git a/imagewidget.cpp b/imagewidget.cpp index 05b3788..99e48c6 100644 --- a/imagewidget.cpp +++ b/imagewidget.cpp @@ -79,7 +79,7 @@ ImageWidgetGL::ImageWidgetGL(Database *database, QWidget *parent) : QOpenGLWidge m_updateTimer = new QTimer(this); m_updateTimer->setInterval(500); m_updateTimer->setSingleShot(true); - connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(update())); + connect(m_updateTimer, &QTimer::timeout, this, static_cast(&ImageWidgetGL::update)); setAcceptDrops(true); QTimer::singleShot(1000, [this](){ if(!isValid()) diff --git a/mainwindow.cpp b/mainwindow.cpp index 36240b9..d5a1832 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -95,7 +95,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) m_ringList = new ImageRingList(m_database, nameFilter, this); m_filesystem = new FilesystemWidget(m_ringList, this); - connect(m_filesystem, SIGNAL(fileSelected(int)), this, SLOT(loadFile(int))); + connect(m_filesystem, &FilesystemWidget::fileSelected, this, static_cast(&MainWindow::loadFile)); connect(m_filesystem, &FilesystemWidget::sortChanged, m_ringList, &ImageRingList::setSort); connect(m_filesystem, &FilesystemWidget::reverseSort, m_ringList, &ImageRingList::reverseSort); @@ -106,7 +106,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) connect(m_filetree, &Filetree::indexDirectory, this, static_cast(&MainWindow::indexDir)); m_databaseView = new DataBaseView(m_database, this); - connect(m_databaseView, SIGNAL(loadFile(QString)), this, SLOT(loadFile(QString))); + connect(m_databaseView, &DataBaseView::loadFile, this, static_cast(&MainWindow::loadFile)); #ifdef PLATESOLVER _plateSolving = new PlateSolving(this); @@ -155,16 +155,16 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) connect(m_image, &ImageScrollArea::fileDropped, this, static_cast(&MainWindow::loadFile)); QMenu *fileMenu = new QMenu(tr("File"), this); - fileMenu->addAction(tr("Open"), QKeySequence::Open, this, SLOT(loadFile())); + fileMenu->addAction(tr("Open"), QKeySequence::Open, this, static_cast(&MainWindow::loadFile)); fileMenu->addAction(tr("Open directory recursively"), this, &MainWindow::loadDir); - QAction *saveAs = fileMenu->addAction(tr("Save as"), QKeySequence::Save, this, SLOT(saveAs())); + QAction *saveAs = fileMenu->addAction(tr("Save as"), QKeySequence::Save, this, &MainWindow::saveAs); fileMenu->addSeparator(); - fileMenu->addAction(tr("Copy marked files"), Qt::Key_F5, this, SLOT(copyMarked())); - fileMenu->addAction(tr("Move marked files"), Qt::Key_F6, this, SLOT(moveMarked())); + fileMenu->addAction(tr("Copy marked files"), Qt::Key_F5, this, &MainWindow::copyMarked); + fileMenu->addAction(tr("Move marked files"), Qt::Key_F6, this, &MainWindow::moveMarked); fileMenu->addAction(tr("Move marked files to trash"), QKeySequence::Delete, this, &MainWindow::deleteMarked); fileMenu->addSeparator(); - fileMenu->addAction(tr("Index directory"), this, SLOT(indexDir())); - fileMenu->addAction(tr("Reindex files"), this, SLOT(reindex())); + fileMenu->addAction(tr("Index directory"), this, static_cast(&MainWindow::indexDir)); + fileMenu->addAction(tr("Reindex files"), this, &MainWindow::reindex); fileMenu->addAction(tr("Export database to CSV"), this, &MainWindow::exportCSV); fileMenu->addAction(tr("Batch processing"), Qt::Key_B | Qt::CTRL, [this](){ BatchProcessing *batchProcessing = new BatchProcessing(m_database, this); @@ -172,9 +172,9 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) delete batchProcessing; }); fileMenu->addSeparator(); - QAction *liveModeAction = fileMenu->addAction(tr("Live mode"), this, SLOT(liveMode(bool))); + QAction *liveModeAction = fileMenu->addAction(tr("Live mode"), this, &MainWindow::liveMode); liveModeAction->setCheckable(true); - QAction *exitAction = fileMenu->addAction(tr("Exit"), this, SLOT(close())); + QAction *exitAction = fileMenu->addAction(tr("Exit"), this, &MainWindow::close); exitAction->setShortcut(QKeySequence::Quit); menuBar()->addMenu(fileMenu); @@ -243,11 +243,11 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) menuBar()->addMenu(viewMenu); QMenu *selectMenu = new QMenu(tr("Select"), this); - selectMenu->addAction(tr("Mark"), Qt::Key_F7, this, SLOT(markImage())); - selectMenu->addAction(tr("Unmark"), Qt::Key_F8, this, SLOT(unmarkImage())); + selectMenu->addAction(tr("Mark"), Qt::Key_F7, this, &MainWindow::markImage); + selectMenu->addAction(tr("Unmark"), Qt::Key_F8, this, &MainWindow::unmarkImage); selectMenu->addSeparator(); - selectMenu->addAction(tr("Mark and next"), Qt::Key_M, this, SLOT(markAndNext())); - selectMenu->addAction(tr("Unmark and next"), Qt::Key_X, this, SLOT(unmarkAndNext())); + selectMenu->addAction(tr("Mark and next"), Qt::Key_M, this, &MainWindow::markAndNext); + selectMenu->addAction(tr("Unmark and next"), Qt::Key_X, this, &MainWindow::unmarkAndNext); selectMenu->addSeparator(); selectMenu->addAction(tr("Show marked list"), this, &MainWindow::showMarkFilesDialog); QAction *openMarked = selectMenu->addAction(tr("Open marked"), m_ringList, &ImageRingList::setMarked); @@ -387,7 +387,7 @@ void MainWindow::setupSigterm() ::socketpair(AF_UNIX, SOCK_STREAM, 0, socketPair); socketNotifier = new QSocketNotifier(socketPair[1], QSocketNotifier::Read, this); - connect(socketNotifier, SIGNAL(activated(int)), this, SLOT(socketNotify())); + connect(socketNotifier, &QSocketNotifier::activated, this, &MainWindow::socketNotify); #endif }