Results 1 to 3 of 3

Thread: How to preserve item's icon color ?

  1. #1
    Join Date
    Dec 2010
    Location
    Russia
    Posts
    83
    Thanks
    1
    Thanked 12 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default How to preserve item's icon color ?

    Hey everyone.

    Following the QPalette property explanation :
    As long as no special palette has been set, this is either a special palette for the widget class, the parent's palette or (if this widget is a top level widget), the default application palette.
    So here's the problem: once a table's item is selected, it's icon color is multiplied by some color anyway! I mean, no matter what color roles i've changed in it's palette, i wasn't able to get rid of the grey color...Maybe i'm doing something initially wrong and there is another way to preserve icon's color withough palette adjustment? If anyone has any experience with something similiar...please share

    Thanks!


  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How to preserve item's icon color ?

    By selecting the item the QIcon changes mode to 'selected' as well, which is changing its appearance.
    Read the QIcon docs on how to change that behavior to fit your needs.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Dec 2010
    Location
    Russia
    Posts
    83
    Thanks
    1
    Thanked 12 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to preserve item's icon color ?

    Thanks for the reference ,but i think my probles has something to do with the application's palette instead of icon modes.I mean , i do construct proper pixmaps according to the modes but there is still this blue color on top of it...

Similar Threads

  1. QTreeView item color
    By tmmak in forum Qt Programming
    Replies: 1
    Last Post: 11th January 2011, 06:08
  2. Display action as menu item without icon?
    By bmueller63 in forum Qt Programming
    Replies: 0
    Last Post: 21st October 2010, 20:51
  3. Set text color for menu item
    By stella1016 in forum Qt Programming
    Replies: 6
    Last Post: 16th March 2010, 10:27
  4. bg color of current item for a QTreeView
    By joeld42 in forum Qt Programming
    Replies: 1
    Last Post: 18th October 2009, 17:06
  5. Setting an icon to an Item in a QlistWidget
    By LordQt in forum Qt Programming
    Replies: 18
    Last Post: 23rd August 2007, 22:24

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.