diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-07-24 10:10:21 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-07-24 12:54:06 (GMT) |
commit | 42c8c59a7be5e1906de09b6a007b868c897ab9e1 (patch) | |
tree | 5dc9b43fb2a7c4672c3c691b7880ca626e3176d6 /src/gui/kernel/qwidget.cpp | |
parent | f90aba898074dbd1edc07112b63b8816bbc5855c (diff) | |
download | Qt-42c8c59a7be5e1906de09b6a007b868c897ab9e1.zip Qt-42c8c59a7be5e1906de09b6a007b868c897ab9e1.tar.gz Qt-42c8c59a7be5e1906de09b6a007b868c897ab9e1.tar.bz2 |
Prematurely creating a dialog as a sheet causes problems
Prematurely creating a dialog as a sheet and then calling
exec() on it will show a window w/o decorations. The problem is
that first telling a window to be a sheet, and then tell it to
exec, is unambigious. Because doing the latter implies application
modality (when modality is not set), which again implies not
using a sheet. Calling exec (and setting modality) will win over
window flags, so in this case, we now recreate the window as a
normal app-modal dialog.
Task: 254524
Reviewed-by: Trenton Schulz
Diffstat (limited to 'src/gui/kernel/qwidget.cpp')
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index fb9084e..1e0f09c 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -9801,6 +9801,10 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) data->window_modality = (w && w->testAttribute(Qt::WA_GroupLeader)) ? Qt::WindowModal : Qt::ApplicationModal; + // Some window managers does not allow us to enter modal after the + // window is showing. Therefore, to be consistent, we cannot call + // QApplicationPrivate::enterModal(this) here. The window must be + // hidden before changing modality. } if (testAttribute(Qt::WA_WState_Created)) { // don't call setModal_sys() before create_sys() |