diff --git a/src/dnativesettings.cpp b/src/dnativesettings.cpp index f5b0bc2..db46d70 100644 --- a/src/dnativesettings.cpp +++ b/src/dnativesettings.cpp @@ -146,7 +146,11 @@ void DNativeSettings::init(const QMetaObject *metaObject) QMetaPropertyBuilder op; - switch (mp.type()) { +#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) + switch (static_cast(mp.metaType())) { +#else + switch (static_cast(mp.type())) { +#endif case QMetaType::QByteArray: case QMetaType::QString: case QMetaType::QColor: @@ -411,7 +415,7 @@ int DNativeSettings::metaCall(QMetaObject::Call _c, int _id, void ** _a) const int index = p.propertyIndex(); // 对于本地属性,此处应该从m_settings中读写 if (Q_LIKELY(index != m_flagPropertyIndex && index != m_allKeysPropertyIndex - && index >= m_firstProperty)) { + && index >= m_firstProperty + m_propertyCount)) { switch (_c) { case QMetaObject::ReadProperty: *reinterpret_cast(_a[1]) = m_settings->setting(p.name());