summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_mac.mm
diff options
context:
space:
mode:
authorFabien Freling <fabien.freling@nokia.com>2011-05-11 11:30:35 (GMT)
committerFabien Freling <fabien.freling@nokia.com>2011-05-11 12:07:07 (GMT)
commit360c5f2c39a39c2a8296f21e6f5f577367610853 (patch)
tree5839e1c7a09c3757a917ef77233c82ab3fcbd112 /src/gui/kernel/qwidget_mac.mm
parenta368c351928a95d21663bbd0404f887cc3cf7974 (diff)
downloadQt-360c5f2c39a39c2a8296f21e6f5f577367610853.zip
Qt-360c5f2c39a39c2a8296f21e6f5f577367610853.tar.gz
Qt-360c5f2c39a39c2a8296f21e6f5f577367610853.tar.bz2
Move the painting redirection to the unified toolbar surface.
If the new parent of a widget is inside the unified toolbar, we need to update the redirection. Task-number: QTBUG-18150 Reviewed-by: Samuel Rødal
Diffstat (limited to 'src/gui/kernel/qwidget_mac.mm')
-rw-r--r--src/gui/kernel/qwidget_mac.mm10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 27a1bb6..468de22 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -3032,6 +3032,16 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
q->setAttribute(Qt::WA_WState_Hidden);
q->setAttribute(Qt::WA_WState_ExplicitShowHide, explicitlyHidden);
+#ifdef QT_MAC_USE_COCOA
+ // If we add a child to the unified toolbar, we have to redirect the painting.
+ if (parent && parent->d_func() && parent->d_func()->isInUnifiedToolbar) {
+ if (parent->d_func()->unifiedSurface) {
+ QWidget *toolbar = parent->d_func()->toolbar_ancestor;
+ parent->d_func()->unifiedSurface->recursiveRedirect(toolbar, toolbar, toolbar->d_func()->toolbar_offset);
+ }
+ }
+#endif // QT_MAC_USE_COCOA
+
if (wasCreated) {
transferChildren();
#ifndef QT_MAC_USE_COCOA