summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget.cpp
diff options
context:
space:
mode:
authorFabien Freling <fabien.freling@nokia.com>2011-03-15 13:48:49 (GMT)
committerFabien Freling <fabien.freling@nokia.com>2011-03-15 13:48:49 (GMT)
commitd524e983c60ba59f3c65d811ec92f02c97d1a8ab (patch)
tree6157eb8a3f3123c5dbebbc07591da81653f3331a /src/gui/kernel/qwidget.cpp
parent2b9e7bcede5ca6ba9de2534839244cc621f17e1c (diff)
downloadQt-d524e983c60ba59f3c65d811ec92f02c97d1a8ab.zip
Qt-d524e983c60ba59f3c65d811ec92f02c97d1a8ab.tar.gz
Qt-d524e983c60ba59f3c65d811ec92f02c97d1a8ab.tar.bz2
Change the way the unified toolbar is flushed.
The flushing of the unified toolbar is no longer tied to the main window, making it more flexible. Task-number: QTBUG-17754 Reviewed-by: Richard Moe Gustavsen
Diffstat (limited to 'src/gui/kernel/qwidget.cpp')
-rw-r--r--src/gui/kernel/qwidget.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 5fc9951..198d4e5 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -1367,6 +1367,16 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
QApplication::postEvent(q, new QEvent(QEvent::PolishRequest));
extraPaintEngine = 0;
+
+#ifdef QT_MAC_USE_COCOA
+ // If we add a child to the unified toolbar, we have to redirect the painting.
+ if (parentWidget && parentWidget->d_func() && parentWidget->d_func()->isInUnifiedToolbar) {
+ if (parentWidget->d_func()->unifiedSurface) {
+ QWidget *toolbar = parentWidget->d_func()->toolbar_ancestor;
+ parentWidget->d_func()->unifiedSurface->recursiveRedirect(toolbar, toolbar, toolbar->d_func()->toolbar_offset);
+ }
+ }
+#endif // QT_MAC_USE_COCOA
}
@@ -10478,7 +10488,7 @@ void QWidget::update(const QRect &rect)
if (hasBackingStoreSupport()) {
#ifdef QT_MAC_USE_COCOA
if (qt_widget_private(this)->isInUnifiedToolbar) {
- qt_widget_private(this)->unifiedSurface->renderToolbar(this);
+ qt_widget_private(this)->unifiedSurface->renderToolbar(this, true);
return;
}
#endif // QT_MAC_USE_COCOA
@@ -10508,7 +10518,7 @@ void QWidget::update(const QRegion &rgn)
if (hasBackingStoreSupport()) {
#ifdef QT_MAC_USE_COCOA
if (qt_widget_private(this)->isInUnifiedToolbar) {
- qt_widget_private(this)->unifiedSurface->renderToolbar(this);
+ qt_widget_private(this)->unifiedSurface->renderToolbar(this, true);
return;
}
#endif // QT_MAC_USE_COCOA