A simple solution to a recurring Qt problem

27 views
Skip to first unread message

Edward K. Ream

unread,
Mar 4, 2020, 12:28:24 PM3/4/20
to leo-editor
I have finally discovered how to force Qt to update changed widgets immediately. Just call QApplication.processEvents(), that is, g.app.gui.qtApp.processEvents().

This is way better than queuing up an idle-time callback, which is pretty much guaranteed to cause screen flash. Btw, calling QWidget.update, etc. never seems to work.

I used this pattern first today in LeoQtBody.add_editor_command. I have just made similar changes to g.recursiveUNLSearch and QtIconBarClass.goto_command.

Edward
Reply all
Reply to author
Forward
0 new messages