summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
diff options
context:
space:
mode:
authorJohn Tapsell <john.tapsell.ext@basyskom.de>2010-11-15 11:55:13 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2010-11-15 11:55:13 (GMT)
commit1781b3c876b4e1025b2a85f4e7975c171b1a1404 (patch)
tree4b15aa0cac8d0c379fd3ce1f11e1c832f2559ca3 /src/gui/graphicsview
parent604c51f1fc5c79b7fad12cda911b06b9e6e5005f (diff)
downloadQt-1781b3c876b4e1025b2a85f4e7975c171b1a1404.zip
Qt-1781b3c876b4e1025b2a85f4e7975c171b1a1404.tar.gz
Qt-1781b3c876b4e1025b2a85f4e7975c171b1a1404.tar.bz2
Change the QGraphics*Layout documentation to match the code - that the default alignment is top-left.
This includes unit tests to confirm that the alignment is top-left in a variety of different cases. Merge-request: 894 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r--src/gui/graphicsview/qgraphicsgridlayout.cpp11
-rw-r--r--src/gui/graphicsview/qgraphicslinearlayout.cpp4
2 files changed, 13 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicsgridlayout.cpp b/src/gui/graphicsview/qgraphicsgridlayout.cpp
index 3fc7f10..c3bb6c3 100644
--- a/src/gui/graphicsview/qgraphicsgridlayout.cpp
+++ b/src/gui/graphicsview/qgraphicsgridlayout.cpp
@@ -64,6 +64,17 @@
removeAt() will remove an item from the layout, without
destroying it.
+ \section1 Size Hints and Size Policies in QGraphicsGridLayout
+
+ QGraphicsGridLayout respects each item's size hints and size policies,
+ and when the layout contains more space than the items can fill, each item
+ is arranged according to the layout's alignment for that item. You can set
+ an alignment for each item by calling setAlignment(), and check the
+ alignment for any item by calling alignment(). You can also set the alignment
+ for an entire row or column by calling setRowAlignment() and setColumnAlignment()
+ respectively. By default, items are aligned to the top left.
+
+
\sa QGraphicsLinearLayout, QGraphicsWidget
*/
diff --git a/src/gui/graphicsview/qgraphicslinearlayout.cpp b/src/gui/graphicsview/qgraphicslinearlayout.cpp
index 7e8d19f..244a728 100644
--- a/src/gui/graphicsview/qgraphicslinearlayout.cpp
+++ b/src/gui/graphicsview/qgraphicslinearlayout.cpp
@@ -75,7 +75,7 @@
is arranged according to the layout's alignment for that item. You can set
an alignment for each item by calling setAlignment(), and check the
alignment for any item by calling alignment(). By default, items are
- centered both vertically and horizontally.
+ aligned to the top left.
\section1 Spacing within QGraphicsLinearLayout
@@ -446,7 +446,7 @@ void QGraphicsLinearLayout::setAlignment(QGraphicsLayoutItem *item, Qt::Alignmen
/*!
Returns the alignment for \a item. The default alignment is
- Qt::AlignCenter.
+ Qt::AlignTop | Qt::AlignLeft.
The alignment decides how the item is positioned within its assigned space
in the case where there's more space available in the layout than the