GUI: use X11 (xcb) as platform instead of Wayland on Linux to

avoid various weird behaviours
tests: disable GUI-dependent tests (`TestQZint::renderTest()`) if
  ZINT_SANITIZE and on Linux for later versions of Qt (5 and 6)
  to avoid ASAN "detected memory leaks" errors on exit
This commit is contained in:
gitlost 2024-10-07 16:04:22 +01:00
parent 34be69d241
commit c1666cf350
3 changed files with 53 additions and 16 deletions

View file

@ -1,6 +1,6 @@
/***************************************************************************
* Copyright (C) 2008 by BogDan Vatra <bogdan@licentia.eu> *
* Copyright (C) 2009-2022 by Robin Stuart <rstuart114@gmail.com> *
* Copyright (C) 2009-2024 by Robin Stuart <rstuart114@gmail.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@ -21,6 +21,13 @@ int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(resources);
#if defined(__linux__) && QT_VERSION > 0x50F02
/* Not compatible with Wayland for some reason(s) so use X11 unless overridden */
if (qEnvironmentVariableIsEmpty("QT_QPA_PLATFORM")) {
qputenv("QT_QPA_PLATFORM", QByteArrayLiteral("xcb"));
}
#endif
#if QT_VERSION >= 0x50600 && QT_VERSION < 0x60100
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif