From c3f4491231a58f16ee7c1e1ad66569f0eddbfc4f Mon Sep 17 00:00:00 2001 From: Ye ShanShan Date: Tue, 3 Dec 2024 17:02:06 +0800 Subject: [PATCH] fix: ColorSelector can't read builtin property firstly in qt6.8 Remove cached in qt6.8. pms: BUG-289241 --- src/private/dquickcontrolpalette.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/private/dquickcontrolpalette.cpp b/src/private/dquickcontrolpalette.cpp index d9b6c628..117bd0af 100644 --- a/src/private/dquickcontrolpalette.cpp +++ b/src/private/dquickcontrolpalette.cpp @@ -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