Skip to content

Commit

Permalink
fix: DPlatformTheme::property not work
Browse files Browse the repository at this point in the history
buildNativeSettings 之后 metaobject 被替换了
不会走原来的 read 方法了。
读写属性时如果是 base 对象原始属性 fallback 到
base 对象的 qt_metacall  方法

Issue: linuxdeepin/dtk#101
  • Loading branch information
kegechen committed Nov 7, 2023
1 parent 18c5979 commit aac3811
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dnativesettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<QVariant*>(_a[1]) = m_settings->setting(p.name());
Expand Down

0 comments on commit aac3811

Please sign in to comment.