QFrame paintEvent() and StyleSheet
I'm trying to understand how the QStyleSheetStyle works for QFrame.
I create a class call TestFrame
class TestFrame : public QFrame
explicit TestFrame( QWidget* parent = 0 )
void paintEvent(QPaintEvent * e)
I apply a stylesheet to the application.
If I compile this code and run it, I can get the result shown in the First Pic.
If I comment out the line "QFrame::paintEvent(e);", then I get the result shown in the Second Pic.
I check the implementation both of QStyleSheetStyle and QFrame, and find out that QFrame::paintEvent() only deal with the border(QFrame::StyledPanel things)
My question is how does QFrame manager to draw its background (specified in the CSS) outside the paintEvent()?
Ok, I find it out myself. Qt uses QWidgetPrivate to draw the background.