diff options
-rw-r--r-- | src/qml/qml/qqml.cpp | 5 | ||||
-rw-r--r-- | src/qml/qml/qqml.h | 4 | ||||
-rw-r--r-- | tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp | 10 |
3 files changed, 11 insertions, 8 deletions
diff --git a/src/qml/qml/qqml.cpp b/src/qml/qml/qqml.cpp index ce73e2461b..f951fb6a14 100644 --- a/src/qml/qml/qqml.cpp +++ b/src/qml/qml/qqml.cpp @@ -151,9 +151,10 @@ void QQmlPrivate::qmlRegistrationWarning( { switch (warning) { case UnconstructibleType: - qWarning() + qWarning().nospace() << metaType.name() - << "is neither a QObject, nor default- and copy-constructible, nor uncreatable." + << " is neither a default constructible QObject, nor a default- " + << "and copy-constructible Q_GADGET, nor marked as uncreatable.\n" << "You should not use it as a QML type."; break; case UnconstructibleSingleton: diff --git a/src/qml/qml/qqml.h b/src/qml/qml/qqml.h index 1399f88989..2a609af2c9 100644 --- a/src/qml/qml/qqml.h +++ b/src/qml/qml/qqml.h @@ -826,8 +826,8 @@ struct QmlTypeAndRevisionsRegistration<T, Resolved, Extended, false, false, fals } #else static_assert(QQmlPrivate::QmlMetaType<Resolved>::hasAcceptableCtors(), - "This type is neither a QObject, nor default- and copy-constructible, nor" - "uncreatable.\n" + "This type is neither a default constructible QObject, nor a default- " + "and copy-constructible Q_GADGET, nor marked as uncreatable.\n" "You should not use it as a QML type."); static_assert(std::is_base_of_v<QObject, Resolved> || !QQmlTypeInfo<Resolved>::hasAttachedProperties); diff --git a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp index 319ed81b26..c9d41bdb78 100644 --- a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp +++ b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp @@ -536,13 +536,15 @@ void tst_qmltyperegistrar::uncreatable() #if QT_DEPRECATED_SINCE(6, 4) QTest::ignoreMessage( QtWarningMsg, - "BadUncreatable is neither a QObject, nor default- and copy-constructible, " - "nor uncreatable. You should not use it as a QML type."); + "BadUncreatable is neither a default constructible QObject, nor a default- " + "and copy-constructible Q_GADGET, nor marked as uncreatable.\n" + "You should not use it as a QML type."); qmlRegisterTypesAndRevisions<BadUncreatable>("A", 1); QTest::ignoreMessage( QtWarningMsg, - "BadUncreatableExtended is neither a QObject, nor default- and copy-constructible, " - "nor uncreatable. You should not use it as a QML type."); + "BadUncreatableExtended is neither a default constructible QObject, nor a default- " + "and copy-constructible Q_GADGET, nor marked as uncreatable.\n" + "You should not use it as a QML type."); qmlRegisterTypesAndRevisions<BadUncreatableExtended>("A", 1); #endif |