diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2020-09-07 14:23:02 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2020-09-07 14:56:01 +0200 |
commit | 37daab473ab724df538baeff1c4214f902edb41e (patch) | |
tree | f1c5bee52ba740005d1c44076ae6a71d2ea30fb9 /tests/auto/styleimports/tst_styleimports.cpp | |
parent | d9ab60c15b93e6ed46d72e1c5001d44bafc1d86b (diff) |
Native style: call QQuickStylePlugin::registerTypes() from style plugins
This ensures that we received the warning we expect in
tst_StyleImports::importStyleWithoutControls when run with native styles.
Change-Id: I290f4e72222688e68ae36ace36f1d8be4bedaf31
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'tests/auto/styleimports/tst_styleimports.cpp')
-rw-r--r-- | tests/auto/styleimports/tst_styleimports.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/auto/styleimports/tst_styleimports.cpp b/tests/auto/styleimports/tst_styleimports.cpp index 239f5783..8b47dee7 100644 --- a/tests/auto/styleimports/tst_styleimports.cpp +++ b/tests/auto/styleimports/tst_styleimports.cpp @@ -221,10 +221,14 @@ void tst_StyleImports::importStyleWithoutControls() const QUrl url(testFileUrl(QString::fromLatin1("import%1StyleWithoutControls.qml").arg(style))); bool success = false; - // Two warnings, because Default is used as the fallback. + // Account for extra warnings for fallback styles. + QTest::ignoreMessage(QtWarningMsg, QRegularExpression("QtQuick.Controls must be imported before importing.*Default")); + if (style == QLatin1String("macOS")) + QTest::ignoreMessage(QtWarningMsg, QRegularExpression("QtQuick.Controls must be imported before importing.*Fusion")); + + // Account for the warning for the current style. if (style != QLatin1String("Default")) QTest::ignoreMessage(QtWarningMsg, QRegularExpression("QtQuick.Controls must be imported before importing.*" + style)); - QTest::ignoreMessage(QtWarningMsg, QRegularExpression("QtQuick.Controls must be imported before importing.*Default")); QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, this, [url, &success](QObject *obj, const QUrl &objUrl) { |