diff --git a/src/mumble/BanEditor.cpp b/src/mumble/BanEditor.cpp index fd5adc4ec9c..079e586401e 100644 --- a/src/mumble/BanEditor.cpp +++ b/src/mumble/BanEditor.cpp @@ -13,6 +13,8 @@ #include +#include + BanEditor::BanEditor(const MumbleProto::BanList &msg, QWidget *p) : QDialog(p), maskDefaultValue(32) { setupUi(this); @@ -28,7 +30,11 @@ BanEditor::BanEditor(const MumbleProto::BanList &msg, QWidget *p) : QDialog(p), b.qsHash = u8(be.hash()); b.qsReason = u8(be.reason()); b.qdtStart = QDateTime::fromString(u8(be.start()), Qt::ISODate); +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + b.qdtStart.setTimeZone(QTimeZone::UTC); +#else b.qdtStart.setTimeSpec(Qt::UTC); +#endif if (!b.qdtStart.isValid()) b.qdtStart = QDateTime::currentDateTime(); b.iDuration = be.duration(); diff --git a/src/mumble/PluginUpdater.cpp b/src/mumble/PluginUpdater.cpp index fd529eff30e..2a0d7bd99d4 100644 --- a/src/mumble/PluginUpdater.cpp +++ b/src/mumble/PluginUpdater.cpp @@ -70,7 +70,13 @@ void PluginUpdater::promptAndUpdate() { setWindowIcon(QIcon(QLatin1String("skin:mumble.svg"))); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + // checkStateChanged was introduced in Qt 6.7 + QObject::connect(qcbSelectAll, &QCheckBox::checkStateChanged, this, &PluginUpdater::on_selectAll); +#else QObject::connect(qcbSelectAll, &QCheckBox::stateChanged, this, &PluginUpdater::on_selectAll); +#endif + QObject::connect(this, &QDialog::finished, this, &PluginUpdater::on_finished); if (exec() == QDialog::Accepted) { @@ -117,7 +123,12 @@ void PluginUpdater::populateUI() { UpdateWidgetPair pair = { checkBox, urlLabel }; m_pluginUpdateWidgets << pair; +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + // checkStateChanged was introduced in Qt 6.7 + QObject::connect(checkBox, &QCheckBox::checkStateChanged, this, &PluginUpdater::on_singleSelectionChanged); +#else QObject::connect(checkBox, &QCheckBox::stateChanged, this, &PluginUpdater::on_singleSelectionChanged); +#endif } // sort the plugins alphabetically @@ -147,7 +158,11 @@ void PluginUpdater::clearUI() { } } +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +void PluginUpdater::on_selectAll(Qt::CheckState checkState) { +#else void PluginUpdater::on_selectAll(int checkState) { +#endif // failsafe for partially selected state (shouldn't happen though) if (checkState == Qt::PartiallyChecked) { checkState = Qt::Unchecked; @@ -161,7 +176,11 @@ void PluginUpdater::on_selectAll(int checkState) { } } +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +void PluginUpdater::on_singleSelectionChanged(Qt::CheckState checkState) { +#else void PluginUpdater::on_singleSelectionChanged(int checkState) { +#endif bool isChecked = checkState == Qt::Checked; // Block signals for the selectAll checkBox in order to not trigger its diff --git a/src/mumble/PluginUpdater.h b/src/mumble/PluginUpdater.h index 32185f5bd8b..bf996c6b55b 100644 --- a/src/mumble/PluginUpdater.h +++ b/src/mumble/PluginUpdater.h @@ -84,10 +84,17 @@ class PluginUpdater : public QDialog, public Ui::PluginUpdater { public slots: /// Clears the UI from the widgets created for the individual plugins. void clearUI(); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + /// Slot triggered if the user changes the state of the selectAll CheckBox. + void on_selectAll(Qt::CheckState checkState); + /// Slot triggered if the user toggles the CheckBox for any individual plugin. + void on_singleSelectionChanged(Qt::CheckState checkState); +#else /// Slot triggered if the user changes the state of the selectAll CheckBox. void on_selectAll(int checkState); /// Slot triggered if the user toggles the CheckBox for any individual plugin. void on_singleSelectionChanged(int checkState); +#endif /// Slot triggered when the dialog is being closed. void on_finished(int result); /// Slot that can be triggered to ask for the update process to be interrupted. diff --git a/src/mumble/SocketRPC.cpp b/src/mumble/SocketRPC.cpp index dfea98c57d1..410c70c0c12 100644 --- a/src/mumble/SocketRPC.cpp +++ b/src/mumble/SocketRPC.cpp @@ -73,7 +73,11 @@ void SocketRPCClient::readyRead() { void SocketRPCClient::processXml() { QDomDocument qdd; +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + qdd.setContent(qbaOutput, QDomDocument::ParseOption::Default); +#else qdd.setContent(qbaOutput, false); +#endif QDomElement request = qdd.firstChildElement(); diff --git a/src/mumble/UserListModel.cpp b/src/mumble/UserListModel.cpp index eb4d95e363b..b3f04d0443c 100644 --- a/src/mumble/UserListModel.cpp +++ b/src/mumble/UserListModel.cpp @@ -17,6 +17,8 @@ #include +#include + UserListModel::UserListModel(const MumbleProto::UserList &userList, QObject *parent_) : QAbstractTableModel(parent_), m_legacyMode(false) { m_userList.reserve(userList.users_size()); @@ -296,6 +298,10 @@ QString UserListModel::pathForChannelId(const unsigned int channelId) const { QDateTime UserListModel::isoUTCToDateTime(const std::string &isoTime) const { QDateTime dt = QDateTime::fromString(u8(isoTime), Qt::ISODate); +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + dt.setTimeZone(QTimeZone::UTC); +#else dt.setTimeSpec(Qt::UTC); +#endif return dt; }