diff options
author | Frederik Gladhorn <frederik.gladhorn@nokia.com> | 2010-09-27 15:35:06 (GMT) |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@nokia.com> | 2010-10-01 12:04:40 (GMT) |
commit | c146652bfb336c084c39db7513e27540e456791e (patch) | |
tree | 1f5eb1921eb86029723900e76aef6f64b0f3b497 /src/gui | |
parent | c6398b785588486c5fc52cb1d71000c0815d995e (diff) | |
download | Qt-c146652bfb336c084c39db7513e27540e456791e.zip Qt-c146652bfb336c084c39db7513e27540e456791e.tar.gz Qt-c146652bfb336c084c39db7513e27540e456791e.tar.bz2 |
FocusOut even when QGraphicsItem gets hidden.
If a parent QGraphicsItem becomes invisible, its child
would not receive a focus out event.
Review-by: Thierry
Task-number: QTBUG-13916
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 3b18c31..fc44a44 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -6655,6 +6655,11 @@ bool QGraphicsItem::sceneEvent(QEvent *event) return true; } + if (event->type() == QEvent::FocusOut) { + focusOutEvent(static_cast<QFocusEvent *>(event)); + return true; + } + if (!d_ptr->visible) { // Eaten return true; @@ -6664,9 +6669,6 @@ bool QGraphicsItem::sceneEvent(QEvent *event) case QEvent::FocusIn: focusInEvent(static_cast<QFocusEvent *>(event)); break; - case QEvent::FocusOut: - focusOutEvent(static_cast<QFocusEvent *>(event)); - break; case QEvent::GraphicsSceneContextMenu: contextMenuEvent(static_cast<QGraphicsSceneContextMenuEvent *>(event)); break; |