diff --git a/src/controllers/legacycontrollersettings.cpp b/src/controllers/legacycontrollersettings.cpp index f97d2b9d628..91e8f9005a6 100644 --- a/src/controllers/legacycontrollersettings.cpp +++ b/src/controllers/legacycontrollersettings.cpp @@ -141,7 +141,11 @@ QWidget* LegacyControllerBooleanSetting::buildInputWidget(QWidget* pParent) { pCheckBox->setCheckState(m_editedValue ? Qt::Checked : Qt::Unchecked); }); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + connect(pCheckBox, &QCheckBox::checkStateChanged, this, [this](Qt::CheckState state) { +#else connect(pCheckBox, &QCheckBox::stateChanged, this, [this](int state) { +#endif m_editedValue = state == Qt::Checked; emit changed(); }); diff --git a/src/dialog/dlgreplacecuecolor.cpp b/src/dialog/dlgreplacecuecolor.cpp index 4b98d2a34e6..8c053eb7df4 100644 --- a/src/dialog/dlgreplacecuecolor.cpp +++ b/src/dialog/dlgreplacecuecolor.cpp @@ -153,11 +153,19 @@ DlgReplaceCueColor::DlgReplaceCueColor( // Update dialog widgets when conditions checkboxes are (un)checked connect(checkBoxCurrentColorCondition, +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + &QCheckBox::checkStateChanged, +#else &QCheckBox::stateChanged, +#endif this, &DlgReplaceCueColor::slotUpdateWidgets); connect(checkBoxHotcueIndexCondition, +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + &QCheckBox::checkStateChanged, +#else &QCheckBox::stateChanged, +#endif this, &DlgReplaceCueColor::slotUpdateWidgets); diff --git a/src/library/dao/trackdao.cpp b/src/library/dao/trackdao.cpp index 0e8d72686ca..1a8c4570296 100644 --- a/src/library/dao/trackdao.cpp +++ b/src/library/dao/trackdao.cpp @@ -1197,7 +1197,11 @@ void setTrackSourceSynchronizedAt(const QSqlRecord& record, const int column, Tr if (!value.isNull() && value.canConvert()) { DEBUG_ASSERT(value.isValid()); const quint64 msecsSinceEpoch = qvariant_cast(value); +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + sourceSynchronizedAt.setTimeZone(QTimeZone::UTC); +#else sourceSynchronizedAt.setTimeSpec(Qt::UTC); +#endif sourceSynchronizedAt.setMSecsSinceEpoch(msecsSinceEpoch); } pTrack->setSourceSynchronizedAt(sourceSynchronizedAt); diff --git a/src/library/dlgtrackinfo.cpp b/src/library/dlgtrackinfo.cpp index 47b32bcc021..fbeb8edc256 100644 --- a/src/library/dlgtrackinfo.cpp +++ b/src/library/dlgtrackinfo.cpp @@ -143,7 +143,11 @@ void DlgTrackInfo::init() { &DlgTrackInfo::slotBpmClear); connect(bpmConst, +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + &QCheckBox::checkStateChanged, +#else &QCheckBox::stateChanged, +#endif this, &DlgTrackInfo::slotBpmConstChanged); @@ -662,7 +666,11 @@ void DlgTrackInfo::slotBpmClear() { bpmTap->setEnabled(true); } +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +void DlgTrackInfo::slotBpmConstChanged(Qt::CheckState state) { +#else void DlgTrackInfo::slotBpmConstChanged(int state) { +#endif if (state == Qt::Unchecked) { // try to reload BeatMap from the Track reloadTrackBeats(*m_pLoadedTrack); diff --git a/src/library/dlgtrackinfo.h b/src/library/dlgtrackinfo.h index a05a7bfcb5f..c6404acd843 100644 --- a/src/library/dlgtrackinfo.h +++ b/src/library/dlgtrackinfo.h @@ -56,7 +56,11 @@ class DlgTrackInfo : public QDialog, public Ui::DlgTrackInfo { void slotBpmScale(mixxx::Beats::BpmScale bpmScale); void slotBpmClear(); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + void slotBpmConstChanged(Qt::CheckState state); +#else void slotBpmConstChanged(int state); +#endif void slotBpmTap(double averageLength, int numSamples); void slotSpinBpmValueChanged(double value); diff --git a/src/preferences/dialog/dlgprefautodj.cpp b/src/preferences/dialog/dlgprefautodj.cpp index 7842318bf60..9c23ae92d14 100644 --- a/src/preferences/dialog/dlgprefautodj.cpp +++ b/src/preferences/dialog/dlgprefautodj.cpp @@ -1,5 +1,9 @@ #include "preferences/dialog/dlgprefautodj.h" +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +#include +#endif + #include "moc_dlgprefautodj.cpp" DlgPrefAutoDJ::DlgPrefAutoDJ(QWidget* pParent, @@ -21,9 +25,20 @@ DlgPrefAutoDJ::DlgPrefAutoDJ(QWidget* pParent, RequeueIgnoreCheckBox->setChecked(m_pConfig->getValue( ConfigKey("[Auto DJ]", "UseIgnoreTime"), false)); connect(RequeueIgnoreCheckBox, +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + &QCheckBox::checkStateChanged, +#else &QCheckBox::stateChanged, +#endif this, &DlgPrefAutoDJ::slotToggleRequeueIgnore); + /// TODO: Once we require at least Qt 6.7, remove this `setTimeZone` call + /// and uncomment the corresponding declarations in the UI file instead. +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + RequeueIgnoreTimeEdit->setTimeZone(QTimeZone::LocalTime); +#else + RequeueIgnoreTimeEdit->setTimeSpec(Qt::LocalTime); +#endif RequeueIgnoreTimeEdit->setTime( QTime::fromString( m_pConfig->getValue( @@ -54,7 +69,11 @@ DlgPrefAutoDJ::DlgPrefAutoDJ(QWidget* pParent, : Qt::Unchecked); // Be ready to enable and modify the minimum number and un/check the checkbox connect(RandomQueueCheckBox, +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + &QCheckBox::checkStateChanged, +#else &QCheckBox::stateChanged, +#endif this, &DlgPrefAutoDJ::slotToggleRandomQueue); connect(RandomQueueMinimumSpinBox, @@ -124,7 +143,10 @@ void DlgPrefAutoDJ::slotCancel() { ? Qt::Checked : Qt::Unchecked); slotToggleRandomQueue( - m_pConfig->getValue(ConfigKey("[Auto DJ]", "Requeue"))); + m_pConfig->getValue( + ConfigKey("[Auto DJ]", "Requeue"), false) + ? Qt::Checked + : Qt::Unchecked); } void DlgPrefAutoDJ::slotResetToDefaults() { @@ -148,7 +170,11 @@ void DlgPrefAutoDJ::slotSetMinimumAvailable(int a_iValue) { m_pConfig->setValue(ConfigKey("[Auto DJ]", "MinimumAvailableBuff"), a_iValue); } +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +void DlgPrefAutoDJ::slotToggleRequeueIgnore(Qt::CheckState buttonState) { +#else void DlgPrefAutoDJ::slotToggleRequeueIgnore(int buttonState) { +#endif bool checked = buttonState == Qt::Checked; m_pConfig->setValue(ConfigKey("[Auto DJ]", "UseIgnoreTimeBuff"), checked); RequeueIgnoreTimeEdit->setEnabled(checked); @@ -179,7 +205,11 @@ void DlgPrefAutoDJ::slotConsiderRepeatPlaylistState(bool enable) { } } +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +void DlgPrefAutoDJ::slotToggleRandomQueue(Qt::CheckState buttonState) { +#else void DlgPrefAutoDJ::slotToggleRandomQueue(int buttonState) { +#endif bool enable = buttonState == Qt::Checked; // Toggle the option to select minimum tracks RandomQueueMinimumSpinBox->setEnabled(enable); diff --git a/src/preferences/dialog/dlgprefautodj.h b/src/preferences/dialog/dlgprefautodj.h index cc5e28fde06..50185889cb7 100644 --- a/src/preferences/dialog/dlgprefautodj.h +++ b/src/preferences/dialog/dlgprefautodj.h @@ -19,11 +19,19 @@ class DlgPrefAutoDJ : public DlgPreferencePage, public Ui::DlgPrefAutoDJDlg { private slots: void slotSetMinimumAvailable(int); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + void slotToggleRequeueIgnore(Qt::CheckState state); +#else void slotToggleRequeueIgnore(int buttonState); +#endif void slotSetRequeueIgnoreTime(const QTime& a_rTime); void slotSetRandomQueueMin(int); void slotConsiderRepeatPlaylistState(bool); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + void slotToggleRandomQueue(Qt::CheckState state); +#else void slotToggleRandomQueue(int buttonState); +#endif private: UserSettingsPointer m_pConfig; diff --git a/src/preferences/dialog/dlgprefautodjdlg.ui b/src/preferences/dialog/dlgprefautodjdlg.ui index c84dab445dd..05542aaf126 100644 --- a/src/preferences/dialog/dlgprefautodjdlg.ui +++ b/src/preferences/dialog/dlgprefautodjdlg.ui @@ -121,9 +121,13 @@ hh:mm - - Qt::LocalTime - + + 60 diff --git a/src/preferences/dialog/dlgprefbeats.cpp b/src/preferences/dialog/dlgprefbeats.cpp index e2910464262..3849ab0e3ec 100644 --- a/src/preferences/dialog/dlgprefbeats.cpp +++ b/src/preferences/dialog/dlgprefbeats.cpp @@ -27,23 +27,43 @@ DlgPrefBeats::DlgPrefBeats(QWidget* parent, UserSettingsPointer pConfig) this, &DlgPrefBeats::pluginSelected); connect(checkBoxAnalyzerEnabled, +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + &QCheckBox::checkStateChanged, +#else &QCheckBox::stateChanged, +#endif this, &DlgPrefBeats::analyzerEnabled); connect(checkBoxFixedTempo, +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + &QCheckBox::checkStateChanged, +#else &QCheckBox::stateChanged, +#endif this, &DlgPrefBeats::fixedtempoEnabled); connect(checkBoxFastAnalysis, +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + &QCheckBox::checkStateChanged, +#else &QCheckBox::stateChanged, +#endif this, &DlgPrefBeats::fastAnalysisEnabled); connect(checkBoxReanalyze, +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + &QCheckBox::checkStateChanged, +#else &QCheckBox::stateChanged, +#endif this, &DlgPrefBeats::slotReanalyzeChanged); connect(checkBoxReanalyzeImported, +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + &QCheckBox::checkStateChanged, +#else &QCheckBox::stateChanged, +#endif this, &DlgPrefBeats::slotReanalyzeImportedChanged); @@ -89,13 +109,23 @@ void DlgPrefBeats::pluginSelected(int i) { slotUpdate(); } +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +void DlgPrefBeats::analyzerEnabled(Qt::CheckState state) { + m_bAnalyzerEnabled = (state == Qt::Checked); +#else void DlgPrefBeats::analyzerEnabled(int i) { m_bAnalyzerEnabled = static_cast(i); +#endif slotUpdate(); } +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +void DlgPrefBeats::fixedtempoEnabled(Qt::CheckState state) { + m_bFixedTempoEnabled = (state == Qt::Checked); +#else void DlgPrefBeats::fixedtempoEnabled(int i) { m_bFixedTempoEnabled = static_cast(i); +#endif slotUpdate(); } @@ -139,18 +169,33 @@ void DlgPrefBeats::slotUpdate() { checkBoxReanalyzeImported->setChecked(m_bReanalyzeImported); } +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +void DlgPrefBeats::slotReanalyzeChanged(Qt::CheckState state) { + m_bReanalyze = (state == Qt::Checked); +#else void DlgPrefBeats::slotReanalyzeChanged(int value) { m_bReanalyze = static_cast(value); +#endif slotUpdate(); } +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +void DlgPrefBeats::slotReanalyzeImportedChanged(Qt::CheckState state) { + m_bReanalyzeImported = (state == Qt::Checked); +#else void DlgPrefBeats::slotReanalyzeImportedChanged(int value) { m_bReanalyzeImported = static_cast(value); +#endif slotUpdate(); } +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +void DlgPrefBeats::fastAnalysisEnabled(Qt::CheckState state) { + m_bFastAnalysisEnabled = (state == Qt::Checked); +#else void DlgPrefBeats::fastAnalysisEnabled(int i) { m_bFastAnalysisEnabled = static_cast(i); +#endif slotUpdate(); } diff --git a/src/preferences/dialog/dlgprefbeats.h b/src/preferences/dialog/dlgprefbeats.h index b63f56c5b90..69317d33a39 100644 --- a/src/preferences/dialog/dlgprefbeats.h +++ b/src/preferences/dialog/dlgprefbeats.h @@ -27,11 +27,19 @@ class DlgPrefBeats : public DlgPreferencePage, public Ui::DlgBeatsDlg { private slots: void pluginSelected(int i); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + void analyzerEnabled(Qt::CheckState state); + void fixedtempoEnabled(Qt::CheckState state); + void fastAnalysisEnabled(Qt::CheckState state); + void slotReanalyzeChanged(Qt::CheckState state); + void slotReanalyzeImportedChanged(Qt::CheckState state); +#else void analyzerEnabled(int i); void fixedtempoEnabled(int i); void fastAnalysisEnabled(int i); void slotReanalyzeChanged(int value); void slotReanalyzeImportedChanged(int value); +#endif private: void loadSettings(); diff --git a/src/preferences/dialog/dlgprefbroadcast.cpp b/src/preferences/dialog/dlgprefbroadcast.cpp index b8e3bfc1d8b..e259a043f52 100644 --- a/src/preferences/dialog/dlgprefbroadcast.cpp +++ b/src/preferences/dialog/dlgprefbroadcast.cpp @@ -146,15 +146,27 @@ DlgPrefBroadcast::DlgPrefBroadcast(QWidget *parent, static_cast(EncoderSettings::ChannelMode::STEREO)); connect(checkBoxEnableReconnect, +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + &QCheckBox::checkStateChanged, +#else &QCheckBox::stateChanged, +#endif this, &DlgPrefBroadcast::checkBoxEnableReconnectChanged); connect(checkBoxLimitReconnects, +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + &QCheckBox::checkStateChanged, +#else &QCheckBox::stateChanged, +#endif this, &DlgPrefBroadcast::checkBoxLimitReconnectsChanged); connect(enableCustomMetadata, +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + &QCheckBox::checkStateChanged, +#else &QCheckBox::stateChanged, +#endif this, &DlgPrefBroadcast::enableCustomMetadataChanged); @@ -280,15 +292,30 @@ void DlgPrefBroadcast::broadcastEnabledChanged(double value) { btnDisconnectAll->setEnabled(enabled); } +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +void DlgPrefBroadcast::checkBoxEnableReconnectChanged(Qt::CheckState state) { + widgetReconnectControls->setEnabled(state == Qt::Checked); +#else void DlgPrefBroadcast::checkBoxEnableReconnectChanged(int value) { widgetReconnectControls->setEnabled(value); +#endif } +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +void DlgPrefBroadcast::checkBoxLimitReconnectsChanged(Qt::CheckState state) { + spinBoxMaximumRetries->setEnabled(state == Qt::Checked); +#else void DlgPrefBroadcast::checkBoxLimitReconnectsChanged(int value) { spinBoxMaximumRetries->setEnabled(value); +#endif } +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +void DlgPrefBroadcast::enableCustomMetadataChanged(Qt::CheckState state) { + const bool value = (state == Qt::Checked); +#else void DlgPrefBroadcast::enableCustomMetadataChanged(int value) { +#endif custom_artist->setEnabled(value); custom_title->setEnabled(value); } diff --git a/src/preferences/dialog/dlgprefbroadcast.h b/src/preferences/dialog/dlgprefbroadcast.h index fa52f4ed7e8..589ecb8a1c9 100644 --- a/src/preferences/dialog/dlgprefbroadcast.h +++ b/src/preferences/dialog/dlgprefbroadcast.h @@ -23,9 +23,15 @@ class DlgPrefBroadcast : public DlgPreferencePage, public Ui::DlgPrefBroadcastDl void slotUpdate() override; void slotResetToDefaults() override; void broadcastEnabledChanged(double value); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + void checkBoxEnableReconnectChanged(Qt::CheckState state); + void checkBoxLimitReconnectsChanged(Qt::CheckState state); + void enableCustomMetadataChanged(Qt::CheckState state); +#else void checkBoxEnableReconnectChanged(int value); void checkBoxLimitReconnectsChanged(int value); void enableCustomMetadataChanged(int value); +#endif void connectionListItemSelected(const QModelIndex& selected); signals: diff --git a/src/preferences/dialog/dlgprefkey.cpp b/src/preferences/dialog/dlgprefkey.cpp index ed45a66e30e..23b38a33962 100644 --- a/src/preferences/dialog/dlgprefkey.cpp +++ b/src/preferences/dialog/dlgprefkey.cpp @@ -54,12 +54,27 @@ DlgPrefKey::DlgPrefKey(QWidget* parent, UserSettingsPointer pConfig) this, &DlgPrefKey::pluginSelected); setScrollSafeGuard(plugincombo); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + connect(banalyzerenabled, &QCheckBox::checkStateChanged, +#else connect(banalyzerenabled, &QCheckBox::stateChanged, - this, &DlgPrefKey::analyzerEnabled); +#endif + this, + &DlgPrefKey::analyzerEnabled); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + connect(bfastAnalysisEnabled, &QCheckBox::checkStateChanged, +#else connect(bfastAnalysisEnabled, &QCheckBox::stateChanged, - this, &DlgPrefKey::fastAnalysisEnabled); +#endif + this, + &DlgPrefKey::fastAnalysisEnabled); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + connect(breanalyzeEnabled, &QCheckBox::checkStateChanged, +#else connect(breanalyzeEnabled, &QCheckBox::stateChanged, - this, &DlgPrefKey::reanalyzeEnabled); +#endif + this, + &DlgPrefKey::reanalyzeEnabled); connect(radioNotationOpenKey, &QRadioButton::toggled, this, &DlgPrefKey::setNotationOpenKey); @@ -173,18 +188,33 @@ void DlgPrefKey::pluginSelected(int i) { slotUpdate(); } +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +void DlgPrefKey::analyzerEnabled(Qt::CheckState state) { + m_bAnalyzerEnabled = (state == Qt::Checked); +#else void DlgPrefKey::analyzerEnabled(int i) { m_bAnalyzerEnabled = static_cast(i); +#endif slotUpdate(); } +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +void DlgPrefKey::fastAnalysisEnabled(Qt::CheckState state) { + m_bFastAnalysisEnabled = (state == Qt::Checked); +#else void DlgPrefKey::fastAnalysisEnabled(int i) { m_bFastAnalysisEnabled = static_cast(i); +#endif slotUpdate(); } +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +void DlgPrefKey::reanalyzeEnabled(Qt::CheckState state) { + m_bReanalyzeEnabled = (state == Qt::Checked); +#else void DlgPrefKey::reanalyzeEnabled(int i) { m_bReanalyzeEnabled = static_cast(i); +#endif slotUpdate(); } diff --git a/src/preferences/dialog/dlgprefkey.h b/src/preferences/dialog/dlgprefkey.h index 42edc479e2b..9af2b6045bb 100644 --- a/src/preferences/dialog/dlgprefkey.h +++ b/src/preferences/dialog/dlgprefkey.h @@ -28,9 +28,15 @@ class DlgPrefKey : public DlgPreferencePage, Ui::DlgPrefKeyDlg { private slots: void pluginSelected(int i); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + void analyzerEnabled(Qt::CheckState state); + void fastAnalysisEnabled(Qt::CheckState state); + void reanalyzeEnabled(Qt::CheckState state); +#else void analyzerEnabled(int i); void fastAnalysisEnabled(int i); void reanalyzeEnabled(int i); +#endif void setNotation(KeyUtils::KeyNotation notation); void setNotationOpenKey(bool); diff --git a/src/preferences/dialog/dlgprefreplaygain.cpp b/src/preferences/dialog/dlgprefreplaygain.cpp index 34103dce589..7324ff5bf43 100644 --- a/src/preferences/dialog/dlgprefreplaygain.cpp +++ b/src/preferences/dialog/dlgprefreplaygain.cpp @@ -19,7 +19,11 @@ DlgPrefReplayGain::DlgPrefReplayGain(QWidget* parent, UserSettingsPointer pConfi m_enabled(kConfigKey, kReplayGainEnabled) { setupUi(this); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + connect(EnableGain, &QCheckBox::checkStateChanged, this, &DlgPrefReplayGain::slotSetRGEnabled); +#else connect(EnableGain, &QCheckBox::stateChanged, this, &DlgPrefReplayGain::slotSetRGEnabled); +#endif connect(buttonGroupAnalyzer, #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) &QButtonGroup::idClicked, @@ -49,7 +53,11 @@ DlgPrefReplayGain::DlgPrefReplayGain(QWidget* parent, UserSettingsPointer pConfi setScrollSafeGuard(SliderDefaultBoost); connect(checkBoxReanalyze, +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + &QCheckBox::checkStateChanged, +#else &QCheckBox::stateChanged, +#endif this, &DlgPrefReplayGain::slotSetReanalyze); @@ -113,8 +121,13 @@ void DlgPrefReplayGain::slotResetToDefaults() { slotApply(); } -void DlgPrefReplayGain::slotSetRGEnabled() { - m_rgSettings.setReplayGainEnabled(EnableGain->isChecked()); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +void DlgPrefReplayGain::slotSetRGEnabled(Qt::CheckState state) { + m_rgSettings.setReplayGainEnabled(state == Qt::Checked); +#else +void DlgPrefReplayGain::slotSetRGEnabled(int isChecked) { + m_rgSettings.setReplayGainEnabled(static_cast(isChecked)); +#endif slotUpdate(); slotApply(); } @@ -178,8 +191,12 @@ void DlgPrefReplayGain::slotApply() { m_enabled.set(EnableGain->isChecked() ? 1.0 : 0.0); } -void DlgPrefReplayGain::slotSetReanalyze() { - bool checked = checkBoxReanalyze->isChecked(); - m_rgSettings.setReplayGainReanalyze(checked); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +void DlgPrefReplayGain::slotSetReanalyze(Qt::CheckState state) { + m_rgSettings.setReplayGainReanalyze(state == Qt::Checked); +#else +void DlgPrefReplayGain::slotSetReanalyze(int state) { + m_rgSettings.setReplayGainReanalyze(static_cast(state)); +#endif slotApply(); } diff --git a/src/preferences/dialog/dlgprefreplaygain.h b/src/preferences/dialog/dlgprefreplaygain.h index 98372fe63e4..88b69743579 100644 --- a/src/preferences/dialog/dlgprefreplaygain.h +++ b/src/preferences/dialog/dlgprefreplaygain.h @@ -20,9 +20,17 @@ class DlgPrefReplayGain: public DlgPreferencePage, // Update initial gain increment void slotUpdateReplayGainBoost(); void slotUpdateDefaultBoost(); - void slotSetRGEnabled(); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + void slotSetRGEnabled(Qt::CheckState); +#else + void slotSetRGEnabled(int); +#endif void slotSetRGAnalyzerChanged(); - void slotSetReanalyze(); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + void slotSetReanalyze(Qt::CheckState); +#else + void slotSetReanalyze(int); +#endif void slotApply() override; void slotUpdate() override; diff --git a/src/skin/legacy/legacyskinparser.cpp b/src/skin/legacy/legacyskinparser.cpp index 480928a3b66..e6dbdfb6640 100644 --- a/src/skin/legacy/legacyskinparser.cpp +++ b/src/skin/legacy/legacyskinparser.cpp @@ -227,6 +227,13 @@ QDomElement LegacySkinParser::openSkin(const QString& skinPath) { QDomDocument skin("skin"); +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + const auto parseResult = skin.setContent(&skinXmlFile); + if (!parseResult) { + qDebug() << "LegacySkinParser::openSkin - setContent failed see" + << "line:" << parseResult.errorLine << "column:" << parseResult.errorColumn; + qDebug() << "LegacySkinParser::openSkin - message:" << parseResult.errorMessage; +#else QString errorMessage; int errorLine; int errorColumn; @@ -235,6 +242,7 @@ QDomElement LegacySkinParser::openSkin(const QString& skinPath) { qDebug() << "LegacySkinParser::openSkin - setContent failed see" << "line:" << errorLine << "column:" << errorColumn; qDebug() << "LegacySkinParser::openSkin - message:" << errorMessage; +#endif return QDomElement(); } @@ -1732,6 +1740,15 @@ QDomElement LegacySkinParser::loadTemplate(const QString& path) { } QDomDocument tmpl("template"); + +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + const auto parseResult = tmpl.setContent(&templateFile); + if (!parseResult) { + qWarning() << "LegacySkinParser::loadTemplate - setContent failed see" + << absolutePath << "line:" << parseResult.errorLine + << "column:" << parseResult.errorColumn; + qWarning() << "LegacySkinParser::loadTemplate - message:" << parseResult.errorMessage; +#else QString errorMessage; int errorLine; int errorColumn; @@ -1741,6 +1758,7 @@ QDomElement LegacySkinParser::loadTemplate(const QString& path) { qWarning() << "LegacySkinParser::loadTemplate - setContent failed see" << absolutePath << "line:" << errorLine << "column:" << errorColumn; qWarning() << "LegacySkinParser::loadTemplate - message:" << errorMessage; +#endif return QDomElement(); } diff --git a/src/util/datetime.h b/src/util/datetime.h index 6cc238b1aa3..f921ddd7f29 100644 --- a/src/util/datetime.h +++ b/src/util/datetime.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include "util/assert.h" @@ -13,7 +14,11 @@ namespace mixxx { /// Obtain the local date time from an UTC date time. inline QDateTime localDateTimeFromUtc( const QDateTime& dt) { +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + return QDateTime(dt.date(), dt.time(), QTimeZone::UTC).toLocalTime(); +#else return QDateTime(dt.date(), dt.time(), Qt::UTC).toLocalTime(); +#endif } /// Extract a QDateTime from a QVariant. diff --git a/src/util/db/sqlite.cpp b/src/util/db/sqlite.cpp index fae53bde223..3610f10f517 100644 --- a/src/util/db/sqlite.cpp +++ b/src/util/db/sqlite.cpp @@ -1,5 +1,7 @@ #include "util/db/sqlite.h" +#include + #include "util/assert.h" namespace { @@ -40,7 +42,11 @@ QDateTime readGeneratedTimestamp(const QVariant& value) { VERIFY_OR_DEBUG_ASSERT(time.isValid()) { return QDateTime(); } +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + return QDateTime(date, time, QTimeZone::UTC); +#else return QDateTime(date, time, Qt::UTC); +#endif } QVariant writeGeneratedTimestamp(const QDateTime& value) { diff --git a/src/util/xml.cpp b/src/util/xml.cpp index ccfee0fb986..06726be1649 100644 --- a/src/util/xml.cpp +++ b/src/util/xml.cpp @@ -69,15 +69,23 @@ QDomElement XmlParse::openXMLFile(const QString& path, const QString& name) { qDebug() << "Could not open xml file:" << file.fileName(); return QDomElement(); } + +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + const auto parseResult = doc.setContent(&file); + if (!parseResult) { + QString errorString = + QStringLiteral("%1 at line %2, column %3") + .arg(parseResult.errorMessage, + QString::number(parseResult.errorLine), + QString::number(parseResult.errorColumn)); + +#else QString error; int line, col; if (!doc.setContent(&file, &error, &line, &col)) { - QString errorString = QString("%1 at line %2, column %3") - .arg(error).arg(line).arg(col); - - QString errorLog = QString("Error parsing XML file %1: %2") - .arg(file.fileName(), errorString); - qWarning() << errorLog; + QString errorString = QString("%1 at line %2, column %3").arg(error).arg(line).arg(col); +#endif + qWarning().nospace() << "Error parsing XML file " << file.fileName() << ": " << errorString; // Set up error dialog ErrorDialogProperties* props = ErrorDialogHandler::instance()->newDialogProperties(); diff --git a/src/widget/weffectchainpresetbutton.cpp b/src/widget/weffectchainpresetbutton.cpp index 56e4f40d462..3b7e7d694b8 100644 --- a/src/widget/weffectchainpresetbutton.cpp +++ b/src/widget/weffectchainpresetbutton.cpp @@ -135,43 +135,35 @@ void WEffectChainPresetButton::populateMenu() { static_cast(parameterTypeId); const auto& loadedParameters = pEffectSlot->getLoadedParameters().value(parameterType); - for (const auto& pParameter : loadedParameters) { - auto pCheckbox = make_parented(pEffectMenu); - pCheckbox->setChecked(true); - pCheckbox->setText(pParameter->manifest()->name()); - auto handler = [pCheckbox{pCheckbox.get()}, pEffectSlot, pParameter] { - if (pCheckbox->isChecked()) { - pEffectSlot->showParameter(pParameter); - } else { - pEffectSlot->hideParameter(pParameter); - } - }; - connect(pCheckbox.get(), &QCheckBox::stateChanged, this, handler); - - auto pAction = make_parented(pEffectMenu); - pAction->setDefaultWidget(pCheckbox.get()); - - pEffectMenu->addAction(pAction.get()); - } - const auto& hiddenParameters = pEffectSlot->getHiddenParameters().value(parameterType); - for (const auto& pParameter : hiddenParameters) { - auto pCheckbox = make_parented(pEffectMenu); - pCheckbox->setChecked(false); - pCheckbox->setText(pParameter->manifest()->name()); - auto handler = [pCheckbox{pCheckbox.get()}, pEffectSlot, pParameter] { - if (pCheckbox->isChecked()) { - pEffectSlot->showParameter(pParameter); - } else { - pEffectSlot->hideParameter(pParameter); - } - }; - connect(pCheckbox.get(), &QCheckBox::stateChanged, this, handler); - - auto pAction = make_parented(pEffectMenu); - pAction->setDefaultWidget(pCheckbox.get()); - - pEffectMenu->addAction(pAction.get()); + for (const auto& parameters : {loadedParameters, hiddenParameters}) { + for (const auto& pParameter : parameters) { + auto pCheckbox = make_parented(pEffectMenu); + pCheckbox->setChecked(true); + pCheckbox->setText(pParameter->manifest()->name()); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + auto handler = [pEffectSlot, pParameter](Qt::CheckState state) { + if (state == Qt::Checked) { +#else + auto handler = [pEffectSlot, pParameter](int state) { + if (static_cast(state)) { +#endif + pEffectSlot->showParameter(pParameter); + } else { + pEffectSlot->hideParameter(pParameter); + } + }; +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + connect(pCheckbox.get(), &QCheckBox::checkStateChanged, this, handler); +#else + connect(pCheckbox.get(), &QCheckBox::stateChanged, this, handler); +#endif + + auto pAction = make_parented(pEffectMenu); + pAction->setDefaultWidget(pCheckbox.get()); + + pEffectMenu->addAction(pAction.get()); + } } } pEffectMenu->addSeparator(); diff --git a/src/widget/wtrackmenu.cpp b/src/widget/wtrackmenu.cpp index ef1b52b35fc..697cccc263b 100644 --- a/src/widget/wtrackmenu.cpp +++ b/src/widget/wtrackmenu.cpp @@ -1550,7 +1550,17 @@ void WTrackMenu::slotPopulateCrateMenu() { m_pCrateMenu->addAction(pAction.get()); connect(pAction.get(), &QAction::triggered, this, [this, pCheckBox{pCheckBox.get()}] { updateSelectionCrates(pCheckBox); }); + +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + connect(pCheckBox.get(), + &QCheckBox::checkStateChanged, + this, + [this, pCheckBox{pCheckBox.get()}] { + updateSelectionCrates(pCheckBox); + }); +#else connect(pCheckBox.get(), &QCheckBox::stateChanged, this, [this, pCheckBox{pCheckBox.get()}] { updateSelectionCrates(pCheckBox); }); +#endif } m_pCrateMenu->addSeparator(); QAction* newCrateAction = new QAction(tr("Add to New Crate"), m_pCrateMenu);