Doc: Fix member name in code snippet
QstyleOption has no init() member, only initFrom(). Fixes: QTBUG-107770 Pick-to: 6.5 6.4 6.2 5.15 Change-Id: I00ff0b980fbfac813f113a7052bd3df32c7912b6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
c889ffed9f
commit
d6bdc5e9b6
@ -51,7 +51,7 @@ qApp->setStyleSheet("ns--MyPushButton { background: yellow; }");
|
||||
void CustomWidget::paintEvent(QPaintEvent *)
|
||||
{
|
||||
QStyleOption opt;
|
||||
opt.init(this);
|
||||
opt.initFrom(this);
|
||||
QPainter p(this);
|
||||
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user