summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlli Werwolff <qt-info@nokia.com>2010-11-16 10:54:51 +0100
committerOlli Werwolff <qt-info@nokia.com>2010-11-16 12:02:45 +0100
commitac6c1cbba5d07670148f2640e1bb83b94dfb0ce8 (patch)
tree7b711afd4688db37141e3c905fbd756d304c51b1
parent379d054fd0642e587291b60b26dbe2f9b55281bd (diff)
Ignore key/mouse events for invisible widgets
Reviewed-by: ckamm
-rw-r--r--src/other/widget.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/other/widget.cpp b/src/other/widget.cpp
index 023cb04..7e16891 100644
--- a/src/other/widget.cpp
+++ b/src/other/widget.cpp
@@ -214,6 +214,11 @@ void Widget::hoverMoveEvent(QGraphicsSceneHoverEvent *ev)
void Widget::handleMouseEvent(QEvent::Type type, QGraphicsSceneMouseEvent *ev)
{
+ if (!mWidgetVisible) {
+ ev->ignore();
+ return;
+ }
+
QtSimulatorPrivate::RemoteMetacall<void>::call(owner->socket(), QtSimulatorPrivate::NoSync,
"dispatchMouseEvent",
widgetId,
@@ -237,6 +242,11 @@ void Widget::keyReleaseEvent(QKeyEvent* ev)
void Widget::handleKeyEvent(QKeyEvent* ev)
{
+ if (!mWidgetVisible) {
+ ev->ignore();
+ return;
+ }
+
QtSimulatorPrivate::RemoteMetacall<void>::call(owner->socket(), QtSimulatorPrivate::NoSync,
"dispatchKeyEvent",
widgetId,