src/gui/dialogs/qdialog.cpp
changeset 19 fcece45ef507
parent 18 2f34d5167611
child 22 79de32ba3296
--- a/src/gui/dialogs/qdialog.cpp	Fri Apr 16 15:50:13 2010 +0300
+++ b/src/gui/dialogs/qdialog.cpp	Mon May 03 13:17:34 2010 +0300
@@ -69,7 +69,6 @@
 #   include "qfontdialog.h"
 #   include "qcolordialog.h"
 #   include "qwizard.h"
-#   include "qmenubar.h"
 #endif
 
 #if defined(Q_WS_S60)
@@ -415,8 +414,15 @@
         result = true;
      }
 #else
-    if ((e->type() == QEvent::StyleChange) || (e->type() == QEvent::Resize ))
-        adjustPosition(parentWidget());
+    if ((e->type() == QEvent::StyleChange) || (e->type() == QEvent::Resize )) {
+        if (!testAttribute(Qt::WA_Moved)) {
+            Qt::WindowStates state = windowState();
+            adjustPosition(parentWidget());
+            setAttribute(Qt::WA_Moved, false); // not really an explicit position
+            if (state != windowState())
+                setWindowState(state);
+        }
+    }
 #endif
     return result;
 }
@@ -522,12 +528,6 @@
 #endif //Q_WS_WINCE_WM
 
 #ifdef Q_OS_SYMBIAN
-#ifndef QT_NO_MENUBAR
-    QMenuBar *menuBar = 0;
-    if (!findChild<QMenuBar *>())
-        menuBar = new QMenuBar(this);
-#endif
-
     if (qobject_cast<QFileDialog *>(this) || qobject_cast<QFontDialog *>(this) ||
         qobject_cast<QColorDialog *>(this) || qobject_cast<QWizard *>(this))
         showMaximized();
@@ -559,13 +559,6 @@
         delete menuBar;
 #endif //QT_NO_MENUBAR
 #endif //Q_WS_WINCE_WM
-#ifdef Q_OS_SYMBIAN
-#ifndef QT_NO_MENUBAR
-    else if (menuBar)
-        delete menuBar;
-#endif //QT_NO_MENUBAR
-#endif //Q_OS_SYMBIAN
-
     return res;
 }
 
@@ -807,11 +800,11 @@
 void QDialog::showEvent(QShowEvent *event)
 {
     if (!event->spontaneous() && !testAttribute(Qt::WA_Moved)) {
-	Qt::WindowStates  state = windowState();
+        Qt::WindowStates  state = windowState();
         adjustPosition(parentWidget());
         setAttribute(Qt::WA_Moved, false); // not really an explicit position
-	if (state != windowState())
-	    setWindowState(state);
+        if (state != windowState())
+            setWindowState(state);
     }
 }