aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates/qquickstackview.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-01-25 11:02:44 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-01-25 11:03:53 +0100
commit5ada1525e03116326a480fb05611904d3484c296 (patch)
treef23822e6b0482012065b9586d95cb8ab5d70c4bf /src/templates/qquickstackview.cpp
parentf4f5e857447d42738b1b60b5c4184f39df2f1593 (diff)
parent4f1fb09ed70c69e73f2e19f28f4299f4cfbc90dc (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts: .gitignore src/templates/qquickcombobox_p.h src/templates/qquickmenu_p.h src/templates/qquickmenu_p_p.h src/templates/qquickoverlay_p.h src/templates/qquickpopup.cpp src/templates/qquickpopup_p.h src/templates/qquickstackview_p.cpp Change-Id: I89c7d518697beec0b81ef3a12205286a4f3ccf89
Diffstat (limited to 'src/templates/qquickstackview.cpp')
-rw-r--r--src/templates/qquickstackview.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/templates/qquickstackview.cpp b/src/templates/qquickstackview.cpp
index 29b631dc..b338f3bf 100644
--- a/src/templates/qquickstackview.cpp
+++ b/src/templates/qquickstackview.cpp
@@ -257,6 +257,8 @@ QT_BEGIN_NAMESPACE
}
\endqml
+ \labs
+
\sa {Customizing StackView}, {Navigation Controls}, {Container Controls}
*/
@@ -877,10 +879,18 @@ void QQuickStackView::geometryChanged(const QRectF &newGeometry, const QRectF &o
}
}
-bool QQuickStackView::childMouseEventFilter(QQuickItem *, QEvent *)
+bool QQuickStackView::childMouseEventFilter(QQuickItem *item, QEvent *event)
{
- // busy should be true if this function gets called
- return true;
+ // in order to block accidental user interaction while busy/transitioning,
+ // StackView filters out childrens' mouse events. therefore we block all
+ // press events. however, since push() may be called from signal handlers
+ // such as onPressed or onDoubleClicked, we must let the current mouse
+ // grabber item receive the respective mouse release event to avoid
+ // breaking its state (QTBUG-50305).
+ if (event->type() == QEvent::MouseButtonPress)
+ return true;
+ QQuickWindow *window = item->window();
+ return window && !window->mouseGrabberItem();
}
void QQuickStackAttachedPrivate::itemParentChanged(QQuickItem *item, QQuickItem *parent)