Applying StyleSheet to Custom Window
General and Desktop
11
Posts
4
Posters
9.6k
Views
1
Watching
-
-
-
[quote author="marcoB" date="1305200019"]why not in the constructor of TitiWidget put this ?
@
setStyleSheet(
"border: 2px solid green;"
"border-radius: 20px;"
"padding: 2px;"
"background-color: rgb(85, 85, 255);"
);@
[/quote]Because it all depends on how TitiWidget is implemented if this is going to work or not.
-
Thanks a lot for your answers.
The
@
void TitiWidget::paintEvent(QPaintEvent* /p_pEvent/)
{
QStyleOption opt;
opt.init(this);
QStylePainter p(this);
p.drawPrimitive(QStyle::PE_Widget, opt);
}
@trick works just fine. And it's actually in Qt's documentation. Shame on me.
Edit: please use code tags (@) before and after your code section; Andre