tests: Construct QCoreApplication earlier

The global event filter wasn't being set as it didn't have
a qGuiApp at that point
This commit is contained in:
Sergio Martins
2022-07-02 12:37:38 +01:00
parent c72fdf3586
commit 5639b5632a
5 changed files with 33 additions and 14 deletions

View File

@@ -330,12 +330,20 @@ bool Platform_qt::isGammaray()
return is;
}
Platform_qt::Platform_qt(int &argc, char **argv)
Platform_qt::Platform_qt(QCoreApplication *)
: m_globalEventFilter(new GlobalEventFilter(this))
{
// This CTOR is called before we have a QApplication
}
void Platform_qt::tests_wait(int ms)
{
QTest::qWait(ms);
}
void Platform_qt::maybeSetOffscreenQPA(int argc, char **argv)
{
bool qpaPassed = false;
for (int i = 1; i < argc; ++i) {
if (qstrcmp(argv[i], "-platform") == 0) {
qpaPassed = true;
@@ -349,11 +357,6 @@ Platform_qt::Platform_qt(int &argc, char **argv)
}
}
void Platform_qt::tests_wait(int ms)
{
QTest::qWait(ms);
}
#endif
bool Platform_qt::isProcessingAppQuitEvent() const