diff options
| author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2025-10-12 23:00:20 +0300 |
|---|---|---|
| committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2025-10-12 23:00:20 +0300 |
| commit | 4826f86e274f1b29bd769e6790824f9e62a40f62 (patch) | |
| tree | c2cc4bb09ca91951a2641e33c3b0a65deb0af877 /src/qmltest/quicktest.cpp | |
| parent | 0f0972d542d9869c2dcfaf9c963d42ff32766460 (diff) | |
| parent | 844f9b9b376838bcb44324984876f8bf99d85d38 (diff) | |
Merge tag 'v6.5.7-lts-lgpl' into 6.56.5
Qt 6.5.7-lts-lgpl release
Diffstat (limited to 'src/qmltest/quicktest.cpp')
| -rw-r--r-- | src/qmltest/quicktest.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp index b4bfd94d17..4e653ba26b 100644 --- a/src/qmltest/quicktest.cpp +++ b/src/qmltest/quicktest.cpp @@ -31,6 +31,8 @@ #include <QtGui/qtextdocument.h> #include <stdio.h> #include <QtGui/QGuiApplication> +#include <QtGui/private/qguiapplication_p.h> +#include <QtGui/qpa/qplatformintegration.h> #include <QtCore/QTranslator> #include <QtTest/QSignalSpy> #include <QtQml/QQmlFileSelector> @@ -340,7 +342,7 @@ private: TestCaseEnumerationResult enumerateTestCases( const QQmlRefPointer<QV4::ExecutableCompilationUnit> &compilationUnit, - const Object *object = nullptr) + const QV4::CompiledData::Object *object = nullptr) { QQmlType testCaseType; for (quint32 i = 0, count = compilationUnit->importCount(); i < count; ++i) { @@ -362,7 +364,7 @@ private: if (!object) // Start at root of compilation unit if not enumerating a specific child object = compilationUnit->objectAt(0); - if (object->hasFlag(Object::IsInlineComponentRoot)) + if (object->hasFlag(QV4::CompiledData::Object::IsInlineComponentRoot)) return result; if (const auto superTypeUnit = compilationUnit->resolvedTypes.value( @@ -409,7 +411,7 @@ private: for (auto binding = object->bindingsBegin(); binding != object->bindingsEnd(); ++binding) { if (binding->type() == QV4::CompiledData::Binding::Type_Object) { - const Object *child = compilationUnit->objectAt(binding->value.objectIndex); + const QV4::CompiledData::Object *child = compilationUnit->objectAt(binding->value.objectIndex); result << enumerateTestCases(compilationUnit, child); } } @@ -649,10 +651,12 @@ int quick_test_main_with_setup(int argc, char **argv, const char *name, const ch qWarning().nospace() << "Test '" << QDir::toNativeSeparators(path) << "' window not exposed after show()."; } - view.requestActivate(); - if (!QTest::qWaitForWindowActive(&view)) { - qWarning().nospace() - << "Test '" << QDir::toNativeSeparators(path) << "' window not active after requestActivate()."; + if (QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) { + view.requestActivate(); + if (!QTest::qWaitForWindowActive(&view)) { + qWarning().nospace() + << "Test '" << QDir::toNativeSeparators(path) << "' window not active after requestActivate()."; + } } if (view.isExposed()) { // Defer property update until event loop has started |
