diff options
author | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-09-23 10:05:14 (GMT) |
---|---|---|
committer | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-09-23 10:05:14 (GMT) |
commit | ff2519e28cc3d219d1643a1ba766878fa236386c (patch) | |
tree | 3760af85a8115d7f05553703cf7f7fbbddee640a /src | |
parent | b3a9565c99c44cdf4d3236de211110382c7b908b (diff) | |
parent | 0ab4d027de7ed6ae0c848499aacea8a23dc9042c (diff) | |
download | Qt-ff2519e28cc3d219d1643a1ba766878fa236386c.zip Qt-ff2519e28cc3d219d1643a1ba766878fa236386c.tar.gz Qt-ff2519e28cc3d219d1643a1ba766878fa236386c.tar.bz2 |
Merge branch 'QTBUG-3524' into 4.6
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/graphicsview/qgraphicslayout.cpp | 18 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicslayout.h | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicslayout.cpp b/src/gui/graphicsview/qgraphicslayout.cpp index 0e4df71..f9800bc 100644 --- a/src/gui/graphicsview/qgraphicslayout.cpp +++ b/src/gui/graphicsview/qgraphicslayout.cpp @@ -419,6 +419,24 @@ void QGraphicsLayout::widgetEvent(QEvent *e) \sa itemAt(), count() */ +/*! + This function is a convenience function provided for custom layouts, and will go through + all items in the layout and reparent their graphics items to the closest QGraphicsWidget + ancestor of the layout. + + If \a layoutItem is already in a different layout, it will be removed from that layout. + + If custom layouts want special behaviour they can ignore to use this function, and implement + their own behaviour. + + \sa graphicsItem() + */ +void QGraphicsLayout::addChildLayoutItem(QGraphicsLayoutItem *layoutItem) +{ + Q_D(QGraphicsLayout); + d->addChildLayoutItem(layoutItem); +} + QT_END_NAMESPACE #endif //QT_NO_GRAPHICSVIEW diff --git a/src/gui/graphicsview/qgraphicslayout.h b/src/gui/graphicsview/qgraphicslayout.h index e872980..e214a62 100644 --- a/src/gui/graphicsview/qgraphicslayout.h +++ b/src/gui/graphicsview/qgraphicslayout.h @@ -78,6 +78,7 @@ public: protected: QGraphicsLayout(QGraphicsLayoutPrivate &, QGraphicsLayoutItem *); + void addChildLayoutItem(QGraphicsLayoutItem *layoutItem); private: Q_DISABLE_COPY(QGraphicsLayout) |