aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2024-04-09 14:46:54 +0200
committerCarl Schwan <carl@carlschwan.eu>2024-04-15 16:03:18 +0200
commitf5e5e4d3e84289ed1f2af1c8397649b25aa088d4 (patch)
treef331ab05521b887a2f82b40d7e74e9e710b016ec /tests/auto/qml
parentffb557ff17d45684aac159762ae4bcc8a04ba573 (diff)
Improve error message for broken QML_SINGLETON
The current error message doesn't cover the case where the class with the QML_SINGLETON is an abstract class. This will still compile but fail at runtime with an error message not mentioning this case. Change-Id: I134254b252ca3c2250e5f5bc2ac9f9d79a2658fd Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/qml')
-rw-r--r--tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp
index 24ba0da26d..563c88f850 100644
--- a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp
+++ b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp
@@ -540,45 +540,45 @@ void tst_qmltyperegistrar::uncreatable()
#if QT_DEPRECATED_SINCE(6, 4)
QTest::ignoreMessage(
QtWarningMsg,
- "Singleton SingletonIncreatable needs either a default constructor or, "
- "when adding a default constructor is infeasible, a public static "
- "create(QQmlEngine *, QJSEngine *) method.");
+ "Singleton SingletonIncreatable needs to be a concrete class with either a "
+ "default constructor or, when adding a default constructor is infeasible, "
+ "a public static create(QQmlEngine *, QJSEngine *) method.");
qmlRegisterTypesAndRevisions<SingletonIncreatable>("A", 1);
QTest::ignoreMessage(
QtWarningMsg,
- "Singleton SingletonIncreatable2 needs either a default constructor or, "
- "when adding a default constructor is infeasible, a public static "
- "create(QQmlEngine *, QJSEngine *) method.");
+ "Singleton SingletonIncreatable2 needs to be a concrete class with either a "
+ "default constructor or, when adding a default constructor is infeasible, "
+ "a public static create(QQmlEngine *, QJSEngine *) method.");
qmlRegisterTypesAndRevisions<SingletonIncreatable2>("A", 1);
QTest::ignoreMessage(
QtWarningMsg,
- "Singleton SingletonIncreatable3 needs either a default constructor or, "
- "when adding a default constructor is infeasible, a public static "
- "create(QQmlEngine *, QJSEngine *) method.");
+ "Singleton SingletonIncreatable3 needs to be a concrete class with either a "
+ "default constructor or, when adding a default constructor is infeasible, "
+ "a public static create(QQmlEngine *, QJSEngine *) method.");
qmlRegisterTypesAndRevisions<SingletonIncreatable3>("A", 1);
QTest::ignoreMessage(
QtWarningMsg,
- "Singleton SingletonIncreatable4 needs either a default constructor or, "
- "when adding a default constructor is infeasible, a public static "
- "create(QQmlEngine *, QJSEngine *) method.");
+ "Singleton SingletonIncreatable4 needs to be a concrete class with either a "
+ "default constructor or, when adding a default constructor is infeasible, "
+ "a public static create(QQmlEngine *, QJSEngine *) method.");
qmlRegisterTypesAndRevisions<SingletonIncreatable4>("A", 1);
QTest::ignoreMessage(
QtWarningMsg,
- "Singleton SingletonIncreatableExtended needs either a default constructor or, "
- "when adding a default constructor is infeasible, a public static "
- "create(QQmlEngine *, QJSEngine *) method.");
+ "Singleton SingletonIncreatableExtended needs to be a concrete class with either a "
+ "default constructor or, when adding a default constructor is infeasible, "
+ "a public static create(QQmlEngine *, QJSEngine *) method.");
qmlRegisterTypesAndRevisions<SingletonIncreatableExtended>("A", 1);
QTest::ignoreMessage(
QtWarningMsg,
- "Singleton SingletonForeign needs either a default constructor or, "
- "when adding a default constructor is infeasible, a public static "
- "create(QQmlEngine *, QJSEngine *) method.");
+ "Singleton SingletonForeign needs to be a concrete class with either a "
+ "default constructor or, when adding a default constructor is infeasible, "
+ "a public static create(QQmlEngine *, QJSEngine *) method.");
qmlRegisterTypesAndRevisions<SingletonLocalUncreatable1>("A", 1);
QTest::ignoreMessage(
QtWarningMsg,
- "Singleton SingletonForeign needs either a default constructor or, "
- "when adding a default constructor is infeasible, a public static "
- "create(QQmlEngine *, QJSEngine *) method.");
+ "Singleton SingletonForeign needs to be a concrete class with either a "
+ "default constructor or, when adding a default constructor is infeasible, "
+ "a public static create(QQmlEngine *, QJSEngine *) method.");
qmlRegisterTypesAndRevisions<SingletonLocalUncreatable2>("A", 1);
#endif