Results 1 to 3 of 3

Thread: QDirModel/QTreeView performance under win32

  1. #1
    Join Date
    Apr 2008
    Posts
    104
    Thanks
    8
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QDirModel/QTreeView performance under win32

    Hello. I'm using Qt 4.4, QTreeView with QDirModel to show a files tree. On Linux it works fast. But on Windows XP SP2, the QTreeView filled with a root directory content (C, D, etc., and cdroms) are freezes at start, then shows me a tree in about a 1 or 1.5 minutes. Is that a normal behavior of QTreeView/QDirModel?
    Note 1: there are FAT32 and NFTS partitions.
    Note 2: can I disable the standart icons set QTreeView/QDirModel and does that affect the performance?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QDirModel/QTreeView performance under win32

    An improved version of QDirModel, namely QFileSystemModel was introduced in Qt 4.4.
    J-P Nurmi

  3. #3
    Join Date
    Apr 2008
    Posts
    104
    Thanks
    8
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDirModel/QTreeView performance under win32

    Thank you! But now I have a new problems When I changed the model to QFileSystemModel, I've found some strange things with my code (but all compiles well).
    Here is an actual code of the function that does navigate QTreeView/QFileSystemModel to the directory at the QString path parameter. mvl_model is QFileSystemModel, tv_fman is QTreeView:

    Qt Code:
    1. void rvln::fman_nav (const QString &path)
    2. {
    3. QModelIndex i = mvl_model->index(path);
    4. if (! i.isValid())
    5. return;
    6.  
    7. tv_fman->setCurrentIndex(i);
    8. tv_fman->setExpanded (i, true);
    9. tv_fman->scrollTo (i, QAbstractItemView::PositionAtTop);
    10. }
    To copy to clipboard, switch view to plain text mode 

    When I call tv_fman->setCurrentIndex, treeview selects the item. Thats normal. Then I call setExpanded - but it doesn't works. And scrollTo - the same thing, doesn't work.

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
  •  
Qt is a trademark of The Qt Company.