QT: QFileSystemModel _q_fileSystemChanged slot is executed on the UI thread which contradicts docume

来源:互联网 发布:英国那些事儿知乎 编辑:程序博客网 时间:2024/05/06 08:08

http://stackoverflow.com/questions/4055726/qt-qfilesystemmodel-q-filesystemchanged-slot-is-executed-on-the-ui-thread-whic

QFileIconProvider uses QIcon to represent icons and QIcon can only be used in the UI thread. QImage seems to be the only class allowed to use in other threads, but I think it may be to expensive to use QImage in the background thread and convert it to an QIcon in the UI thread.

So it is possible that the platform implementation of QFileIconProvider is slow on network paths under some circumstances and therefore slows down the UI main thread.

I don't know if this is the source of your problem, but at least this should be the reason why _q_fileSystemChanged() is called within the UI thread.

0 0
原创粉丝点击