diff options
author | Martin Koller <kollix@aon.at> | 2019-01-04 21:58:51 +0100 |
---|---|---|
committer | Martin Koller <kollix@aon.at> | 2019-02-21 07:23:40 +0000 |
commit | 6a314669511fe7b36abc8da832c80de32fa567d9 (patch) | |
tree | 3331f566c890cf862516971e0424fae6fadde93d /src/widgets/widgets/qmdiarea.cpp | |
parent | 035f934d7a798e97bf0213a5d42a3d511132f03d (diff) |
ensure signal subWindowActivated() triggers even when widget has focus
A widget being added to QMdiArea which currently has focus
did not trigger the subWindowActivated() signal
since the connection to the method _q_processWindowStateChanged, which
emits the signal (set up in appendChild()), was just done after
the focus was set back again to the added widget.
Setting the focus makes the widget active.
This patch changes the order: first call appendChild(), then set focus
Change-Id: I3aaf1728dc082d1323c7fbd62bfdbd2af87ab2ce
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/widgets/qmdiarea.cpp')
-rw-r--r-- | src/widgets/widgets/qmdiarea.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp index feea7cd050..0ce561860e 100644 --- a/src/widgets/widgets/qmdiarea.cpp +++ b/src/widgets/widgets/qmdiarea.cpp @@ -1988,9 +1988,11 @@ QMdiSubWindow *QMdiArea::addSubWindow(QWidget *widget, Qt::WindowFlags windowFla Q_ASSERT(child->testAttribute(Qt::WA_DeleteOnClose)); } + d->appendChild(child); + if (childFocus) childFocus->setFocus(); - d->appendChild(child); + return child; } |