Results 1 to 3 of 3

Thread: QTreeWidget problem!!

  1. #1
    Join Date
    Mar 2006
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X

    Question QTreeWidget problem!!

    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....

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTreeWidget problem!!

    Did you set the number of columns for QTreeWidget?

  3. #3
    Join Date
    Feb 2006
    Posts
    24
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QTreeWidget problem!!

    Hello,

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

Similar Threads

  1. QTreeWidget double click - expand problem
    By stefan in forum Newbie
    Replies: 2
    Last Post: 29th June 2008, 13:24
  2. QTreeWidget + Persistent Editor problem
    By Stephen Yee in forum Qt Programming
    Replies: 0
    Last Post: 6th May 2008, 17:25
  3. QTreeWidget, resizing item and widgets problem
    By The Storm in forum Qt Programming
    Replies: 15
    Last Post: 17th March 2008, 21:20
  4. problem in QTreewidget
    By jyoti in forum Qt Programming
    Replies: 1
    Last Post: 28th November 2006, 11:04
  5. Problem with QTreeWidget after subclassing
    By steve918 in forum Qt Programming
    Replies: 2
    Last Post: 28th July 2006, 18:51

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.