summaryrefslogtreecommitdiffstats
path: root/src/widgets/graphicsview/qgraphicsitem_p.h
diff options
context:
space:
mode:
authorAndreas Aardal Hanssen <andrhans@cisco.com>2012-11-23 11:48:27 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-26 21:23:15 +0100
commitbfb569b6e70cc6a56566002d1cb278a0122189d1 (patch)
treec17330cd85296b0a512c2dd654712b99a78d4582 /src/widgets/graphicsview/qgraphicsitem_p.h
parent85cf6cd5f253694ad0e7d51fdd0fcfdfe65d8dc8 (diff)
Ensure subfocus is not reset to 0 when hiding a panel.
When hiding any widget that is not a panel, it is correct to clear subfocus. In case clearFocus() has been called, the result is that focusItem() / focusWidget() points to 0, which is correct. Upon reactivation, nothing gains input focus. When changing focus, the following setSubFocus() call will ensure subfocus points to the new widget. When hiding a panel, however, it's essential that subfocus within that panel is not cleared, otherwise, when re-showing the panel, nothing will have focus, whereas the expected behavior is that focus is restored to the last item that had focus, i.e., the focusItem() a.k.a. subfocus widget. Task-number: QTBUG-22256 Change-Id: I84d849a505764e074e1369fef923cef1ad5c0b1e Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/widgets/graphicsview/qgraphicsitem_p.h')
-rw-r--r--src/widgets/graphicsview/qgraphicsitem_p.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/widgets/graphicsview/qgraphicsitem_p.h b/src/widgets/graphicsview/qgraphicsitem_p.h
index 18a7376337..830afa938c 100644
--- a/src/widgets/graphicsview/qgraphicsitem_p.h
+++ b/src/widgets/graphicsview/qgraphicsitem_p.h
@@ -279,7 +279,8 @@ public:
void setTransformHelper(const QTransform &transform);
void prependGraphicsTransform(QGraphicsTransform *t);
void appendGraphicsTransform(QGraphicsTransform *t);
- void setVisibleHelper(bool newVisible, bool explicitly, bool update = true);
+ void setVisibleHelper(bool newVisible, bool explicitly, bool update = true,
+ bool hiddenByPanel = false);
void setEnabledHelper(bool newEnabled, bool explicitly, bool update = true);
bool discardUpdateRequest(bool ignoreVisibleBit = false,
bool ignoreDirtyBit = false, bool ignoreOpacity = false) const;
@@ -476,7 +477,7 @@ public:
inline void markParentDirty(bool updateBoundingRect = false);
void setFocusHelper(Qt::FocusReason focusReason, bool climb, bool focusFromHide);
- void clearFocusHelper(bool giveFocusToParent);
+ void clearFocusHelper(bool giveFocusToParent, bool hiddenByParentPanel);
void setSubFocus(QGraphicsItem *rootItem = 0, QGraphicsItem *stopItem = 0);
void clearSubFocus(QGraphicsItem *rootItem = 0, QGraphicsItem *stopItem = 0);
void resetFocusProxy();