PDA

View Full Version : QTreeWidget question



ClamsTheCat
19th March 2008, 14:27
Hello, I have a question that relates to QT4 and the QTreeWidget (using PyQT).

I want to have (or somehow mimic the appearance of) horizontal lines between the rows of QTreeWidgetItems. I know the QTableView has the grid option, and I am looking for something similar to that. The only difference is I only want to display horizontal lines in between each item to separate the rows. I didn't see any members or inherited members that could do this. I was hoping there was a way to simulate this using a style sheet or something, but I could not come up with a way.

Is there a reasonably simple way to do this?

Thanks!

jpn
19th March 2008, 20:48
You could reimplement QTreeView::drawRow(). Call the base class implementation to draw the actual content and draw the additional line by yourself.