4

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.

Magda Aarsman
  • 191
  • 2
  • 15

1 Answers1

7

You're looking for QGuiApplication::platformName().

peppe
  • 21,934
  • 4
  • 55
  • 70