src/gui/graphicsview/qgraphicsview_p.h
changeset 23 89e065397ea6
parent 18 2f34d5167611
child 30 5dc02b23752f
--- a/src/gui/graphicsview/qgraphicsview_p.h	Fri May 14 16:40:13 2010 +0300
+++ b/src/gui/graphicsview/qgraphicsview_p.h	Thu May 27 13:40:48 2010 +0300
@@ -183,8 +183,12 @@
         else
             QCoreApplication::sendPostedEvents(viewport->window(), QEvent::UpdateRequest);
 #else
-        QCoreApplication::processEvents(QEventLoop::AllEvents | QEventLoop::ExcludeSocketNotifiers
-                                        | QEventLoop::ExcludeUserInputEvents);
+        // At this point either HIViewSetNeedsDisplay (Carbon) or setNeedsDisplay: YES (Cocoa)
+        // is called, which means there's a pending update request. We want to dispatch it
+        // now because otherwise graphics view updates would require two
+        // round-trips in the event loop before the item is painted.
+        extern void qt_mac_dispatchPendingUpdateRequests(QWidget *);
+        qt_mac_dispatchPendingUpdateRequests(viewport->window());
 #endif
     }