PDA

View Full Version : QTreeView + QFileSystemModel = VERY slow on some Windows machines



agarny
21st February 2011, 11:57
Hi,

I have a QTreeView-based widget which I use to have some kind of a file browser within my application. Apart from a couple of initialisation problems (http://www.qtcentre.org/threads/38937-Best-Qt-strategy-for-loading-saving-user-settings-(esp.-for-QTreeView)), everything works I expect on Windows, Linux and Mac OS X, except for the fact that on my work machine, it takes several seconds for my QTreeView-based widget to initialise. I believe the problem might be related to QFileSystemModel taken for ever. In fact, I have experienced very long delays with Windows Explorer on Windows machine in the past (not on my current work computer though). Still, the user experience is really bad and I was therefore wondering whether anyone had ever experienced that before and, if so, whether they had found a solution to that problem?

Cheers, Alan.

agarny
21st February 2011, 18:35
I still don't have a solution to my problem, but the culprit is setRootPath() which I call as follows:
mFileSystemModel->setRootPath("");i.e. wanting access to the whole file system. If I disable that line, everything is fine. I am really starting to think that it's a pure Windows problem though...

I still don't have a solution to my problem, but the culprit is setRootPath() which I call as follows:
mFileSystemModel->setRootPath("");i.e. wanting access to the whole file system. If I disable that line, everything is fine. I am really starting to think that it's a pure Windows problem though...

Added after 51 minutes:

For what it is worth, I can now confirm that the problem was with Windows. There is a useful article about What to Do if Windows Explorer is Slow to Respond? (http://www.brighthub.com/computing/windows-platform/articles/86552.aspx) Personally, I followed their suggestion on page 2 under the Advanced Tweaks for a Windows Explorer Slow to Respond Problem section and now, after rebooting my work computer, everything is fine.