PDA

View Full Version : QFileSystemModel is sorting data which is hanging GUI



DKC
29th May 2019, 11:37
Hi,

I am working on a project where it uses QFilesystemModel with QTableView to display data present in network share. Recently we moved from Qt 4.8 to Qt 5.11.3. After moving to 5.11.3, we are facing performance issues with QFilesystemModel with around 1500-2000 entries in the network share. It is using QSortFilterProxyModel to sort and filter some entries.

The view is taking time in sorting the data. To avoid that, I removed the QSortFilterProxyModel from my code. But it is still sorting the data and taking time causing the GUI hang. I even disabled sorting in QTableView using setSortingEnabled(false) but with no use. I am not sure how the data is being sorted.

Is there anyway to improve performance with QFilesystemModel? How to disable sorting with QFilesystemModel/QTableView?

I am a little bit confused as I am a newbie to QT programming. Any help is much appreciated.

Thanks

ChristianEhrlicher
30th May 2019, 18:25
Since QFilesystemModel does not sort by itself the reason can't be the sorting but something else. Therefore I would suggest to create a small example and use a profiler like e.g. valgrind/callgrind to see where the cpu spend it's time.