From e45396f47ad04cc316f972140ac83c0de409be1b Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 7 Aug 2014 13:09:43 -0500 Subject: Automated update from Qt3 --- src/kernel/qstyle.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/kernel/qstyle.cpp b/src/kernel/qstyle.cpp index 8529305dd..9960e1d33 100644 --- a/src/kernel/qstyle.cpp +++ b/src/kernel/qstyle.cpp @@ -2355,12 +2355,21 @@ bool TQStyle::eventFilter(TQObject *o, TQEvent *e) { ControlElementFlags elementFlags = m_objectEventSourceFlagsToHandlerMap[o]; bool ret; TQWidget* w = dynamic_cast(o); - if ((w) && (e->type() == TQEvent::Paint)) { - TQPainter p(w); - TQPainter* activePainterOrig = ceData.activePainter; - const_cast(ceData).activePainter = &p; - ret = handler->objectEventHandler(ceData, elementFlags, o, e); - const_cast(ceData).activePainter = activePainterOrig; + if (w) { + // Update ceData as widget parameters may have changed + // If not done glitches may appear such as those present in Bug 1816 + populateControlElementDataFromWidget(w, TQStyleOption()); + const TQStyleControlElementData &widgetCEData = *(w->controlElementDataObject()); + if (e->type() == TQEvent::Paint) { + TQPainter p(w); + TQPainter* activePainterOrig = widgetCEData.activePainter; + const_cast(widgetCEData).activePainter = &p; + ret = handler->objectEventHandler(widgetCEData, elementFlags, o, e); + const_cast(widgetCEData).activePainter = activePainterOrig; + } + else { + ret = handler->objectEventHandler(widgetCEData, elementFlags, o, e); + } } else { ret = handler->objectEventHandler(ceData, elementFlags, o, e); -- cgit v1.2.1