summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/global/qnamespace.h1
-rw-r--r--src/corelib/global/qnamespace.qdoc3
-rw-r--r--src/widgets/kernel/qapplication.cpp35
-rw-r--r--src/widgets/kernel/qwidget.cpp16
-rw-r--r--tests/manual/windowmodality/main.cpp6
-rw-r--r--tests/manual/windowmodality/widget.ui7
6 files changed, 6 insertions, 62 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index d19f50512a..157928c958 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -359,7 +359,6 @@ namespace Qt {
WA_ShowModal = 70, // ## deprecated since since 4.5.1 but still in use :-(
WA_MouseNoMask = 71,
- WA_GroupLeader = 72, // ## deprecated since since 4.5.1 but still in use :-(
WA_NoMousePropagation = 73, // for now, might go away.
WA_Hover = 74,
WA_InputMethodTransparent = 75, // Don't reset IM when user clicks on this (for virtual keyboards on embedded)
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 082a21bc92..fae3afddc1 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -946,9 +946,6 @@
This implies WA_UpdatesDisabled. This is set/cleared by
QWidget::setUpdatesEnabled().
- \value WA_GroupLeader \e{This attribute has been deprecated.} Use
- QWidget::windowModality instead.
-
\value WA_Hover Forces Qt to generate paint events when the mouse
enters or leaves the widget. This feature is typically used when
implementing custom styles; see the \l{widgets/styles}{Styles}
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index ed6414b16f..7d10e700e9 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -2184,46 +2184,19 @@ bool QApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blockingWin
}
Qt::WindowModality windowModality = modalWindow->modality();
- QWidgetWindow *modalWidgetWindow = qobject_cast<QWidgetWindow *>(modalWindow);
if (windowModality == Qt::NonModal) {
- // determine the modality type if it hasn't been set on the
- // modalWindow's widget, this normally happens when waiting for a
- // native dialog. use WindowModal if we are the child of a group
- // leader; otherwise use ApplicationModal.
- QWidget *m = modalWidgetWindow ? modalWidgetWindow->widget() : nullptr;
- while (m && !m->testAttribute(Qt::WA_GroupLeader)) {
- m = m->parentWidget();
- if (m)
- m = m->window();
- }
- windowModality = (m && m->testAttribute(Qt::WA_GroupLeader))
- ? Qt::WindowModal
- : Qt::ApplicationModal;
+ // If modality type hasn't been set on the modalWindow's widget, as
+ // when waiting for a native dialog, use ApplicationModal.
+ windowModality = Qt::ApplicationModal;
}
switch (windowModality) {
case Qt::ApplicationModal:
- {
- QWidgetWindow *widgetWindow = qobject_cast<QWidgetWindow *>(window);
- QWidget *groupLeaderForWidget = widgetWindow ? widgetWindow->widget() : nullptr;
- while (groupLeaderForWidget && !groupLeaderForWidget->testAttribute(Qt::WA_GroupLeader))
- groupLeaderForWidget = groupLeaderForWidget->parentWidget();
-
- if (groupLeaderForWidget) {
- // if \a widget has WA_GroupLeader, it can only be blocked by ApplicationModal children
- QWidget *m = modalWidgetWindow ? modalWidgetWindow->widget() : nullptr;
- while (m && m != groupLeaderForWidget && !m->testAttribute(Qt::WA_GroupLeader))
- m = m->parentWidget();
- if (m == groupLeaderForWidget) {
- *blockingWindow = m->windowHandle();
- return true;
- }
- } else if (modalWindow != window) {
+ if (modalWindow != window) {
*blockingWindow = modalWindow;
return true;
}
break;
- }
case Qt::WindowModal:
{
QWindow *w = window;
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 4bcc0f5df0..183d47b5b2 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -10953,21 +10953,9 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
// reset modality type to NonModal when clearing WA_ShowModal
data->window_modality = Qt::NonModal;
} else if (data->window_modality == Qt::NonModal) {
- // determine the modality type if it hasn't been set prior
- // to setting WA_ShowModal. set the default to WindowModal
- // if we are the child of a group leader; otherwise use
+ // If modality hasn't been set prior to setting WA_ShowModal, use
// ApplicationModal.
- QWidget *w = parentWidget();
- if (w)
- w = w->window();
- while (w && !w->testAttribute(Qt::WA_GroupLeader)) {
- w = w->parentWidget();
- if (w)
- w = w->window();
- }
- data->window_modality = (w && w->testAttribute(Qt::WA_GroupLeader))
- ? Qt::WindowModal
- : Qt::ApplicationModal;
+ data->window_modality = Qt::ApplicationModal;
// Some window managers do not allow us to enter modality after the
// window is visible.The window must be hidden before changing the
// windowModality property and then reshown.
diff --git a/tests/manual/windowmodality/main.cpp b/tests/manual/windowmodality/main.cpp
index 3b79b5c798..e3705f78a4 100644
--- a/tests/manual/windowmodality/main.cpp
+++ b/tests/manual/windowmodality/main.cpp
@@ -175,12 +175,6 @@ public:
private slots:
void on_windowButton_clicked()
{ (new Widget)->show(); }
- void on_groupLeaderButton_clicked()
- {
- Widget *w = new Widget;
- w->setAttribute(Qt::WA_GroupLeader);
- w->show();
- }
void on_modelessCustomDialogButton_clicked()
{ newDialog(CustomDialogType, Qt::NonModal); }
diff --git a/tests/manual/windowmodality/widget.ui b/tests/manual/windowmodality/widget.ui
index 26d218b79e..1ba116863f 100644
--- a/tests/manual/windowmodality/widget.ui
+++ b/tests/manual/windowmodality/widget.ui
@@ -191,13 +191,6 @@
</property>
</widget>
</item>
- <item row="3" column="1">
- <widget class="QPushButton" name="groupLeaderButton">
- <property name="text">
- <string>Window (Group Leader)</string>
- </property>
- </widget>
- </item>
<item row="9" column="2">
<widget class="QPushButton" name="windowModalPrintDialogButton">
<property name="text">