diff options
Diffstat (limited to 'src/qml/qml/qqmlmetatype.cpp')
-rw-r--r-- | src/qml/qml/qqmlmetatype.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index 42f67f3345..900ac5a2e4 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -233,7 +233,10 @@ void QQmlType::SingletonInstanceInfo::init(QQmlEngine *e) v4->popContext(); } else if (qobjectCallback && !qobjectApi(e)) { v4->pushGlobalContext(); - setQObjectApi(e, qobjectCallback(e, e)); + QObject *o = qobjectCallback(e, e); + setQObjectApi(e, o); + // if this object can use a property cache, create it now + QQmlData::ensurePropertyCache(e, o); v4->popContext(); } else if (!url.isEmpty() && !qobjectApi(e)) { v4->pushGlobalContext(); |