Skip to content

Commit

Permalink
fix: ColorSelector can't read builtin property firstly in qt6.8
Browse files Browse the repository at this point in the history
Remove cached in qt6.8.

pms: BUG-289241
  • Loading branch information
18202781743 committed Dec 3, 2024
1 parent af10434 commit c3f4491
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/private/dquickcontrolpalette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,12 +861,15 @@ void DQuickControlColorSelector::ensureMetaObject()
return;

m_metaObject = new CustomMetaObject(this);
// TODO setCached will cause builtin property is undefined firstly in qml.
#if QT_VERSION <= QT_VERSION_CHECK(6, 8, 0)
// Must true, see CustomMetaObject::createProperty
m_metaObject->setCached(true);
QQmlData *qmldata = QQmlData::get(this);
Q_ASSERT(qmldata);
// the cache object is from QQmlOpenMetaObjectTypePrivate
m_propertyCache = qmldata->propertyCache;
#endif
}

int DQuickControlColorSelector::indexOfPalette(const QByteArray &name) const
Expand Down

0 comments on commit c3f4491

Please sign in to comment.