diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2022-02-08 18:22:14 +0100 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2022-02-09 14:44:00 +0000 |
commit | a6fcb4b3ce4e9c323168cb94696f3037d839330d (patch) | |
tree | 0c9bda020b4fb1330fdcc885687fca4d742852b0 | |
parent | aac0e8ef6ecca8979cd753b2aaa86301ef2d4bbb (diff) |
Tests: Fix crashing of tst_flamegraphview on Windows
...by setting the RHI backend to "opengl". That is preliminary.
QQuickWidget will work with other backends such as "d3d11", soon (likely
with Qt 6.4).
Change-Id: I57e1869e837794fa887894cae0905a548f9e436c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r-- | tests/auto/tracing/flamegraphview/tst_flamegraphview.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/tracing/flamegraphview/tst_flamegraphview.cpp b/tests/auto/tracing/flamegraphview/tst_flamegraphview.cpp index cf384e5691..9e21721687 100644 --- a/tests/auto/tracing/flamegraphview/tst_flamegraphview.cpp +++ b/tests/auto/tracing/flamegraphview/tst_flamegraphview.cpp @@ -27,6 +27,7 @@ #include <tracing/flamegraph.h> #include <tracing/timelinetheme.h> +#include <utils/hostosinfo.h> #include <utils/theme/theme_p.h> #include <QObject> @@ -55,6 +56,8 @@ class tst_FlameGraphView : public QObject public: tst_FlameGraphView() { Utils::setCreatorTheme(&theme); } + static void initMain(); + private slots: void initTestCase(); void testZoom(); @@ -67,6 +70,15 @@ private: DummyTheme theme; }; +void tst_FlameGraphView::initMain() +{ + if (Utils::HostOsInfo::isWindowsHost()) { +#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) + qputenv("QSG_RHI_BACKEND", "opengl"); +#endif // Qt >= 6.2 + } +} + void tst_FlameGraphView::initTestCase() { model.fill(); |