summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem.cpp
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-08-19 08:39:40 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-08-19 08:39:40 (GMT)
commit928f902015a0ad97279ce6e2ac4cb85e5baed684 (patch)
treec3afd6f5b72b32136ab9d40788e1cf05d7b91763 /src/gui/graphicsview/qgraphicsitem.cpp
parent17d6f2a59fe2b170087cdf7074807c6a2dce1043 (diff)
parent5fb5c01bd0ac234eaca890d97053c7b0772861a3 (diff)
downloadQt-928f902015a0ad97279ce6e2ac4cb85e5baed684.zip
Qt-928f902015a0ad97279ce6e2ac4cb85e5baed684.tar.gz
Qt-928f902015a0ad97279ce6e2ac4cb85e5baed684.tar.bz2
Merge commit 'qt/master' into kinetic-graphicseffect
Conflicts: src/gui/graphicsview/qgraphicsitem_p.h
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 66f5f22..50b5b9e 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -44,7 +44,7 @@
\brief The QGraphicsItem class is the base class for all graphical
items in a QGraphicsScene.
\since 4.2
- \ingroup multimedia
+
\ingroup graphicsview-api
It provides a light-weight foundation for writing your own custom items.
@@ -328,6 +328,10 @@
used for Asian languages.
This flag was introduced in Qt 4.6.
+ \value ItemNegativeZStacksBehindParent The item automatically stacks behind
+ it's parent if it's z-value is negative. This flag enables setZValue() to
+ toggle ItemStacksBehindParent.
+
\value ItemAutoDetectsFocusProxy The item will assign any child that
gains input focus as its focus proxy. See also focusProxy().
This flag was introduced in Qt 4.6.
@@ -1563,6 +1567,11 @@ void QGraphicsItem::setFlags(GraphicsItemFlags flags)
d_ptr->scene->d_func()->updateInputMethodSensitivityInViews();
}
+ if ((flags & ItemNegativeZStacksBehindParent) != (oldFlags & ItemNegativeZStacksBehindParent)) {
+ // Update stack-behind.
+ setFlag(ItemStacksBehindParent, d_ptr->z < qreal(0.0));
+ }
+
if (d_ptr->scene) {
d_ptr->scene->d_func()->markDirty(this, QRectF(),
/*invalidateChildren=*/true,
@@ -3829,6 +3838,9 @@ void QGraphicsItem::setZValue(qreal z)
itemChange(ItemZValueHasChanged, newZVariant);
+ if (d_ptr->flags & ItemNegativeZStacksBehindParent)
+ setFlag(QGraphicsItem::ItemStacksBehindParent, z < qreal(0.0));
+
if (d_ptr->isObject)
emit static_cast<QGraphicsObject *>(this)->zChanged();
}
@@ -6952,11 +6964,12 @@ QGraphicsObject::QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent
By default, this property is true.
- \sa QGraphicsItem::isEnabled(), QGraphicsItem::setEnabled(), enabledChanged()
+ \sa QGraphicsItem::isEnabled(), QGraphicsItem::setEnabled()
+ \sa QGraphicsObject::enabledChanged()
*/
/*!
- \fn QGraphicsObject::enabledChanged()
+ \fn void QGraphicsObject::enabledChanged()
This signal gets emitted whenever the item get's enabled or disabled.
@@ -7008,7 +7021,7 @@ QGraphicsObject::QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent
\brief The QAbstractGraphicsShapeItem class provides a common base for
all path items.
\since 4.2
- \ingroup multimedia
+ \ingroup graphicsview-api
This class does not fully implement an item by itself; in particular, it
does not implement boundingRect() and paint(), which are inherited by
@@ -7143,7 +7156,6 @@ QPainterPath QAbstractGraphicsShapeItem::opaqueArea() const
\brief The QGraphicsPathItem class provides a path item that you
can add to a QGraphicsScene.
\since 4.2
- \ingroup multimedia
\ingroup graphicsview-api
To set the item's path, pass a QPainterPath to QGraphicsPathItem's
@@ -7346,7 +7358,6 @@ QVariant QGraphicsPathItem::extension(const QVariant &variant) const
\brief The QGraphicsRectItem class provides a rectangle item that you
can add to a QGraphicsScene.
\since 4.2
- \ingroup multimedia
\ingroup graphicsview-api
To set the item's rectangle, pass a QRectF to QGraphicsRectItem's
@@ -7591,7 +7602,6 @@ QVariant QGraphicsRectItem::extension(const QVariant &variant) const
\brief The QGraphicsEllipseItem class provides an ellipse item that you
can add to a QGraphicsScene.
\since 4.2
- \ingroup multimedia
\ingroup graphicsview-api
QGraphicsEllipseItem respresents an ellipse with a fill and an outline,
@@ -7908,7 +7918,6 @@ QVariant QGraphicsEllipseItem::extension(const QVariant &variant) const
\brief The QGraphicsPolygonItem class provides a polygon item that you
can add to a QGraphicsScene.
\since 4.2
- \ingroup multimedia
\ingroup graphicsview-api
To set the item's polygon, pass a QPolygonF to
@@ -8142,7 +8151,6 @@ QVariant QGraphicsPolygonItem::extension(const QVariant &variant) const
\brief The QGraphicsLineItem class provides a line item that you can add to a
QGraphicsScene.
\since 4.2
- \ingroup multimedia
\ingroup graphicsview-api
To set the item's line, pass a QLineF to QGraphicsLineItem's
@@ -8404,7 +8412,6 @@ QVariant QGraphicsLineItem::extension(const QVariant &variant) const
\brief The QGraphicsPixmapItem class provides a pixmap item that you can add to
a QGraphicsScene.
\since 4.2
- \ingroup multimedia
\ingroup graphicsview-api
To set the item's pixmap, pass a QPixmap to QGraphicsPixmapItem's
@@ -8768,7 +8775,6 @@ QVariant QGraphicsPixmapItem::extension(const QVariant &variant) const
\brief The QGraphicsTextItem class provides a text item that you can add to
a QGraphicsScene to display formatted text.
\since 4.2
- \ingroup multimedia
\ingroup graphicsview-api
If you only need to show plain text in an item, consider using QGraphicsSimpleTextItem
@@ -9633,7 +9639,6 @@ void QGraphicsSimpleTextItemPrivate::updateBoundingRect()
\brief The QGraphicsSimpleTextItem class provides a simple text path item
that you can add to a QGraphicsScene.
\since 4.2
- \ingroup multimedia
\ingroup graphicsview-api
To set the item's text, you can either pass a QString to
@@ -9869,7 +9874,6 @@ QVariant QGraphicsSimpleTextItem::extension(const QVariant &variant) const
\brief The QGraphicsItemGroup class provides treating a group of items as
one.
\since 4.2
- \ingroup multimedia
\ingroup graphicsview-api
A QGraphicsItemGroup is a special type of compound item that
@@ -10342,6 +10346,9 @@ QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemFlag flag)
case QGraphicsItem::ItemAcceptsInputMethod:
str = "ItemAcceptsInputMethod";
break;
+ case QGraphicsItem::ItemNegativeZStacksBehindParent:
+ str = "ItemNegativeZStacksBehindParent";
+ break;
case QGraphicsItem::ItemAutoDetectsFocusProxy:
str = "ItemAutoDetectsFocusProxy";
break;