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. Mac: Getting toolbar color via QPalette
Forum Update on Monday, May 27th 2025

Mac: Getting toolbar color via QPalette

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 894 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.
  • J Offline
    J Offline
    janfaroe
    wrote on last edited by
    #1

    Hola all. Since the Qt guys think it's a great idea to keep the bg color of the QTabWidget tab area in another color than the window bg color, I thought I might try make them look a bit more standards compliant like this:

    QTabBar {
    background-color:#e8e8e8;
    }

    I'm getting the color #e8e8e8 from myMainWindow::color(QPalette::Window).name(). But, it's not the right color. Trying with QPalette::Background gives me same value.

    Any ideas?

    I've attached the following image to further illustrate if my words are unclear:
    !http://i41.tinypic.com/rj2kuw.jpg()!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      No yet a clean solution but in-between, you could use the color picker from OS X to get the color and hard code it

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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