summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorten Sørvig <msorvig@trolltech.com>2009-06-26 15:26:15 (GMT)
committerMorten Sørvig <msorvig@trolltech.com>2009-06-26 15:26:15 (GMT)
commit8fae676fb0bd36f507ffa0815fa824370eb06a7c (patch)
treedfd42f141fd44d1ebfcdd7e3dc57c2b5b502e98f
parent2df18ac4dd17f8630f1ea0f6dc2415aca53d931a (diff)
downloadQt-8fae676fb0bd36f507ffa0815fa824370eb06a7c.zip
Qt-8fae676fb0bd36f507ffa0815fa824370eb06a7c.tar.gz
Qt-8fae676fb0bd36f507ffa0815fa824370eb06a7c.tar.bz2
Fix painting errors in QScrollArea on Mac (Carbon)
This is mainly a stop-gap solution for 4.5.x. It trades painting performance for correct painting. Commit 7988d05da changed the opaque test from q->testAttribute(Qt::WA_OpaquePaintEvent) to qt_widget_private(w)->isOpaque in qt_mac_update_widget_posisiton. This means we'll do optimized moves in more cases. Unfortunately it also causes painting errors in some cases (see the task). Revert the commit for now to put the 4.5 branch in a god shape. Task-number: 252295 Reviewed-by: nrc
-rw-r--r--src/gui/kernel/qwidget_mac.mm4
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp1
2 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index d2b059e..8f04b89 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -3749,7 +3749,7 @@ static void qt_mac_update_widget_posisiton(QWidget *q, QRect oldRect, QRect newR
// Perform a normal (complete repaint) update in some cases:
if (
// move-by-scroll requires QWidgetPrivate::isOpaque set
- (isMove && qd->isOpaque == false) ||
+ (isMove && q->testAttribute(Qt::WA_OpaquePaintEvent) == false) ||
// limited update on resize requires WA_StaticContents.
(isResize && q->testAttribute(Qt::WA_StaticContents) == false) ||
@@ -4273,7 +4273,7 @@ void QWidgetPrivate::scroll_sys(int dx, int dy, const QRect &r)
HIRect bounds = CGRectMake(w->data->crect.x(), w->data->crect.y(),
w->data->crect.width(), w->data->crect.height());
HIViewRef hiview = qt_mac_nativeview_for(w);
- const bool opaque = qt_widget_private(w)->isOpaque;
+ const bool opaque = q->testAttribute(Qt::WA_OpaquePaintEvent);
if (opaque)
HIViewSetDrawingEnabled(hiview, false);
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index e65fef1..7b68732 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -3964,6 +3964,7 @@ public:
:QWidget(parent)
{
setAttribute(Qt::WA_StaticContents);
+ setAttribute(Qt::WA_OpaquePaintEvent);
setPalette(Qt::red); // Make sure we have an opaque palette.
setAutoFillBackground(true);
gotPaintEvent = false;