Results 1 to 2 of 2

Thread: how to set the color in even or odd lines in QTreeView?

  1. #1
    Join Date
    Oct 2007
    Posts
    32
    Thanks
    3
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default how to set the color in even or odd lines in QTreeView?

    Hi all,

    I am using the QTreeView to display the SQL table by setting the model in QSqlTableModel. The data can be shown in QTreeView correct. How can I modify the characteristic in each line? My purpose is to set the color in even or odd lines.

    Is there any exist public function can do that? Or any enhanced widget can do so?

  2. #2
    Join Date
    Jan 2008
    Location
    Bengaluru
    Posts
    144
    Thanks
    8
    Thanked 7 Times in 7 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: how to set the color in even or odd lines in QTreeView?

    you can check setting up the colors using stylesheet. Alternating row colors.

  3. The following user says thank you to nikhilqt for this useful post:

    SamT (14th April 2011)

Similar Threads

  1. Qt4.7.0 Alternate Row Color from QSS ignored (QTreeView)
    By DancingFirefly in forum Qt Programming
    Replies: 2
    Last Post: 15th February 2011, 23:12
  2. QTreeView item color
    By tmmak in forum Qt Programming
    Replies: 1
    Last Post: 11th January 2011, 07:08
  3. QTreeView Custom column with an icon, and 2 lines of text
    By mromanuk in forum Qt Programming
    Replies: 2
    Last Post: 5th July 2010, 19:37
  4. Replies: 4
    Last Post: 25th May 2008, 21:01
  5. [QT4] QTreeView and rows with multiple lines
    By KShots in forum Qt Programming
    Replies: 8
    Last Post: 30th March 2006, 19:47

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.