View Full Version : how to set the color in even or odd lines in QTreeView?

14th April 2011, 02:17
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?

14th April 2011, 07:34
you can check setting up the colors using stylesheet. Alternating row colors.