summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicslayout.cpp
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2009-09-23 11:06:45 +0200
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2009-09-23 11:59:58 +0200
commit0ab4d027de7ed6ae0c848499aacea8a23dc9042c (patch)
tree2c6de67b27d41a22305ebd90ab7ca18667c1f2c6 /src/gui/graphicsview/qgraphicslayout.cpp
parent369afa4bcee7addbf1a7e8556cf0b521bb75c57d (diff)
Small API addition: Make addChildLayoutItem available for subclasses.
Many people have requested this. And since its protected it does not really pollute the API a lot. Task: QTBUG-3524 Reviewed-by: mbm
Diffstat (limited to 'src/gui/graphicsview/qgraphicslayout.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicslayout.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicslayout.cpp b/src/gui/graphicsview/qgraphicslayout.cpp
index 0e4df71c0f..f9800bcff1 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