aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAmanda Hamblin-Trué <amanda.hamblin-true@qt.io>2023-06-29 17:05:30 +0200
committerAmanda Hamblin-Trué <amanda.hamblin-true@qt.io>2023-06-30 14:36:14 +0200
commit6ea6bbeb32f9ae946c80d7d7f9c4cb696238c70b (patch)
tree64310c6d86a834f86214383d31f8bbf0f2936009 /src
parentb9bfdea0e2c6721d2306af0ecc44f88da9988957 (diff)
Clarify error message for QML type registration
Fixes: QTBUG-114966 Change-Id: I3451cf38841cbefe0fa8d7c07ce91da372f8d184 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/qml/qml/qqml.cpp5
-rw-r--r--src/qml/qml/qqml.h4
2 files changed, 5 insertions, 4 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);