最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

qt - Indicate QTreeView is Busy Expanding Node - Stack Overflow

programmeradmin2浏览0评论

I'm using a QTreeView to display a directory tree rooted at an SSHFS mount. This works well, but if I expand a node containing ~150 files or more there is a significant delay between clicking the '>' expand arrow and having the node visually expand, on the order of several seconds. This only occurs the first time the node is expanded; thereafter it opens immediately.

I would like to simply change to a busy cursor when the expand button is clicked, then switch back to normal when expansion is complete.

I have tried extending QTreeView and overriding the expand() slot, calling the QTreeView expand function between calls to change the cursor appearance, but this slot never gets called when manipulating the view. Connecting to the expanded signal seems to trigger immediately when the '>' icon is clicked, but there is no signal I've found that indicates when the expansion has completed.

How can I do this? The view does nothing on the first expansion for several seconds, which is disconcerting to the user. I just want some indication that the view is still working, just cogitating for a few moments.

发布评论

评论列表(0)

  1. 暂无评论