summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-29 03:54:47 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-29 03:54:47 (GMT)
commitbfbded95056d43a65b2c9ef1fa90bfd40adc6472 (patch)
treec20ababb5a2e124e9c7ac796ace1d52380470bd3 /src/gui/graphicsview
parente8bc4cebe9963a8a4534a5febbd606a6e4d6a332 (diff)
parentf425c08d4f2e7f061a0ee8e4a1eee2b17fa64962 (diff)
downloadQt-bfbded95056d43a65b2c9ef1fa90bfd40adc6472.zip
Qt-bfbded95056d43a65b2c9ef1fa90bfd40adc6472.tar.gz
Qt-bfbded95056d43a65b2c9ef1fa90bfd40adc6472.tar.bz2
Merge branch '4.6' of ../qt into kinetic-declarativeui
Conflicts: src/script/api/qscriptengine.cpp src/script/api/qscriptprogram.cpp src/script/api/qscriptprogram.h src/script/api/qscriptprogram_p.h tests/auto/qscriptengine/tst_qscriptengine.cpp tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp tools/qdoc3/test/qt-inc.qdocconf
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp23
-rw-r--r--src/gui/graphicsview/qgraphicslinearlayout.cpp10
-rw-r--r--src/gui/graphicsview/qgraphicslinearlayout.h2
-rw-r--r--src/gui/graphicsview/qgraphicstransform.cpp3
4 files changed, 29 insertions, 9 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index e22486b..f8c627d 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -1228,7 +1228,8 @@ void QGraphicsItemCache::purge()
}
/*!
- Constructs a QGraphicsItem, passing \a item to QGraphicsItem's constructor. It does not modify \fn QObject::parent().
+ Constructs a QGraphicsItem with the given \a parent item.
+ It does not modify the parent object returned by QObject::parent().
If \a parent is 0, you can add the item to a scene by calling
QGraphicsScene::addItem(). The item will then become a top-level item.
@@ -7293,6 +7294,21 @@ static void qt_graphicsItem_highlightSelected(
The class extends a QGraphicsItem with QObject's signal/slot and property mechanisms.
It maps many of QGraphicsItem's basic setters and getters to properties and adds notification
signals for many of them.
+
+ \section1 Parents and Children
+
+ Each graphics object can be constructed with a parent item. This ensures that the
+ item will be destroyed when its parent item is destroyed. Although QGraphicsObject
+ inherits from both QObject and QGraphicsItem, you should use the functions provided
+ by QGraphicsItem, \e not QObject, to manage the relationships between parent and
+ child items.
+
+ The relationships between items can be explored using the parentItem() and childItems()
+ functions. In the hierarchy of items in a scene, the parentObject() and parentWidget()
+ functions are the equivalent of the QWidget::parent() and QWidget::parentWidget()
+ functions for QWidget subclasses.
+
+ \sa QGraphicsWidget
*/
/*!
@@ -7328,7 +7344,10 @@ void QGraphicsObject::grabGesture(Qt::GestureType gesture, Qt::GestureContext co
/*!
\property QGraphicsObject::parent
- \brief the parent of the item. It is independent from \fn QObject::parent.
+ \brief the parent of the item
+
+ \note The item's parent is set independently of the parent object returned
+ by QObject::parent().
\sa QGraphicsItem::setParentItem(), QGraphicsItem::parentObject()
*/
diff --git a/src/gui/graphicsview/qgraphicslinearlayout.cpp b/src/gui/graphicsview/qgraphicslinearlayout.cpp
index 7ff7c9b..5684f0e 100644
--- a/src/gui/graphicsview/qgraphicslinearlayout.cpp
+++ b/src/gui/graphicsview/qgraphicslinearlayout.cpp
@@ -59,7 +59,7 @@
You can add widgets, layouts, stretches (addStretch(), insertStretch() or
setStretchFactor()), and spacings (setItemSpacing()) to a linear
- layout. The layout takes ownership of the items. In some cases when the layout
+ layout. The layout takes ownership of the items. In some cases when the layout
item also inherits from QGraphicsItem (such as QGraphicsWidget) there will be a
ambiguity in ownership because the layout item belongs to two ownership hierarchies.
See the documentation of QGraphicsLayoutItem::setOwnedByLayout() how to handle
@@ -208,7 +208,7 @@ QGraphicsLinearLayout::~QGraphicsLinearLayout()
for (int i = count() - 1; i >= 0; --i) {
QGraphicsLayoutItem *item = itemAt(i);
// The following lines can be removed, but this removes the item
- // from the layout more efficiently than the implementation of
+ // from the layout more efficiently than the implementation of
// ~QGraphicsLayoutItem.
removeAt(i);
if (item) {
@@ -542,18 +542,18 @@ void QGraphicsLinearLayout::invalidate()
QGraphicsLayout::invalidate();
}
-#ifdef QT_DEBUG
void QGraphicsLinearLayout::dump(int indent) const
{
+#ifdef QT_DEBUG
if (qt_graphicsLayoutDebug()) {
Q_D(const QGraphicsLinearLayout);
qDebug("%*s%s layout", indent, "",
d->orientation == Qt::Horizontal ? "Horizontal" : "Vertical");
d->engine.dump(indent + 1);
}
-}
#endif
+}
QT_END_NAMESPACE
-
+
#endif //QT_NO_GRAPHICSVIEW
diff --git a/src/gui/graphicsview/qgraphicslinearlayout.h b/src/gui/graphicsview/qgraphicslinearlayout.h
index 742392e..15fe81a 100644
--- a/src/gui/graphicsview/qgraphicslinearlayout.h
+++ b/src/gui/graphicsview/qgraphicslinearlayout.h
@@ -97,9 +97,7 @@ public:
Q5SizePolicy::ControlTypes controlTypes(LayoutSide side) const;
#endif
-#ifdef QT_DEBUG
void dump(int indent = 0) const;
-#endif
protected:
#if 0
diff --git a/src/gui/graphicsview/qgraphicstransform.cpp b/src/gui/graphicsview/qgraphicstransform.cpp
index 93dc196..e2a3f08 100644
--- a/src/gui/graphicsview/qgraphicstransform.cpp
+++ b/src/gui/graphicsview/qgraphicstransform.cpp
@@ -69,6 +69,9 @@
objects are applied to a QGraphicsItem, all of the transformations
are computed in true 3D space, with the projection back to 2D
only occurring after the last QGraphicsTransform is applied.
+ The exception to this is QGraphicsRotation, which projects back to
+ 2D after each rotation to preserve the perspective effect around
+ the X and Y axes.
If you want to create your own configurable transformation, you can create
a subclass of QGraphicsTransform (or any or the existing subclasses), and