Add backwards support Qt6.7's checkStateChanged on QCheckBoxes (#5137)

This commit is contained in:
Zach H 2024-10-20 23:35:34 -04:00 committed by GitHub
parent b041f4ace2
commit 8d5421d9da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 251 additions and 176 deletions

View file

@ -0,0 +1,17 @@
#ifndef COCKATRICE_MACROS_H
#define COCKATRICE_MACROS_H
#include <QtGlobal>
// Qt6.7 changed how stateChanged functionality
// of QCheckBoxes work.
// See https://doc.qt.io/qt-6/qcheckbox.html#checkStateChanged
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
#define QT_STATE_CHANGED checkStateChanged
#define QT_STATE_CHANGED_T Qt::CheckState
#else
#define QT_STATE_CHANGED stateChanged
#define QT_STATE_CHANGED_T int
#endif
#endif // COCKATRICE_MACROS_H