diff options
Diffstat (limited to 'src/qml/qml/qqml.cpp')
-rw-r--r-- | src/qml/qml/qqml.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/qml/qml/qqml.cpp b/src/qml/qml/qqml.cpp index 73eff6f3fc..07aea5e553 100644 --- a/src/qml/qml/qqml.cpp +++ b/src/qml/qml/qqml.cpp @@ -141,6 +141,31 @@ QObject *QQmlPrivate::qmlExtendedObject(QObject *object, int index) return static_cast<QObject *>(result); } +void QQmlPrivate::qmlRegistrationWarning( + QQmlPrivate::QmlRegistrationWarning warning, QMetaType metaType) +{ + switch (warning) { + case UnconstructibleType: + qWarning() + << metaType.name() + << "is neither a QObject, nor default- and copy-constructible, nor uncreatable." + << "You should not use it as a QML type."; + break; + case UnconstructibleSingleton: + qWarning() + << "Singleton" << metaType.name() + << "needs either a default constructor or, when adding a default" + << "constructor is infeasible, a public static" + << "create(QQmlEngine *, QJSEngine *) method."; + break; + case NonQObjectWithAtached: + qWarning() + << metaType.name() + << "is not a QObject, but has attached properties. This won't work."; + break; + } +} + int qmlRegisterUncreatableMetaObject(const QMetaObject &staticMetaObject, const char *uri, int versionMajor, int versionMinor, const char *qmlName, |