summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-01-19 16:57:20 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-02-05 13:54:01 +0000
commit239f67f158c55d3eb88348a53b87fa272402c733 (patch)
tree714ac81bcf473c077f085ccbcbe3f0d8e993bb12 /src/widgets
parentdf3ffeec15cd20c249cb6ffb2d235526a05722a5 (diff)
Do not close popup widgets when showing a widget embedded into QGraphicsView.
Disable top-level widget code path for embedded widget in the show helper. Task-number: QTBUG-43780 Change-Id: I574e07130e5e68a019a426cee3fde982f3883720 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/kernel/qwidget.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 453a7ca537..d8b8b151c2 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -7738,10 +7738,17 @@ void QWidgetPrivate::show_helper()
+ const bool isWindow = q->isWindow();
+#ifndef QT_NO_GRAPHICSVIEW
+ bool isEmbedded = isWindow && q->graphicsProxyWidget() != Q_NULLPTR;
+#else
+ bool isEmbedded = false;
+#endif
+
// popup handling: new popups and tools need to be raised, and
// existing popups must be closed. Also propagate the current
// windows's KeyboardFocusChange status.
- if (q->isWindow()) {
+ if (isWindow && !isEmbedded) {
if ((q->windowType() == Qt::Tool) || (q->windowType() == Qt::Popup) || q->windowType() == Qt::ToolTip) {
q->raise();
if (q->parentWidget() && q->parentWidget()->window()->testAttribute(Qt::WA_KeyboardFocusChange))
@@ -7756,10 +7763,8 @@ void QWidgetPrivate::show_helper()
// Automatic embedding of child windows of widgets already embedded into
// QGraphicsProxyWidget when they are shown the first time.
- bool isEmbedded = false;
#ifndef QT_NO_GRAPHICSVIEW
- if (q->isWindow()) {
- isEmbedded = q->graphicsProxyWidget() ? true : false;
+ if (isWindow) {
if (!isEmbedded && !bypassGraphicsProxyWidget(q)) {
QGraphicsProxyWidget *ancestorProxy = nearestGraphicsProxyWidget(q->parentWidget());
if (ancestorProxy) {