Results 1 to 3 of 3

Thread: qss qtreeview and checkboxes

  1. #1
    Join Date
    Nov 2012
    Posts
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default qss qtreeview and checkboxes

    How to stylize checkboxes in treeview?
    gd_qtreeview.png

  2. #2
    Join Date
    May 2012
    Posts
    136
    Thanks
    2
    Thanked 27 Times in 24 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: qss qtreeview and checkboxes

    I presume they are just normal checkboxes?
    Just create a stylesheet for checkboxes and apply it to the treeview
    QCheckBox::indicator:unchecked
    {
    color:rgb(255,0,0);
    }
    QCheckBox::indicator:checked
    {
    color:rgb(0,0,255);
    }

    or if you want to make one global stylesheet and not affect any other checkboxes use the child selector (all the checkboxes need to be a direct child of the QTreeView else use a space instead of > )

    QTreeView > QCheckBox::indicator:unchecked
    {}

    QTreeView > QCheckBox::indicator:checked
    {}
    Last edited by StrikeByte; 10th November 2014 at 15:23.

  3. #3
    Join Date
    Nov 2012
    Posts
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qss qtreeview and checkboxes

    It is not work!! QCheckBox already styled.

    And i try your solution
    Quote Originally Posted by StrikeByte View Post
    QTreeView > QCheckBox::indicator:unchecked
    {}

    QTreeView > QCheckBox::indicator:checked
    {}
    But still nothing

    I aready find solution

    http://qt-project.org/forums/viewthread/49497/

Similar Threads

  1. Replies: 1
    Last Post: 2nd December 2010, 10:07
  2. Replies: 1
    Last Post: 18th June 2010, 13:06
  3. QTreeView and CheckBoxes
    By FreeG in forum Qt Programming
    Replies: 2
    Last Post: 9th December 2009, 09:36
  4. qtreeview + checkboxes
    By lamera in forum Newbie
    Replies: 9
    Last Post: 6th September 2008, 22:10
  5. QTreeView with checkboxes
    By shad in forum Qt Programming
    Replies: 1
    Last Post: 4th May 2006, 13:29

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.