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. Get the color of a tab in a tab widget
Qt 6.11 is out! See what's new in the release blog

Get the color of a tab in a tab widget

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 512 Views 1 Watching
  • 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.
  • apalomerA Offline
    apalomerA Offline
    apalomer
    wrote on last edited by
    #1

    Hello,

    I have developed a GUI in which there is a tab area (QTabWidget). This area is the one with one tab in the image with the title "Graphic". There will be more tabs added while the GUI is beeing used. In this tab, I add a QCustomPlot and I want the backround of this widget to be the same as the color of the tab when it is acctive (the current problem does not come from setting the backround of the QCustomPlot but from getting the appropiate color from the tab widget). I have tried this different options:

    customPlot->setBackground(ui->tabWidget->currentWidget()->palette().color(QPalette::Background));
    customPlot->setBackground(ui->tabWidget->palette().color(QPalette::Background));
    

    but none of them paints the backround of the customPlot with the color of the tab when it is active. If somebody can tell me how to propperly get the color of the tab when it is selected I will apreciate vey much.

    alt text

    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