diff --git a/models/checklistmodel.cpp b/models/checklistmodel.cpp index c81194b..9f3f03b 100644 --- a/models/checklistmodel.cpp +++ b/models/checklistmodel.cpp @@ -81,7 +81,13 @@ bool ChecklistModel::setData(const QModelIndex &index, const QVariant &value, in success = true; break; case Qt::CheckStateRole: - if (value.canConvert(QMetaType::Int)) { + if (value.canConvert( +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) + QMetaType::Int +#else + QMetaType::fromType() +#endif + )) { m_items[index.row()].m_checkState = static_cast(value.toInt()); success = true; } @@ -224,7 +230,15 @@ void ChecklistModel::restore(QSettings &settings, const QString &name) continue; } const auto selected = settings.value(QStringLiteral("selected")); - if (!id.isNull() && !selected.isNull() && selected.canConvert(QMetaType::Bool) && !restoredIds.contains(id)) { + if (!id.isNull() && !selected.isNull() + && selected.canConvert( +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) + QMetaType::Bool +#else + QMetaType::fromType() +#endif + ) + && !restoredIds.contains(id)) { m_items << ChecklistItem(id, labelForId(id), selected.toBool() ? Qt::Checked : Qt::Unchecked); restoredIds << id; } diff --git a/resources/resources.cpp b/resources/resources.cpp index 7c18507..1c8fe90 100644 --- a/resources/resources.cpp +++ b/resources/resources.cpp @@ -306,8 +306,10 @@ bool hasCoreApp() */ void setupCommonQtApplicationAttributes() { +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true); QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true); +#endif } // namespace ApplicationInstances