summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-11-23 15:43:53 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-11-24 13:42:13 (GMT)
commitbd2a3643c9796cc938c40c4d340d8cc5346992f4 (patch)
treeffec6f6dcc2b64e9d7482e1b7a7f7e0e24a2421a
parentf31d0e45952276f3de9c049c84a0ea52ce370e7f (diff)
downloadQt-bd2a3643c9796cc938c40c4d340d8cc5346992f4.zip
Qt-bd2a3643c9796cc938c40c4d340d8cc5346992f4.tar.gz
Qt-bd2a3643c9796cc938c40c4d340d8cc5346992f4.tar.bz2
Mac: Fixes painting artifacts in Graphics View
Problem was that pending updates were not dispatched properly on the Mac, which is strongly required in order to get correct behavior wrt QGraphicsItem::update(). Task-number: QTBUG-4160 Reviewed-by: bnilsen
-rw-r--r--src/gui/graphicsview/qgraphicsview_p.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsview_p.h b/src/gui/graphicsview/qgraphicsview_p.h
index 762cad1..cd161ad 100644
--- a/src/gui/graphicsview/qgraphicsview_p.h
+++ b/src/gui/graphicsview/qgraphicsview_p.h
@@ -172,10 +172,17 @@ public:
inline void dispatchPendingUpdateRequests()
{
+#ifndef Q_WS_MAC
+ // QWidget::update() works slightly different on the Mac; it's not part of
+ // our backing store so it needs special threatment.
if (qt_widget_private(viewport)->paintOnScreen())
QCoreApplication::sendPostedEvents(viewport, QEvent::UpdateRequest);
else
QCoreApplication::sendPostedEvents(viewport->window(), QEvent::UpdateRequest);
+#else
+ QCoreApplication::processEvents(QEventLoop::AllEvents | QEventLoop::ExcludeSocketNotifiers
+ | QEventLoop::ExcludeUserInputEvents);
+#endif
}
bool updateRect(const QRect &rect);