Results 1 to 4 of 4

Thread: Problem with border radius on my QHeaderView

  1. #1

    Default Problem with border radius on my QHeaderView

    corner problem.png

    I'm having a problem with my header on a QTreeWidget. I've been trying to use a border radius on both the tree and the header, but around the header I get this white space where the corners would be if they were not rounded. See image. What I want it to do is show the background image instead of the white space. This works on the bottom of the QTreeWidget, so I'm fairly certain the problem is with the QHeaderView. I've tried various methods to fix this but have been unable to so far. Any help would be appreciated.

    Here are the stylesheets ive used for these widgets:

    Qt Code:
    1. background-color: rgb(40, 41, 46);
    2. color: rgb(203,204,207);
    3. padding: 0px 0px 0px 0px;
    4. outline: none;
    5. border: 0px;
    6. margin: 0px;
    7. border-radius: 7px;
    8. }
    9.  
    10. QTreeWidget::item:hover {
    11. background-color: #202020;
    12. color: #7ea229;
    13. }
    14.  
    15. QTreeWidget::item:selected:active:!hover
    16. {
    17. background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #88af2c, stop: 1 #718b31);
    18. }
    19.  
    20. QTreeWidget::item:selected:!active:!hover
    21. {
    22. background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #88af2c, stop: 1 #718b31);
    23. }
    24.  
    25. QTreeWidget::branch:selected:closed:has-children:has-siblings {
    26. background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #88af2c, stop: 1 #718b31);
    27. }
    28.  
    29. QTreeWidget::branch:selected:open:has-children:has-siblings {
    30. background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #88af2c, stop: 1 #718b31);
    31. }
    32. QHeaderView::section {
    33. padding: 4px;
    34. font: bold 11pt;
    35. color: rgb(203, 204, 207);
    36. background-color: rgb(26,27,31);
    37. border-top-left-radius: 7px;
    38. border-top-right-radius: 7px;
    39. }
    40.  
    41. #catalogueItemHierarchyTree
    42. {
    43. border: 0px;
    44. background-image: url(:/please-wait-bg200.png);
    45. background-repeat: none;
    46. background-position: center;
    47. }
    To copy to clipboard, switch view to plain text mode 

  2. #2

    Default Re: Problem with border radius on my QHeaderView

    Figured it out. This was the solution:

    QTreeWidget > QFrame{ background-image: url(:/icons/Ribbon/ribbonbg.png);}

    Didn't realize you could do the QTreeWidget > QFrame thing.

  3. #3

    Default Re: Problem with border radius on my QHeaderView

    Hey I have the same issues but I don't understand this solution. Why is he setting an image? And what means QTreeWidget > QFrame

  4. #4

    Default Re: Problem with border radius on my QHeaderView

    Mhm can nobody help me?

Similar Threads

  1. negative border radius style sheet
    By matteo.ceruti in forum Qt Programming
    Replies: 0
    Last Post: 23rd December 2011, 15:19
  2. Replies: 1
    Last Post: 14th April 2011, 00:11
  3. Border radius unix/windows
    By dacrawler in forum Newbie
    Replies: 2
    Last Post: 23rd January 2011, 14:27
  4. QFrame with border-radius inside QGraphicsScene
    By DeRatizator in forum Qt Programming
    Replies: 2
    Last Post: 23rd August 2010, 09:39
  5. resize problem with QHeaderView using qt4.5.3
    By drawat in forum Qt Programming
    Replies: 0
    Last Post: 4th August 2010, 09:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.