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. Is it possible to make QHeaderView sections look more like buttons and be able to be depressed?
Forum Updated to NodeBB v4.3 + New Features

Is it possible to make QHeaderView sections look more like buttons and be able to be depressed?

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 119 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.
  • G Offline
    G Offline
    GaryT
    wrote on last edited by
    #1

    I am new to QT. I am trying to make the QHeaderView of a QTreeWidget look like below :

    header.png
    In the program I am trying to convert to QT, the buttons depress when clicked on. I noticed that the first column seems to depress when clicked on in QHeaderView, but the rest of the columns do not. Is it possible to make the other columns respond the same as the first column? Can this be done with style sheets? I tried :

    QHeaderView::section:pressed
    {
    background-color:red;
    }

    This worked for the first column but not for the rest. By working I mean when I pressed on the first column header, the background turned red. When I released the mouse, it returned to the default background color.

    Thanks for help in advance
    Gary

    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