I've been having this issue a lot of times.
When I modify some properties of a QWidget
after the widget.show()
, the widget won't update. Most of the time, a mouse click or when the mouse leaves or enters the widget, the widget will be updated. However, if I leave the mouse, it won't refresh by itself.
Until now I managed to deal with this by doing :
widget.hide()
widget.show()
But this is a very dirty fix. Is there a better way to tell python
to refresh the widget ?
Thank you.
To update the widget, you should
repaint()
it, but callingrepaint()
directly is not very good, so try:From doc: