src/gui/dialogs/qdialog.cpp
changeset 18 2f34d5167611
parent 0 1918ee327afb
child 19 fcece45ef507
--- a/src/gui/dialogs/qdialog.cpp	Tue Feb 02 00:43:10 2010 +0200
+++ b/src/gui/dialogs/qdialog.cpp	Fri Apr 16 15:50:13 2010 +0300
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
@@ -265,6 +265,14 @@
     if (!qt_wince_is_smartphone())
         setWindowFlags(windowFlags() | Qt::WindowOkButtonHint | QFlag(qt_wince_is_mobile() ? 0 : Qt::WindowCancelButtonHint));
 #endif
+
+#ifdef Q_WS_S60
+    if (S60->avkonComponentsSupportTransparency) {
+        bool noSystemBackground = testAttribute(Qt::WA_NoSystemBackground);
+        setAttribute(Qt::WA_TranslucentBackground); // also sets WA_NoSystemBackground
+        setAttribute(Qt::WA_NoSystemBackground, noSystemBackground); // restore system background attribute
+    }
+#endif
 }
 
 #ifdef QT3_SUPPORT
@@ -294,6 +302,14 @@
     if (!qt_wince_is_smartphone())
         setWindowFlags(windowFlags() | Qt::WindowOkButtonHint | QFlag(qt_wince_is_mobile() ? 0 : Qt::WindowCancelButtonHint));
 #endif
+
+#ifdef Q_WS_S60
+    if (S60->avkonComponentsSupportTransparency) {
+        bool noSystemBackground = testAttribute(Qt::WA_NoSystemBackground);
+        setAttribute(Qt::WA_TranslucentBackground); // also sets WA_NoSystemBackground
+        setAttribute(Qt::WA_NoSystemBackground, noSystemBackground); // restore system background attribute
+    }
+#endif
 }
 
 /*!
@@ -888,7 +904,14 @@
     if (doS60Positioning) {
         // naive way to deduce screen orientation
         if (S60->screenHeightInPixels > S60->screenWidthInPixels) {
-            p.setY(S60->screenHeightInPixels-height()-qt_TSize2QSize(S60->buttonGroupContainer()->Size()).height());
+            int cbaHeight;
+            const CEikButtonGroupContainer* bgContainer = S60->buttonGroupContainer();
+            if (!bgContainer) {
+                cbaHeight = 0;
+            } else {
+                cbaHeight = qt_TSize2QSize(bgContainer->Size()).height();
+            }
+            p.setY(S60->screenHeightInPixels-height()-cbaHeight);
             p.setX(0);
         } else {
             const int scrollbarWidth = style()->pixelMetric(QStyle::PM_ScrollBarExtent);