PDA

View Full Version : Is delegate necessary here?



scythe
22nd June 2010, 01:19
Hi everyone,
I want to use QDirModel + QTreeView to achieve the following effect:
+Folder1
+Folder2
+Folder3
The folders have different paths, for exampe, C:\Folder1, D:\a\Folder2 and so on.
Should I use delegate here, or proxy QDirModel, or subclass QDirModel/QTreeView?
Please give me some hints, and necessary functons I sould override.
Thanks a lot for help.

Vit Stepanek
22nd June 2010, 19:59
Hi,
from the short look at the Qt Assistant, I'd use QSortFilterProxyModel, because it promises least work. If you're not sure what structure to use, just use the simplest one.
Subclass the QSortFilterProxyModel to provide the filtering you need, use the QDirModel (or rather QFileSystemModel due to a recommendation from the QtAssistant) as it's source model and that's all.

Hope I helped.
Vit