C++ (Qt)// ...public: WidgetAbout *widgetAbout;
C++ (Qt)// ...widgetAbout = new WidgetAbout;// ...
QLabel { color: red;}
QWidget.slide, WidgetAbout, WidgetAbout.slide, widgetAbout.slide, widgetAbout, Widget.slide { background-color: #fff;}
C++ (Qt)// ...widgetAbout = new WidgetAbout;widgetAbout->setStyleSheet("background:#fff;");// ...
C++ (Qt)void WidgetAbout::paintEvent(QPaintEvent *){ QStyleOption styleOption; styleOption.init(this); QPainter painter(this); style()->drawPrimitive(QStyle::PE_Widget, &styleOption, &painter, this);}
CSSWidgetAbout { background-color: #fff;}
C++ (Qt) void CustomWidget::paintEvent(QPaintEvent *) { QStyleOption opt; opt.init(this); QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); }
C++ (Qt)widget.setStyleSheet("background-color: red;");
C++ (Qt)app.setStyleSheet("CXTestClass { background-color: red; }");