mcostalba
13th January 2007, 12:49
Hi,
I use a QTreeWidget to show 'virtual' files and directories. It means not real files and directories on the file system, but a list of directories/files retrieved from an archive.
Because retrieving the list of files under a given directory it's a slow operation this is done only on request, i.e. when user clicks and expand on a given directory name.
Problem is that QTreeWidget shows as 'expandable' with the '+' sign only items that have already children. But directories are populated 'only' when expanded so I would like to set the expand '+' mark also on items without children.
This example to better clarify:
On startup QTreeWidget is populated with
-firstFile
-secondFile
-firstDirectory
firstDirectory has no childern at the moment. Only when user expands the directory then firstDirectory is populated. The problem is that firstDirectory is shown without the '+' mark so user cannot expand it, and directory will never be populated.
I use a QTreeWidget to show 'virtual' files and directories. It means not real files and directories on the file system, but a list of directories/files retrieved from an archive.
Because retrieving the list of files under a given directory it's a slow operation this is done only on request, i.e. when user clicks and expand on a given directory name.
Problem is that QTreeWidget shows as 'expandable' with the '+' sign only items that have already children. But directories are populated 'only' when expanded so I would like to set the expand '+' mark also on items without children.
This example to better clarify:
On startup QTreeWidget is populated with
-firstFile
-secondFile
-firstDirectory
firstDirectory has no childern at the moment. Only when user expands the directory then firstDirectory is populated. The problem is that firstDirectory is shown without the '+' mark so user cannot expand it, and directory will never be populated.