I used the QTreeWidget to show some record,
Now I want the record displayed more beautiful,like the background color,foreground color,and I also want to draw the border as the item.
and how can i do,which function should be rewrited?
thax![]()
I used the QTreeWidget to show some record,
Now I want the record displayed more beautiful,like the background color,foreground color,and I also want to draw the border as the item.
and how can i do,which function should be rewrited?
thax![]()
take a look at QItemDelegate & QStyledItemDelegate.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
and how to use it?
I just find this:" use QTreeView and subclass QItemDelegate instead. "
thanks
you can also use stylesheets for them, that would be much easier..read about them in assistant
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
I rewrited the drawDisplay,but why the function drawBackground is not virtual?
i'd disagree with that, the performance hit(if any) is going to be inconsiderable..plus when you use css for all this stuff..u can change the look and feel of your application WITHOUT recompiling your whole application..and in his case, the changes he wants requires a 5-6 line css..i dont see a real harm in that..i guess its just preferences of people..today's machines are fast enough..and its just the demographic of application that you are targetting which should be bore in mind before you take these implementation decisions..people should be provided with all options possible, with respective pros and cons, and let them decide..but thats just me..
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
here. (btw, you could click by QStyledItemDelegate and you opened the same page).
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
also you can read this article.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Bookmarks