summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-02-23 09:21:02 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-02-23 09:31:51 (GMT)
commit06638a4c08aaf86d606abc59f642c3c34815e8e6 (patch)
treec0fae61ecc15bc999716b72734f12b6010bf1825
parentd1592b1d4f6f0ea0d180e6848af42b3692e7490a (diff)
downloadQt-06638a4c08aaf86d606abc59f642c3c34815e8e6.zip
Qt-06638a4c08aaf86d606abc59f642c3c34815e8e6.tar.gz
Qt-06638a4c08aaf86d606abc59f642c3c34815e8e6.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
-rw-r--r--src/gui/kernel/qwidget_mac.mm5
1 files 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