src/gui/dialogs/qdialog.cpp
changeset 18 2f34d5167611
parent 0 1918ee327afb
child 19 fcece45ef507
equal deleted inserted replaced
3:41300fa6a67c 18:2f34d5167611
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     8 **
     8 **
   263 {
   263 {
   264 #ifdef Q_WS_WINCE
   264 #ifdef Q_WS_WINCE
   265     if (!qt_wince_is_smartphone())
   265     if (!qt_wince_is_smartphone())
   266         setWindowFlags(windowFlags() | Qt::WindowOkButtonHint | QFlag(qt_wince_is_mobile() ? 0 : Qt::WindowCancelButtonHint));
   266         setWindowFlags(windowFlags() | Qt::WindowOkButtonHint | QFlag(qt_wince_is_mobile() ? 0 : Qt::WindowCancelButtonHint));
   267 #endif
   267 #endif
       
   268 
       
   269 #ifdef Q_WS_S60
       
   270     if (S60->avkonComponentsSupportTransparency) {
       
   271         bool noSystemBackground = testAttribute(Qt::WA_NoSystemBackground);
       
   272         setAttribute(Qt::WA_TranslucentBackground); // also sets WA_NoSystemBackground
       
   273         setAttribute(Qt::WA_NoSystemBackground, noSystemBackground); // restore system background attribute
       
   274     }
       
   275 #endif
   268 }
   276 }
   269 
   277 
   270 #ifdef QT3_SUPPORT
   278 #ifdef QT3_SUPPORT
   271 /*!
   279 /*!
   272     \overload
   280     \overload
   291     : QWidget(dd, parent, f | QFlag((f & Qt::WindowType_Mask) == 0 ? Qt::Dialog : 0))
   299     : QWidget(dd, parent, f | QFlag((f & Qt::WindowType_Mask) == 0 ? Qt::Dialog : 0))
   292 {
   300 {
   293 #ifdef Q_WS_WINCE
   301 #ifdef Q_WS_WINCE
   294     if (!qt_wince_is_smartphone())
   302     if (!qt_wince_is_smartphone())
   295         setWindowFlags(windowFlags() | Qt::WindowOkButtonHint | QFlag(qt_wince_is_mobile() ? 0 : Qt::WindowCancelButtonHint));
   303         setWindowFlags(windowFlags() | Qt::WindowOkButtonHint | QFlag(qt_wince_is_mobile() ? 0 : Qt::WindowCancelButtonHint));
       
   304 #endif
       
   305 
       
   306 #ifdef Q_WS_S60
       
   307     if (S60->avkonComponentsSupportTransparency) {
       
   308         bool noSystemBackground = testAttribute(Qt::WA_NoSystemBackground);
       
   309         setAttribute(Qt::WA_TranslucentBackground); // also sets WA_NoSystemBackground
       
   310         setAttribute(Qt::WA_NoSystemBackground, noSystemBackground); // restore system background attribute
       
   311     }
   296 #endif
   312 #endif
   297 }
   313 }
   298 
   314 
   299 /*!
   315 /*!
   300   Destroys the QDialog, deleting all its children.
   316   Destroys the QDialog, deleting all its children.
   886     const int statusPaneHeight = (S60->screenHeightInPixels - mainAreaSize.height())>>1;
   902     const int statusPaneHeight = (S60->screenHeightInPixels - mainAreaSize.height())>>1;
   887     const bool doS60Positioning = !(isFullScreen()||isMaximized());
   903     const bool doS60Positioning = !(isFullScreen()||isMaximized());
   888     if (doS60Positioning) {
   904     if (doS60Positioning) {
   889         // naive way to deduce screen orientation
   905         // naive way to deduce screen orientation
   890         if (S60->screenHeightInPixels > S60->screenWidthInPixels) {
   906         if (S60->screenHeightInPixels > S60->screenWidthInPixels) {
   891             p.setY(S60->screenHeightInPixels-height()-qt_TSize2QSize(S60->buttonGroupContainer()->Size()).height());
   907             int cbaHeight;
       
   908             const CEikButtonGroupContainer* bgContainer = S60->buttonGroupContainer();
       
   909             if (!bgContainer) {
       
   910                 cbaHeight = 0;
       
   911             } else {
       
   912                 cbaHeight = qt_TSize2QSize(bgContainer->Size()).height();
       
   913             }
       
   914             p.setY(S60->screenHeightInPixels-height()-cbaHeight);
   892             p.setX(0);
   915             p.setX(0);
   893         } else {
   916         } else {
   894             const int scrollbarWidth = style()->pixelMetric(QStyle::PM_ScrollBarExtent);
   917             const int scrollbarWidth = style()->pixelMetric(QStyle::PM_ScrollBarExtent);
   895             TRect cbaRect = TRect();
   918             TRect cbaRect = TRect();
   896             AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EControlPane, cbaRect);
   919             AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EControlPane, cbaRect);