Use checkStateChanged(Qt::CheckState) with Qt >= 6.7

This commit is contained in:
Jonas Kvinge
2024-05-24 02:13:48 +02:00
parent 9f2e4ac312
commit c655963483
6 changed files with 34 additions and 1 deletions

View File

@@ -41,7 +41,11 @@ AlbumCoverExport::AlbumCoverExport(QWidget *parent) : QDialog(parent), ui_(new U
ui_->setupUi(this);
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
QObject::connect(ui_->forceSize, &QCheckBox::checkStateChanged, this, &AlbumCoverExport::ForceSizeToggled);
#else
QObject::connect(ui_->forceSize, &QCheckBox::stateChanged, this, &AlbumCoverExport::ForceSizeToggled);
#endif
}
@@ -99,7 +103,11 @@ AlbumCoverExport::DialogResult AlbumCoverExport::Exec() {
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
void AlbumCoverExport::ForceSizeToggled(Qt::CheckState state) {
#else
void AlbumCoverExport::ForceSizeToggled(int state) {
#endif
ui_->width->setEnabled(state == Qt::Checked);
ui_->height->setEnabled(state == Qt::Checked);
}

View File

@@ -70,7 +70,11 @@ class AlbumCoverExport : public QDialog {
DialogResult Exec();
private slots:
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
void ForceSizeToggled(Qt::CheckState state);
#else
void ForceSizeToggled(int state);
#endif
private:
Ui_AlbumCoverExport *ui_;