Results 1 to 1 of 1

Thread: QtTreePropertyBrowser Not Obeying Stylesheet

  1. #1
    Join Date
    Feb 2010
    Location
    Sydney, Australia
    Posts
    111
    Thanks
    18
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QtTreePropertyBrowser Not Obeying Stylesheet

    In my application I'm using a QTreeView to display some data and a QtTreePropertyBrowser to display properties associated with that data (similar to Qt Designer's Object Inspector and Property Editor). I'm applying a custom QSS to the application using QMainWindow::setStyleSheet(). The relevant part of the stylesheet is:
    Qt Code:
    1. show-decoration-selected: 1;
    2. selection-color: white;
    3. alternate-background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #EFEFEF, stop: 1 #DFDFDF);
    4. }
    5.  
    6. QTreeView::item {
    7. border: transparent;
    8. }
    9.  
    10. QTreeView::item:!selected:hover {
    11. background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D0D0D0, stop: 1 #CFCFCF);
    12. }
    13.  
    14. QTreeView::item:selected:!hover{
    15. background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #8F9CBF, stop: 1 #838FAF);
    16. }
    17.  
    18. QTreeView::item:selected:hover{
    19. background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #7888AF, stop: 1 #6D7C9F);
    20. }
    To copy to clipboard, switch view to plain text mode 

    The QTreeView is affected by the stylesheet, but the QtTreePropertyBrowser's treeview is not. Is there an obvious reason for this? I'm assuming that the QtTreePropertyBrowser uses an underlying QTreeView to display its data.
    Last edited by stefanadelbert; 12th August 2010 at 02:19. Reason: updated contents

Similar Threads

  1. QtTreePropertyBrowser and tooltip
    By jobrandt in forum Qt Programming
    Replies: 1
    Last Post: 5th October 2009, 10:43
  2. Replies: 2
    Last Post: 11th August 2009, 17:01
  3. Qt Stylesheet
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 22nd January 2009, 15:48
  4. How to do this with StyleSheet
    By yxmaomao in forum Qt Programming
    Replies: 5
    Last Post: 30th May 2008, 09:54
  5. stylesheet
    By phillip_Qt in forum Qt Programming
    Replies: 11
    Last Post: 27th April 2008, 20:11

Tags for this Thread

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.