Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/dialogs/qdialog.cpp

    r651 r769  
    7070#   include "qcolordialog.h"
    7171#   include "qwizard.h"
    72 #   include "qmenubar.h"
    7372#endif
    7473
     
    416415     }
    417416#else
    418     if ((e->type() == QEvent::StyleChange) || (e->type() == QEvent::Resize ))
    419         adjustPosition(parentWidget());
     417    if ((e->type() == QEvent::StyleChange) || (e->type() == QEvent::Resize )) {
     418        if (!testAttribute(Qt::WA_Moved)) {
     419            Qt::WindowStates state = windowState();
     420            adjustPosition(parentWidget());
     421            setAttribute(Qt::WA_Moved, false); // not really an explicit position
     422            if (state != windowState())
     423                setWindowState(state);
     424        }
     425    }
    420426#endif
    421427    return result;
     
    523529
    524530#ifdef Q_OS_SYMBIAN
    525 #ifndef QT_NO_MENUBAR
    526     QMenuBar *menuBar = 0;
    527     if (!findChild<QMenuBar *>())
    528         menuBar = new QMenuBar(this);
    529 #endif
    530 
    531531    if (qobject_cast<QFileDialog *>(this) || qobject_cast<QFontDialog *>(this) ||
    532532        qobject_cast<QColorDialog *>(this) || qobject_cast<QWizard *>(this))
     
    560560#endif //QT_NO_MENUBAR
    561561#endif //Q_WS_WINCE_WM
    562 #ifdef Q_OS_SYMBIAN
    563 #ifndef QT_NO_MENUBAR
    564     else if (menuBar)
    565         delete menuBar;
    566 #endif //QT_NO_MENUBAR
    567 #endif //Q_OS_SYMBIAN
    568 
    569562    return res;
    570563}
     
    808801{
    809802    if (!event->spontaneous() && !testAttribute(Qt::WA_Moved)) {
    810         Qt::WindowStates  state = windowState();
     803        Qt::WindowStates  state = windowState();
    811804        adjustPosition(parentWidget());
    812805        setAttribute(Qt::WA_Moved, false); // not really an explicit position
    813         if (state != windowState())
    814             setWindowState(state);
     806        if (state != windowState())
     807            setWindowState(state);
    815808    }
    816809}
     
    912905                cbaHeight = qt_TSize2QSize(bgContainer->Size()).height();
    913906            }
    914             p.setY(S60->screenHeightInPixels-height()-cbaHeight);
     907            p.setY(S60->screenHeightInPixels - height() - cbaHeight);
    915908            p.setX(0);
    916909        } else {
    917910            const int scrollbarWidth = style()->pixelMetric(QStyle::PM_ScrollBarExtent);
    918             TRect cbaRect = TRect();
    919             AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EControlPane, cbaRect);
    920             AknLayoutUtils::TAknCbaLocation cbaLocation = AknLayoutUtils::CbaLocation();
    921             switch (cbaLocation) {
    922             case AknLayoutUtils::EAknCbaLocationBottom:
    923                 p.setY(S60->screenHeightInPixels - height()-cbaRect.Height());
    924                 p.setX((S60->screenWidthInPixels - width())>>1);
    925                 break;
    926             case AknLayoutUtils::EAknCbaLocationRight:
    927                 p.setY((S60->screenHeightInPixels - height())>>1);
    928                 p.setX(qMax(0,S60->screenWidthInPixels-width()-scrollbarWidth-cbaRect.Width()));
    929                 break;
    930             case AknLayoutUtils::EAknCbaLocationLeft:
    931                 p.setY((S60->screenHeightInPixels - height())>>1);
    932                 p.setX(qMax(0,scrollbarWidth+cbaRect.Width()));
    933                 break;
     911            TRect staConTopRect = TRect();
     912            AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStaconTop, staConTopRect);
     913            if (staConTopRect.IsEmpty()) {
     914                TRect cbaRect = TRect();
     915                AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EControlPane, cbaRect);
     916                AknLayoutUtils::TAknCbaLocation cbaLocation = AknLayoutUtils::CbaLocation();
     917                switch (cbaLocation) {
     918                case AknLayoutUtils::EAknCbaLocationBottom:
     919                    p.setY(S60->screenHeightInPixels - height() - cbaRect.Height());
     920                    p.setX((S60->screenWidthInPixels - width()) >> 1);
     921                    break;
     922                case AknLayoutUtils::EAknCbaLocationRight:
     923                    p.setY((S60->screenHeightInPixels - height()) >> 1);
     924                    p.setX(qMax(0,S60->screenWidthInPixels - width() - scrollbarWidth - cbaRect.Width()));
     925                    break;
     926                case AknLayoutUtils::EAknCbaLocationLeft:
     927                    p.setY((S60->screenHeightInPixels - height()) >> 1);
     928                    p.setX(qMax(0,scrollbarWidth + cbaRect.Width()));
     929                    break;
     930                }
     931            } else {
     932                p.setY((S60->screenHeightInPixels - height()) >> 1);
     933                p.setX(qMax(0,S60->screenWidthInPixels - width()));
    934934            }
    935935        }
Note: See TracChangeset for help on using the changeset viewer.