Results 1 to 2 of 2

Thread: Changing font color for a single item in a QTreeView

  1. #1
    Join Date
    Jan 2006
    Location
    Berkeley California
    Posts
    109
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Changing font color for a single item in a QTreeView

    I want to be able to set the Text (foreground) colors - normal and highlighted, on a single entry in a QTreeView. Is there some way to obtain the QPalette of the given entry if a have a QModelIndex to it?

    Thanks
    Doug

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Changing font color for a single item in a QTreeView

    Make data() return a custom color for Qt::ForegroundRole.
    J-P Nurmi

Similar Threads

  1. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 07:13

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.