From 0d572fc7d251691a34fe5b99c60868835409047e Mon Sep 17 00:00:00 2001 From: Caio Marcelo de Oliveira Filho Date: Tue, 23 Aug 2011 19:04:16 -0300 Subject: Do not deliver mouse wheel events when item is not visible This patch change the code to also skip invisible items (it was done for disabled already) when deciding whether or not deliver the wheel event to an item. The rationale here is to follow the same rule as the other mouse events. An autotest was added to verify and maintain this behavior. Change-Id: If0fe6d64d1f7cfb8679ce11edda7c02dc3783f94 Reviewed-on: http://codereview.qt.nokia.com/3429 Reviewed-by: Qt Sanity Bot Reviewed-by: Michael Brasser --- src/declarative/items/qsgcanvas.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/declarative/items/qsgcanvas.cpp b/src/declarative/items/qsgcanvas.cpp index 11b3b030ed..6873c41cef 100644 --- a/src/declarative/items/qsgcanvas.cpp +++ b/src/declarative/items/qsgcanvas.cpp @@ -1306,7 +1306,7 @@ bool QSGCanvasPrivate::deliverWheelEvent(QSGItem *item, QWheelEvent *event) QList children = itemPrivate->paintOrderChildItems(); for (int ii = children.count() - 1; ii >= 0; --ii) { QSGItem *child = children.at(ii); - if (!child->isEnabled()) + if (!child->isVisible() || !child->isEnabled()) continue; if (deliverWheelEvent(child, event)) return true; -- cgit v1.2.3