1) Add a call to self.update()
in your fun()
function to let Qt know that your widget needs to be redrawn
2) (Not totally sure on the python syntax, so I'll give the example in C++)
You can paint the background explicitly in your paint event:
qp.setBrush( Qt::white ); // Or whatever color you want the background to be
qp.drawRect( rect() );
or you can try messing with QWidget::setAutoFillBackground()