Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to detect if Wayland or X11 is used?

How to detect if Wayland or X11 is used?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 968 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Asperamanca
    wrote on 24 Apr 2023, 09:48 last edited by
    #1

    Is there any (reasonably simple) way to detect within my Qt application (6.4) whether I am running on X11 or Wayland?
    I can check for OS first using Q_OS_LINUX, so the code could even be platform-specific.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      CPPUIX
      wrote on 24 Apr 2023, 11:35 last edited by
      #2

      Hi
      Would QGuiApplication::platformName() work?

      A 1 Reply Last reply 24 Apr 2023, 11:38
      4
      • C CPPUIX
        24 Apr 2023, 11:35

        Hi
        Would QGuiApplication::platformName() work?

        A Offline
        A Offline
        Asperamanca
        wrote on 24 Apr 2023, 11:38 last edited by
        #3

        @Abderrahmene_Rayene
        Ha! I knew it would be something as simple as that...

        1 Reply Last reply
        0
        • A Asperamanca has marked this topic as solved on 24 Apr 2023, 11:38

        2/3

        24 Apr 2023, 11:35

        • Login

        • Login or register to search.
        2 out of 3
        • First post
          2/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved