def StyledWidget_paintEvent(self, event):
 opt = QStyleOption()
 opt.initFrom(self)
 painter = QPainter(self)
 self.style().drawPrimitive(QStyle.PE_Widget, opt, painter, self)

def StyledWidget_paintEvent ( self , event ) : opt = QStyleOption ( ) opt . initFrom ( self ) painter = QPainter ( self ) self . style ( ) . drawPrimitive ( QStyle . PE_Widget , opt , painter , self )
a default styled qwidget subclass paintevent function .