Details
-
Type:
Bug
-
Status: Closed
-
Priority:
P3: Somewhat important
-
Resolution: Done
-
Affects Version/s: 5.15, 6.0, 6.1, 6.2, 6.x
-
Fix Version/s: 6.1.3, 6.2.0 Beta3, 6.3.0 Alpha
-
Component/s: Core: Item Models
-
Labels:None
-
Platform/s:
-
Commits:07057188e3e42246cf006b43963d0bdcdaa159f5 (qt/qtbase/dev) 91db96f3366cb5ebe5846ac69b593acc4830d2c9 (qt/qtbase/6.2) bc904c8524d9d230de3b634024548d3abdbca843 (qt/qtbase/6.1)
Description
Hello,
Consider the function
bool QFileSystemModelPrivate::filtersAcceptsNode(const QFileSystemNode *node) const
which is called for every child in sortChildren:
https://github.com/qt/qtbase/blob/dev/src/gui/itemmodels/qfilesystemmodel.cpp#L2158
It will call most of the time
bool QFileSystemModelPrivate::passNameFilters(const QFileSystemNode *node) const
which, for every wildcard name filter given to the model, constructs a QRegularExpression, and compiles it !
https://github.com/qt/qtbase/blob/dev/src/gui/itemmodels/qfilesystemmodel.cpp#L2158
In my use case I have a fair amount of wildcards, coming from plug-ins to my software which make some file extensions visible or not in a QFSModel. When sorting a hundred files, this blocks the software for 4/5 seconds every time.