I know how to check default platform, but I need to check in my application if it run on X11 or Wayland. I try this:
QString platform = qgetenv("QT_QPA_PLATFORM");
but it returns an empty string.
On Weston when I run my application I set QT_QPA_PLATFORM to Wayland:
./myApp -platform wayland
but my QString platform is still empty, and default platform name doesn't change either.
You're looking for QGuiApplication::platformName()
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With