Results 1 to 6 of 6

Thread: How to do this with StyleSheet

  1. #1
    Join Date
    May 2008
    Posts
    58
    Thanks
    2

    Default How to do this with StyleSheet

    hi guys

    You know in the QTreeView, for the selected item's background color, they are two types:
    1. when QTreeView get focus
    2. when QTreeView lose focus

    in this two cases, they are different colors

    Now my problem is: how to modify these two colors with stylesheet

    Thanks in advance

  2. #2
    Join Date
    Oct 2007
    Location
    Cracow
    Posts
    56
    Thanks
    1
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to do this with StyleSheet

    use this
    Qt Code:
    1. QTreeView::item:selected:active
    2. {
    3. background: green;
    4. }
    5.  
    6. QTreeView::item:selected:!active
    7. {
    8. background: yellow;
    9. }
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    May 2008
    Posts
    58
    Thanks
    2

    Default Re: How to do this with StyleSheet

    Sorry, it doesn't work
    Are you sure?

  4. #4
    Join Date
    May 2008
    Posts
    12
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: How to do this with StyleSheet


  5. #5
    Join Date
    Oct 2007
    Location
    Cracow
    Posts
    56
    Thanks
    1
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to do this with StyleSheet

    yes I'm sure, but I look to docs and it has been added it in qt 4.4 so maybe here is problem that its won't work to you

  6. #6
    Join Date
    May 2008
    Posts
    58
    Thanks
    2

    Default Re: How to do this with StyleSheet

    Yes , I confirmed , :active is Qt 4.4's property, not for Qt 4.3 ,
    it is a pity I am using Qt4.3 and must use this version
    How to do it in Qt4.3?

Similar Threads

  1. QTableView paint row in stylesheet hover
    By estanisgeyer in forum Qt Programming
    Replies: 3
    Last Post: 23rd October 2012, 10:17
  2. Styling QComoBox using CSS Stylesheet
    By bjoernbg in forum Qt Programming
    Replies: 1
    Last Post: 7th October 2010, 00:12
  3. StyleSheet components using Qt designer
    By Kostanev in forum Qt Tools
    Replies: 1
    Last Post: 21st April 2008, 09:28
  4. how to apply stylesheet to qtopia application using qss file
    By namita in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 31st March 2008, 08:04
  5. Replies: 8
    Last Post: 17th March 2008, 15:04

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.