{
public:
{}
};
int main(int argc, char *argv[])
{
QString css
= "background-color: #ffA500; border: 5px solid #FF0000;";
MyWidget b;
b.setAutoFillBackground(true);
b.setStyleSheet(css);
b.show();
return app.exec();
}
class MyWidget : public QWidget
{
public:
MyWidget(QWidget *parent = 0): QWidget(parent)
{}
};
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QString css = "background-color: #ffA500; border: 5px solid #FF0000;";
MyWidget b;
b.setAutoFillBackground(true);
b.setStyleSheet(css);
b.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Works for me. If you have your own paint event use something like
{
QWidget::paintEvent(e
);
// draws the background etc. //or use
//to draw your needed elements.
}
void paintEvent(QPaintEvent *e)
{
QWidget::paintEvent(e); // draws the background etc.
//or use
QStylePainter p(this);
//to draw your needed elements.
}
To copy to clipboard, switch view to plain text mode
Bookmarks