PDA

View Full Version : QTreeWidget



merry
25th September 2007, 14:49
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

wysota
25th September 2007, 15:03
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).