Results 1 to 2 of 2

Thread: Is delegate necessary here?

  1. #1
    Join Date
    Jun 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Is delegate necessary here?

    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.

  2. #2
    Join Date
    Apr 2010
    Posts
    34
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Is delegate necessary here?

    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

Similar Threads

  1. delegate and alternatigRowColors, how to?
    By martinn in forum Qt Programming
    Replies: 2
    Last Post: 2nd March 2010, 21:38
  2. Star Delegate Example
    By graciano in forum Qt Programming
    Replies: 5
    Last Post: 9th February 2010, 15:55
  3. QTreeView Delegate
    By ^NyAw^ in forum Qt Programming
    Replies: 3
    Last Post: 23rd June 2009, 09:10
  4. Delegate for a certain item?
    By somebody in forum Qt Programming
    Replies: 1
    Last Post: 18th August 2008, 22:55
  5. Delegate but when
    By uygar in forum Qt Programming
    Replies: 1
    Last Post: 12th October 2007, 20:28

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.