Results 1 to 4 of 4

Thread: [Qt 4.x] Highliting rows in a QTreeView

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Boulder, Colorado, USA
    Posts
    63
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 8 Times in 5 Posts

    Default Re: [Qt 4.x] Highliting rows in a QTreeView

    try myTreeView->setAlternatingRowColors(true);

  2. #2
    Join Date
    Jan 2006
    Posts
    33
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11
    Thanks
    3
    Thanked 2 Times in 2 Posts

    Default Re: [Qt 4.x] Highliting rows in a QTreeView

    cool, that works! Completely missed that in the doc. Embarrassing!
    Thanks.
    Seems to have been a so often reimplemented feature that the trolls put it in there API then.

    Right, but now, if I want to go further and highlight a row or a even a cell depending on the content of the row/cell.
    How can I do this?

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: [Qt 4.x] Highliting rows in a QTreeView

    Use different roles from the model. If it's not enough, provide a custom delegate for the view.

Similar Threads

  1. Replies: 4
    Last Post: 26th September 2011, 12:02
  2. QTreeView and multi-select of rows
    By QPlace in forum Qt Programming
    Replies: 1
    Last Post: 27th October 2008, 02:32
  3. Fetching rows in QtreeView
    By visor_ua in forum Qt Programming
    Replies: 2
    Last Post: 5th July 2008, 18:17
  4. QTreeView rows (items) StyleSheet
    By Kostanev in forum Qt Programming
    Replies: 1
    Last Post: 15th September 2007, 10:36
  5. QTreeView rows editable
    By Pesho in forum Qt Programming
    Replies: 5
    Last Post: 13th September 2007, 13:19

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
  •  
Qt is a trademark of The Qt Company.