From aac38115fcbe54a0c5042ee2e61594a196e812c2 Mon Sep 17 00:00:00 2001 From: ck Date: Tue, 7 Nov 2023 17:09:07 +0800 Subject: [PATCH] fix: DPlatformTheme::property not work MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit buildNativeSettings 之后 metaobject 被替换了 不会走原来的 read 方法了。 读写属性时如果是 base 对象原始属性 fallback 到 base 对象的 qt_metacall 方法 Issue: linuxdeepin/dtk#101 --- src/dnativesettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dnativesettings.cpp b/src/dnativesettings.cpp index 1afb3408..65eadd70 100644 --- a/src/dnativesettings.cpp +++ b/src/dnativesettings.cpp @@ -411,7 +411,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());