Results 1 to 2 of 2

Thread: QTreeWidget

  1. #1
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default QTreeWidget

    Hi all

    Working on Qt4.1 on Intel Mac

    My Problem is this :

    I am inserting root folders in the treeWidget and each root folder contains its sub files and folders.

    what i want is this when i double click on any of the treeWidgetItem , the treewidget shows only its sub folders and files , and clear all other contents.

    On double Click of the treeWidgetItem , I got all its contents but for to view its contents only when I make the QTreeWidget->clear() , My Program crashes. What Can I do?

    Pls help

    Thanx
    Always Believe in Urself
    Merry

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTreeWidget

    Quote Originally Posted by merry View Post
    Working on Qt4.1 on Intel Mac
    Please update your profile to reflect that. You won't have to mention the version in each thread then and it'll be easier for us to spot the information.

    what i want is this when i double click on any of the treeWidgetItem , the treewidget shows only its sub folders and files , and clear all other contents.

    On double Click of the treeWidgetItem , I got all its contents but for to view its contents only when I make the QTreeWidget->clear() , My Program crashes. What Can I do?
    I'd use QTreeView and QDirModel instead of QTreeWidget and QAbstractItemView::setRootIndex() to tell the view what part of the model it should display (the latter applies even if you stick with convenience classes, but I'd suggest switching to the model-view approach).

Similar Threads

  1. how to add icons to QTreeWidget?
    By wei243 in forum Qt Programming
    Replies: 4
    Last Post: 21st September 2007, 08:34
  2. QTreeWidget drag/drop
    By s_a_white in forum Newbie
    Replies: 1
    Last Post: 10th February 2007, 22:04
  3. resizing a QTreeWidget
    By drhex in forum Qt Programming
    Replies: 6
    Last Post: 27th October 2006, 22:32
  4. QTreeWidget problem!!
    By mcenatie in forum Qt Programming
    Replies: 2
    Last Post: 10th March 2006, 11:47
  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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.