[autotests/wayland] Fix with Qt 5.6

Test need to disable HighDPI, otherwise they crash.
This commit is contained in:
Martin Gräßlin 2015-11-10 10:58:33 +01:00
parent 1998d5ac1a
commit 51b44f4a87

View file

@ -51,16 +51,23 @@ private:
} }
#define WAYLANTEST_MAIN(TestObject) \ #define WAYLANDTEST_MAIN_HELPER(TestObject, DPI) \
int main(int argc, char *argv[]) \ int main(int argc, char *argv[]) \
{ \ { \
setenv("QT_QPA_PLATFORM", "wayland-org.kde.kwin.qpa", true); \ setenv("QT_QPA_PLATFORM", "wayland-org.kde.kwin.qpa", true); \
setenv("QT_QPA_PLATFORM_PLUGIN_PATH", KWINQPAPATH, true); \ setenv("QT_QPA_PLATFORM_PLUGIN_PATH", KWINQPAPATH, true); \
setenv("KWIN_FOCRE_OWN_QPA", "1", true); \ setenv("KWIN_FOCRE_OWN_QPA", "1", true); \
DPI; \
KWin::WaylandTestApplication app(argc, argv); \ KWin::WaylandTestApplication app(argc, argv); \
app.setAttribute(Qt::AA_Use96Dpi, true); \ app.setAttribute(Qt::AA_Use96Dpi, true); \
TestObject tc; \ TestObject tc; \
return QTest::qExec(&tc, argc, argv); \ return QTest::qExec(&tc, argc, argv); \
} }
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
#define WAYLANTEST_MAIN(TestObject) WAYLANDTEST_MAIN_HELPER(TestObject, QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling) )
#else
#define WAYLANTEST_MAIN(TestObject) WAYLANDTEST_MAIN_HELPER(TestObject,)
#endif
#endif #endif