QProxyStyle: fix the base style assignment in constructor

Assign the baseStyle member before calling setParent(), because that
will trigger ParentChange event and thus calls ensureBaseStyle(). The
baseStyle member must be set at that point, because otherwise it will
start creating a fallback base style.

Change-Id: I3522e41bb6b82e3fe2e7790d53a53978c18a027a
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
bb10
J-P Nurmi 2012-11-20 14:55:20 +01:00 committed by The Qt Project
parent f439108c4f
commit 4532a1399e
1 changed files with 1 additions and 1 deletions

View File

@ -120,9 +120,9 @@ QProxyStyle::QProxyStyle(QStyle *style) :
{
Q_D(QProxyStyle);
if (style) {
d->baseStyle = style;
style->setProxy(this);
style->setParent(this); // Take ownership
d->baseStyle = style;
}
}