Results 1 to 4 of 4

Thread: QTreeWidget how to's

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2007
    Posts
    91
    Thanks
    21
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Question QTreeWidget how to's

    I'm starting to put together a tree control. I need to know if I can use the same pointer to allocate the tree nodes, or if I need to keep separate variables around for each tree node?

    Example:
    Qt Code:
    1. if (pConn)
    2. {
    3. while (pConn[i].name != NULL)
    4. {
    5. QTreeWidgetItem *subItem = new QTreeWidgetItem(m_pConnectionsItem, ITEM_CONNECTIONS);
    6. subItem->setText(pConn[i].name);
    7. i++;
    8. }
    9. }
    To copy to clipboard, switch view to plain text mode 

    Do I need separate subItems, one for each sub-item in the tree? What is the right way to do this? Does someone have some sample working code I could look at?
    - BRC
    Last edited by wysota; 6th March 2007 at 13:12. Reason: missing [code] tags

Similar Threads

  1. QTreeWidget drag/drop
    By s_a_white in forum Newbie
    Replies: 1
    Last Post: 10th February 2007, 22:04
  2. resizing a QTreeWidget
    By drhex in forum Qt Programming
    Replies: 6
    Last Post: 27th October 2006, 22:32
  3. QTreeWidget & QListWidget different selection
    By munna in forum Qt Programming
    Replies: 9
    Last Post: 21st July 2006, 06:50
  4. How to capture resizing of QTreeWidget columns?
    By simk in forum Qt Programming
    Replies: 2
    Last Post: 27th April 2006, 06:10
  5. few questions related to QTreeWidget
    By prakash in forum Qt Programming
    Replies: 9
    Last Post: 10th March 2006, 07:32

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
  •  
Qt is a trademark of The Qt Company.