diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/qml/qqmlmetatype.cpp | 7 | ||||
-rw-r--r-- | src/qml/qml/qqmlmetatype_p.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index e34f7a407f..ea4a69f05d 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -1080,6 +1080,13 @@ bool QQmlType::isCreatable() const return d && d->regType == CppType && d->extraData.cd->newFunc; } +QQmlType::ExtensionFunc QQmlType::extensionFunction() const +{ + if (!d || d->regType != CppType) + return nullptr; + return d->extraData.cd->extFunc; +} + bool QQmlType::isExtendedType() const { if (!d) diff --git a/src/qml/qml/qqmlmetatype_p.h b/src/qml/qml/qqmlmetatype_p.h index 4a5e4ba266..b3ca6acd64 100644 --- a/src/qml/qml/qqmlmetatype_p.h +++ b/src/qml/qml/qqmlmetatype_p.h @@ -201,6 +201,8 @@ public: QQmlCustomParser *customParser() const; bool isCreatable() const; + typedef QObject *(*ExtensionFunc)(QObject *); + ExtensionFunc extensionFunction() const; bool isExtendedType() const; QString noCreationReason() const; |