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 disable auto gradient effect in QHeaderView?
QtWS25 Last Chance

How to disable auto gradient effect in QHeaderView?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 458 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.
  • F Offline
    F Offline
    flammmable
    wrote on 12 Apr 2019, 05:46 last edited by
    #1

    I have type some code to fill the whole QTreeWidget with single color:

    myTree->setStyleSheet("border: 1px solid green; background: green;");
    

    But as a result, the header color is not a solid color. Instead, the header has a gradient with two contrast lines.

    How can I disable this effect and fill the header with a solid color?

    alt text

    1 Reply Last reply
    1
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 12 Apr 2019, 07:20 last edited by mrjj 4 Dec 2019, 07:20
      #2

      Hi
      Try

      QHeaderView::section {
        border: 0px solid green; background: green;
      }
      

      What platform ?
      Seems to works on Windows.

      1 Reply Last reply
      2
      • F Offline
        F Offline
        flammmable
        wrote on 12 Apr 2019, 08:33 last edited by flammmable 4 Dec 2019, 08:42
        #3

        Thank you! It's working!
        Yes, it's Windows.

        1 Reply Last reply
        1
        • M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 12 Apr 2019, 08:35 last edited by
          #4

          Hi
          Super.
          I didnt not get gradient effect so was not sure it was also windows.
          Please mark as solved if possible :)

          1 Reply Last reply
          0

          3/4

          12 Apr 2019, 08:33

          • Login

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