Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
5.15.6, 5.15.7
-
None
Description
In my application there is a file management feature. I use QFileSytemModel to map filesystem from windows, and QListView to display it on UI.
when copy 1000 elements(200 folders + 800 files) from one folder to another folder, there will be a big performance issue on QFileSytemModel. As long as one path is watched, even i do copy past on windows on this path, UI still get freezed. Thounds of _q_directoryChanged are queued for executing and block the whole application.
i think the root cause are:
1. QFileInfoGatherer running on a separate thread, _q_directoryChanged running on main thread. they are connected in the following way:q->connect(&fileInfoGatherer, SIGNAL(updates(QString,QVector<QPair<QString,QFileInfo> >)),
q, SLOT(_q_fileSystemChanged(QString,QVector<QPair<QString,QFileInfo> >)));
During the _q_directoryChanged excuting, it will block the ui.
2. the updates signal was emit too frequent than expected during copy. QFileInfoGatherer::getFileInfos executes around every 200ms, but each time it may emit several updates signal