PDA

View Full Version : QTreeView and QDirmodel 's problem?



ggs0110
4th July 2007, 15:42
hello ,everyone!
I am new member in Qt programing,now, I have a problem with the QTreeView.
the question is:when I set the QTreeView's model with QDirmodel,then ,the program's speed is very slow and the harddisk has the "gege" noise,why?

thanks !

guilugi
4th July 2007, 16:01
Sample of code I could compile and test, maybe ?

I use this combination here with Qt 4.3, and it works fine:)

wysota
4th July 2007, 17:05
In Qt4.3 the dir model behaviour was changed - the directory scan has been delayed until the respective branch of the tree is accessed.

In older releases the initial slowdown is caused by the model subtree being built (all the directories are scanned).

ggs0110
11th July 2007, 08:21
thandks for your answer!
the Qt I am used is Qt4.2.3,and the OS is WindowsXP; According to your reply,how can I deal with the question?Can I set the directory path in QModel before the program run?So,it can reduce the scan time。
thanks a lot!

ggs0110
11th July 2007, 14:23
when I do this :

QDirmodel* dmodel=new QDirmodel;
dmodel->setreadonly(true);//If the paramenter is false ,then the speed is very slow.
then the program's speed is as fast as before;why? help me!

wysota
15th July 2007, 23:27
It could be that the model is asking the filesystem for read/write permissions and that it's kind of slow on your system. Do you need your model to be rewritable?

ggs0110
4th August 2007, 05:24
yes,I want to change the model? for example,change a file's name.:(

jpn
7th August 2007, 12:49
Have you given Qt 4.3 a try?

faribam777
31st July 2012, 13:11
i have this problem
any one cant't help me?