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>
bb10
Giuseppe D'Angelo 2014-11-11 15:30:16 +01:00 committed by Andreas Aardal Hanssen
parent 501c510cc3
commit 3f7e3b1c24
1 changed files with 11 additions and 2 deletions

View File

@ -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)
{