summaryrefslogtreecommitdiffstats
path: root/src/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/qstyle.cpp21
1 files changed, 15 insertions, 6 deletions
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<TQWidget*>(o);
- if ((w) && (e->type() == TQEvent::Paint)) {
- TQPainter p(w);
- TQPainter* activePainterOrig = ceData.activePainter;
- const_cast<TQStyleControlElementData&>(ceData).activePainter = &p;
- ret = handler->objectEventHandler(ceData, elementFlags, o, e);
- const_cast<TQStyleControlElementData&>(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<TQStyleControlElementData&>(widgetCEData).activePainter = &p;
+ ret = handler->objectEventHandler(widgetCEData, elementFlags, o, e);
+ const_cast<TQStyleControlElementData&>(widgetCEData).activePainter = activePainterOrig;
+ }
+ else {
+ ret = handler->objectEventHandler(widgetCEData, elementFlags, o, e);
+ }
}
else {
ret = handler->objectEventHandler(ceData, elementFlags, o, e);