From d7a9e66377a440a390822d2703cc6d4bc9a1bc7d Mon Sep 17 00:00:00 2001 From: Felix Kauselmann Date: Tue, 22 Jun 2021 12:38:32 +0200 Subject: [PATCH] ComicVine: Convert to new slot syntax --- YACReaderLibrary/comic_vine/select_volume.cpp | 4 +++- YACReaderLibrary/comic_vine/sort_volume_comics.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/YACReaderLibrary/comic_vine/select_volume.cpp b/YACReaderLibrary/comic_vine/select_volume.cpp index 08fce22f..1a6bd61a 100644 --- a/YACReaderLibrary/comic_vine/select_volume.cpp +++ b/YACReaderLibrary/comic_vine/select_volume.cpp @@ -53,7 +53,9 @@ SelectVolume::SelectVolume(QWidget *parent) tableVolumes->horizontalHeader()->setClickable(true); #endif //tableVolumes->horizontalHeader()->setSortIndicatorShown(false); - connect(tableVolumes->horizontalHeader(), SIGNAL(sectionClicked(int)), tableVolumes, SLOT(sortByColumn(int))); + connect(tableVolumes->horizontalHeader(), &QHeaderView::sectionClicked, + [=](int index) { tableVolumes->horizontalHeader()->sortIndicatorSection() == index ? tableVolumes->sortByColumn(index, tableVolumes->horizontalHeader()->sortIndicatorOrder() == Qt::AscendingOrder ? Qt::DescendingOrder : Qt::AscendingOrder) + : tableVolumes->sortByColumn(index, Qt::AscendingOrder); }); //connections connect(tableVolumes, &QAbstractItemView::clicked, this, &SelectVolume::loadVolumeInfo); diff --git a/YACReaderLibrary/comic_vine/sort_volume_comics.cpp b/YACReaderLibrary/comic_vine/sort_volume_comics.cpp index 9e91b072..e9166c3e 100644 --- a/YACReaderLibrary/comic_vine/sort_volume_comics.cpp +++ b/YACReaderLibrary/comic_vine/sort_volume_comics.cpp @@ -134,11 +134,11 @@ void SortVolumeComics::synchronizeScroll(int pos) QScrollBar *tableFilesScrollBar = tableFiles->verticalScrollBar(); if (senderObject == tableVolumeComicsScrollBar) { - disconnect(tableFilesScrollBar, SIGNAL(valueChanged(int)), this, 0); + disconnect(tableFilesScrollBar, &QAbstractSlider::valueChanged, this, nullptr); tableFilesScrollBar->setValue(pos); connect(tableFilesScrollBar, &QAbstractSlider::valueChanged, this, &SortVolumeComics::synchronizeScroll); } else { - disconnect(tableVolumeComicsScrollBar, SIGNAL(valueChanged(int)), this, 0); + disconnect(tableVolumeComicsScrollBar, &QAbstractSlider::valueChanged, this, nullptr); tableVolumeComicsScrollBar->setValue(pos); connect(tableVolumeComicsScrollBar, &QAbstractSlider::valueChanged, this, &SortVolumeComics::synchronizeScroll); }