Refreshing a QWidget

To update the widget, you should repaint() it, but calling repaint() directly is not very good, so try:

widget.update()

From doc:

This function does not cause an immediate repaint; instead it schedules a paint event for processing when Qt returns to the main event loop. This permits Qt to optimize for more speed and less flicker than a call to repaint() does.

Calling update() several times normally results in just one paintEvent() call.

Qt normally erases the widget's area before the paintEvent() call. If the Qt::WA_OpaquePaintEvent widget attribute is set, the widget is responsible for painting all its pixels with an opaque color.


Did you already try the QWidget.update()

This function updates only the visible parts keeping the invisible parts untouched.