tests: Run tst_view on offscreen by default

Moved the QPA offscreen defaulting to Platform_qt
This commit is contained in:
Sergio Martins
2022-05-08 19:38:52 +01:00
parent 97f26743e5
commit 985224f24b
6 changed files with 15 additions and 42 deletions

View File

@@ -196,8 +196,20 @@ bool Platform_qt::isGammaray()
Platform_qt::Platform_qt(int argc, char *argv[])
{
Q_UNUSED(argc)
Q_UNUSED(argv)
// This CTOR is called before we have a QApplication
bool qpaPassed = false;
for (int i = 1; i < argc; ++i) {
if (qstrcmp(argv[i], "-platform") == 0) {
qpaPassed = true;
break;
}
}
if (!qpaPassed) {
// Use offscreen by default as it's less annoying, doesn't create visible windows
qputenv("QT_QPA_PLATFORM", "offscreen");
}
}
void Platform_qt::tests_wait(int ms)