diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2011-07-26 16:47:09 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-07-27 01:26:20 +0200 |
commit | d7630a80bdd52c2439d4f1c5c8fb4e8e8c0ed931 (patch) | |
tree | a4b070aa4863553e12c1f11dc0d3f3b6bb29a8e7 /src/declarative | |
parent | 1a1ce3775b937ee2ba952d4a7360a1626afdf7a5 (diff) |
Fix Column/Row size when no items being positioned
Change-Id: I0bf55c13e55856dd7292e5eda159086096dea86b
Reviewed-on: http://codereview.qt.nokia.com/2158
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/items/qsgpositioners.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/declarative/items/qsgpositioners.cpp b/src/declarative/items/qsgpositioners.cpp index 3f6b24a8d4..da3c7fea04 100644 --- a/src/declarative/items/qsgpositioners.cpp +++ b/src/declarative/items/qsgpositioners.cpp @@ -211,7 +211,7 @@ void QSGBasePositioner::prePositioning() positionedItems.append(*item); } } - QSizeF contentSize; + QSizeF contentSize(0,0); doPositioning(&contentSize); if(d->addTransition || d->moveTransition) finishApplyTransitions(); @@ -288,10 +288,11 @@ void QSGColumn::doPositioning(QSizeF *contentSize) contentSize->setWidth(qMax(contentSize->width(), child.item->width())); voffset += child.item->height(); - voffset += spacing(); + if (ii != positionedItems.count() - 1) + voffset += spacing(); } - contentSize->setHeight(voffset - spacing()); + contentSize->setHeight(voffset); } void QSGColumn::reportConflictingAnchors() @@ -370,10 +371,11 @@ void QSGRow::doPositioning(QSizeF *contentSize) contentSize->setHeight(qMax(contentSize->height(), child.item->height())); hoffset += child.item->width(); - hoffset += spacing(); + if (ii != positionedItems.count() - 1) + hoffset += spacing(); } - contentSize->setWidth(hoffset - spacing()); + contentSize->setWidth(hoffset); if (d->isLeftToRight()) return; |