diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2010-02-23 09:21:02 (GMT) |
---|---|---|
committer | Samuli Piippo <samuli.piippo@digia.com> | 2011-06-09 10:04:56 (GMT) |
commit | 880eec22c0269ae0c0433014025c60800eb8cf50 (patch) | |
tree | 8c904c28f3c20b827fdb761bf2ed2569d79c710d | |
parent | d9ec38f8dc238bf1b624458318e7492579ce9033 (diff) | |
download | Qt-880eec22c0269ae0c0433014025c60800eb8cf50.zip Qt-880eec22c0269ae0c0433014025c60800eb8cf50.tar.gz Qt-880eec22c0269ae0c0433014025c60800eb8cf50.tar.bz2 |
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
(cherry picked from commit 06638a4c08aaf86d606abc59f642c3c34815e8e6)
-rw-r--r-- | src/gui/kernel/qwidget_mac.mm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index d568ccf..70f3d94 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -2780,13 +2780,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 |