diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2014-11-11 15:30:16 +0100 |
---|---|---|
committer | Andreas Aardal Hanssen <andreas@hanssen.name> | 2014-11-11 16:05:20 +0100 |
commit | 3f7e3b1c2450a0c241cbd3a5331484bfeea219f1 (patch) | |
tree | 24b334d097f2fd7e672e4fcd8c54aa6cb4f4f5a2 /src | |
parent | 501c510cc3cb6215aed27af7599395480a049667 (diff) |
QGraphicsItem: document that setOpacity(0) almost makes the item invisible
This particular "feature" leaked into QtQuick1 back in the day. Still
it was never documented in QGraphicsView.
Task-number: QTBUG-18267
Change-Id: Ib5fb446015176f6e9b4095f6ec9030258cbd1ad4
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsitem.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp index 300e2f492b..8df2263325 100644 --- a/src/widgets/graphicsview/qgraphicsitem.cpp +++ b/src/widgets/graphicsview/qgraphicsitem.cpp @@ -2447,7 +2447,12 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, Items are visible by default; it is unnecessary to call setVisible() on a new item. - \sa isVisible(), show(), hide() + \note An item with opacity set to 0 will still be considered visible, + although it will be treated like an invisible item: mouse events will pass + through it, it will not be included in the items returned by + QGraphicsView::items(), and so on. However, the item will retain the focus. + + \sa isVisible(), show(), hide(), setOpacity() */ void QGraphicsItem::setVisible(bool visible) { @@ -2715,7 +2720,11 @@ qreal QGraphicsItem::effectiveOpacity() const with the parent: ItemIgnoresParentOpacity and ItemDoesntPropagateOpacityToChildren. - \sa opacity(), effectiveOpacity() + \note Setting the opacity of an item to 0 will not make the item invisible + (according to isVisible()), but the item will be treated like an invisible + one. See the documentation of setVisible() for more information. + + \sa opacity(), effectiveOpacity(), setVisible() */ void QGraphicsItem::setOpacity(qreal opacity) { |