From 06638a4c08aaf86d606abc59f642c3c34815e8e6 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 23 Feb 2010 10:21:02 +0100 Subject: Cocoa: Sheets loose their opacity on 2nd show It turns out that setParent_sys is wiping out opacity for the window regardless of what the value is from before. This patch does the correct thing, namely look at the WA_WState_WindowOpacitySet flag. Task-number: QTBUG-5100 Reviewed-by: cduclos --- src/gui/kernel/qwidget_mac.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 9e642b9..da9e9eb 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -2853,13 +2853,14 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) //recreate and setup flags QObjectPrivate::setParent_helper(parent); - QPoint pt = q->pos(); bool explicitlyHidden = q->testAttribute(Qt::WA_WState_Hidden) && q->testAttribute(Qt::WA_WState_ExplicitShowHide); if (wasCreated && !qt_isGenuineQWidget(q)) return; - if ((data.window_flags & Qt::Sheet) && topData && topData->opacity == 242) + if (!q->testAttribute(Qt::WA_WState_WindowOpacitySet)) { q->setWindowOpacity(1.0f); + q->setAttribute(Qt::WA_WState_WindowOpacitySet, false); + } setWinId(0); //do after the above because they may want the id -- cgit v0.12