-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问QTreeWidgetItem::setText()调用后如何实时刷新界面. #3
Comments
理論上 QTreeWidgetItem::setText(int column, const QString &text) 之後應該不需要刷新。 可以試試 QTreeWidget的update函數
|
很可能是你的顯卡問題,你在什麽系統上做應用? |
我的环境是 Win10 , Qt 5.14. 我猜测是QT为了效率, 并不会立即绘制Item。 因为我发现,在Tree里面新插入一项,整个 Tree会立即刷新, 但是setText并不会。 update函数我尝试过, 但并没有效果。 |
https://youtu.be/c8ZZ6h8rbtE |
使用dataChanged(QModelIndex(), QModelIndex()); |
我在调用QTreeWidgetItem::setText()之后,控件的内容并不会立即刷新内容,而是在我鼠标划过之后才会刷新。
The text was updated successfully, but these errors were encountered: