From 2d0e06a495b5c5a723997eef9618fdd7a7bc98b1 Mon Sep 17 00:00:00 2001 From: Carlos Manuel Duclos Vergara Date: Tue, 2 Mar 2010 10:24:41 +0100 Subject: Carbon : Setting palette brush to a pixmap does not work. The problem occurs because we were drawing the pixmap and then clearing the buffer. This patch basically moves the clearing of the buffer to the start of the process instead of having it in the middle. Task-number: QTBUG-7800 Reviewed-by: Morten Sorvig --- src/gui/kernel/qwidget_mac.mm | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index f78596e..c7acf69 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -1268,6 +1268,11 @@ OSStatus QWidgetPrivate::qt_widget_event(EventHandlerCallRef er, EventRef event, if (widget->isVisible() && widget->updatesEnabled()) { //process the actual paint event. if(widget->testAttribute(Qt::WA_WState_InPaintEvent)) qWarning("QWidget::repaint: Recursive repaint detected"); + if (widget->isWindow() && !widget->d_func()->isOpaque + && !widget->testAttribute(Qt::WA_MacBrushedMetal)) { + QRect qrgnRect = qrgn.boundingRect(); + CGContextClearRect(cg, CGRectMake(qrgnRect.x(), qrgnRect.y(), qrgnRect.width(), qrgnRect.height())); + } QPoint redirectionOffset(0, 0); QWidget *tl = widget->window(); @@ -1318,13 +1323,6 @@ OSStatus QWidgetPrivate::qt_widget_event(EventHandlerCallRef er, EventRef event, widget->d_func()->restoreRedirected(); } - if (widget->isWindow() && !widget->d_func()->isOpaque - && !widget->testAttribute(Qt::WA_MacBrushedMetal)) { - QRect qrgnRect = qrgn.boundingRect(); - CGContextClearRect(cg, CGRectMake(qrgnRect.x(), qrgnRect.y(), qrgnRect.width(), qrgnRect.height())); - } - - if(!HIObjectIsOfClass((HIObjectRef)hiview, kObjectQWidget)) CallNextEventHandler(er, event); -- cgit v0.12