diff options
author | Gabriel de Dietrich <gabriel.dietrich-de@nokia.com> | 2010-04-19 17:13:20 (GMT) |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dietrich-de@nokia.com> | 2010-04-20 09:49:16 (GMT) |
commit | 434d2312b63090cfd2ba7e0f3728b5b225bcaeec (patch) | |
tree | 934dd144a1b99d1da4bbc07981a7ca9003640317 /src/gui/dialogs/qdialog.cpp | |
parent | 67ffe10585bc683cd160cef95fef55e8301a6ab5 (diff) | |
download | Qt-434d2312b63090cfd2ba7e0f3728b5b225bcaeec.zip Qt-434d2312b63090cfd2ba7e0f3728b5b225bcaeec.tar.gz Qt-434d2312b63090cfd2ba7e0f3728b5b225bcaeec.tar.bz2 |
QDialog: user-moved dialog would not show on the same place after hide
The Qt::WA_Moved was not being set during the move event as notified
by the window manager. This is a behavior change for 4.7, but we think
it's more user friendly than the previous behavior.
Reviewed-by: mbm
Task-number: QTBUG-9991
Diffstat (limited to 'src/gui/dialogs/qdialog.cpp')
-rw-r--r-- | src/gui/dialogs/qdialog.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp index a6bd78a..e4f45ba 100644 --- a/src/gui/dialogs/qdialog.cpp +++ b/src/gui/dialogs/qdialog.cpp @@ -393,7 +393,6 @@ void QDialogPrivate::resetModalitySetByOpen() resetModalityTo = -1; } -#if defined(Q_WS_WINCE) || defined(Q_WS_S60) #ifdef Q_WS_WINCE_WM void QDialogPrivate::_q_doneAction() { @@ -408,12 +407,12 @@ void QDialogPrivate::_q_doneAction() bool QDialog::event(QEvent *e) { bool result = QWidget::event(e); -#ifdef Q_WS_WINCE +#if defined(Q_WS_WINCE) if (e->type() == QEvent::OkRequest) { accept(); result = true; - } -#else + } else +#elif defined(Q_WS_S60) if ((e->type() == QEvent::StyleChange) || (e->type() == QEvent::Resize )) { if (!testAttribute(Qt::WA_Moved)) { Qt::WindowStates state = windowState(); @@ -422,11 +421,14 @@ bool QDialog::event(QEvent *e) if (state != windowState()) setWindowState(state); } - } + } else #endif + if (e->type() == QEvent::Move) { + setAttribute(Qt::WA_Moved, true); // as explicit as the user wants it to be + } + return result; } -#endif /*! Returns the modal dialog's result code, \c Accepted or \c Rejected. |