PDA

View Full Version : QTreeWidget problem!!



mcenatie
8th March 2006, 21:38
Hi,

I'm working on an instant messenger application.
I have a class Contact subclassing QTreeWidgetItem and a class with a QTreeWidget attributes. I want to add a Contact in the QTreeWidget with the method addTopLevelItem ( QTreeWidgetItem * item ) ! But when I make that, no contact appears in the QTreeWidget!
So what can I do to paint the contacts?
Is it the good way? Maybe I can use the model-view-controller ! But in this case I don't know how to use my data with the model (in trolltech examples data are only QString whereas my data are Contact)!
Thanks for your help....

jacek
8th March 2006, 22:08
Did you set the number of columns for QTreeWidget?

Jojo
10th March 2006, 12:47
Hello,

did you create your toplevel QTreeWidgetItem with the QTreeWidget as root (item = new QTreeWidgetItem (_treeWidget) ?