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 and enable dark mode?
QtWS25 Last Chance

How to detect and enable dark mode?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 1.9k 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.
  • P Offline
    P Offline
    Publicnamer
    wrote on last edited by
    #1

    Does Qt automatically follow whatever color scheme is in use by GTK2?
    If so, does it only know about the current set of specified colors, or does it also know what the name of the GTK2 theme is e.g. AdwaitaDark?
    If it knows the name, how can obtain it programmatically?

    P 1 Reply Last reply
    0
    • P Publicnamer

      Does Qt automatically follow whatever color scheme is in use by GTK2?
      If so, does it only know about the current set of specified colors, or does it also know what the name of the GTK2 theme is e.g. AdwaitaDark?
      If it knows the name, how can obtain it programmatically?

      P Offline
      P Offline
      Publicnamer
      wrote on last edited by
      #2

      @Publicnamer
      To answer my own question, look at:

      QColor color = QPalette().color(QPalette::Window);

      1 Reply Last reply
      0
      • E Offline
        E Offline
        Ewan Green
        wrote on last edited by
        #3

        Qt itself does not contain a portal to the existing GTK themes. There are lookalikes like AdwaitaQt, Breeze, and many of Kvantum's themes, but none of them actually get their data from the current GTK theme. This is the closest you will get without doing any work yourself. And it sucks.

        Ewan Green

        1 Reply Last reply
        0

        • Login

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