summaryrefslogtreecommitdiffstats
path: root/demos/gradients
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-05-06 19:09:50 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-05-07 09:33:12 (GMT)
commit85ccffc829fd0d5a29e84f90bcab460770ea8601 (patch)
treef1518021982528e7408c5164464d97a5846b4556 /demos/gradients
parente5233c4fd9a6f80ec5251cb847d08d7a088301a2 (diff)
downloadQt-85ccffc829fd0d5a29e84f90bcab460770ea8601.zip
Qt-85ccffc829fd0d5a29e84f90bcab460770ea8601.tar.gz
Qt-85ccffc829fd0d5a29e84f90bcab460770ea8601.tar.bz2
Fix crash with stylesheet if widget change style in the changeEvent
The problem appeared with KLineEdit and its proxy style. When setting a stylesheet, we create a QStyleSheetStyle in 9# and set it to the widget, which receive a changeEvent, that will set again the style so 3# will create a new QStyleSheetStyle with the new proxy. and set it. in 2# we will dereference the 'old' QStyleSheetStyle (the one created in #9) that will destroy it. Then, later in #7, we will still access that style ('newStyle') and we crash 0# QStyleSheetStyle::~QStyleSheetStyle() 1# QStyleSheetStyle::deref() 2# QWidgetPrivate::setStyle_helper(QStyle*, bool, bool) 3# QWidget::setStyle(QStyle*) (qwidget.cpp:2523) 4# ChangeEventWidget::changeEvent(QEvent*) [...] 6# QCoreApplication::sendEvent(QObject*, QEvent*) 7# QWidgetPrivate::setStyle_helper(QStyle*, bool, bool) 9# QWidget::setStyleSheet(QString const&) (qwidget.cpp:2470) The solution is to change the order, and do not use 'newstyle' after we sent the event. The origStyle is now protected wy a QWeakPointer, but this is just for safety reason and not related to the crash. Reviewed-by: JBache
Diffstat (limited to 'demos/gradients')
0 files changed, 0 insertions, 0 deletions