summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativepositioners.cpp
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2011-01-18 22:38:49 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2011-01-18 22:38:49 (GMT)
commit9c1e67d83f6175f339e6771be05ee60ba72426b3 (patch)
treecbd2a9df1170188642b2bce538a2e4ab35cce795 /src/declarative/graphicsitems/qdeclarativepositioners.cpp
parent28951758263e1512b00ca8e2e91a0cc95d176512 (diff)
downloadQt-9c1e67d83f6175f339e6771be05ee60ba72426b3.zip
Qt-9c1e67d83f6175f339e6771be05ee60ba72426b3.tar.gz
Qt-9c1e67d83f6175f339e6771be05ee60ba72426b3.tar.bz2
Compile on windows
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativepositioners.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
index b3383ab..ee9181d 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
@@ -611,7 +611,7 @@ void QDeclarativeRow::doPositioning(QSizeF *contentSize)
{
int hoffset = 0;
- int hoffsets[positionedItems.count()];
+ QList<int> hoffsets;
for (int ii = 0; ii < positionedItems.count(); ++ii) {
const PositionedItem &child = positionedItems.at(ii);
if (!child.item || !child.isVisible)
@@ -621,7 +621,7 @@ void QDeclarativeRow::doPositioning(QSizeF *contentSize)
if(child.item->x() != hoffset)
positionX(hoffset, child);
}else{
- hoffsets[ii] = hoffset;
+ hoffsets << hoffset;
}
contentSize->setHeight(qMax(contentSize->height(), QGraphicsItemPrivate::get(child.item)->height()));
@@ -642,11 +642,12 @@ void QDeclarativeRow::doPositioning(QSizeF *contentSize)
else
end = width();
+ int acc = 0;
for (int ii = 0; ii < positionedItems.count(); ++ii) {
const PositionedItem &child = positionedItems.at(ii);
if (!child.item || !child.isVisible)
continue;
- hoffset = end - hoffsets[ii] - QGraphicsItemPrivate::get(child.item)->width();
+ hoffset = end - hoffsets[acc++] - QGraphicsItemPrivate::get(child.item)->width();
if(child.item->x() != hoffset)
positionX(hoffset, child);
}
@@ -1234,7 +1235,7 @@ void QDeclarativeFlow::doPositioning(QSizeF *contentSize)
int hoffset = 0;
int voffset = 0;
int linemax = 0;
- int hoffsets[positionedItems.count()];
+ QList<int> hoffsets;
for (int i = 0; i < positionedItems.count(); ++i) {
const PositionedItem &child = positionedItems.at(i);
@@ -1260,7 +1261,7 @@ void QDeclarativeFlow::doPositioning(QSizeF *contentSize)
if(child.item->x() != hoffset)
positionX(hoffset, child);
}else{
- hoffsets[i] = hoffset;
+ hoffsets << hoffset;
}
if(child.item->y() != voffset)
positionY(voffset, child);
@@ -1287,11 +1288,12 @@ void QDeclarativeFlow::doPositioning(QSizeF *contentSize)
end = width();
else
end = contentSize->width();
+ int acc = 0;
for (int i = 0; i < positionedItems.count(); ++i) {
const PositionedItem &child = positionedItems.at(i);
if (!child.item || !child.isVisible)
continue;
- hoffset = end - hoffsets[i] - QGraphicsItemPrivate::get(child.item)->width();
+ hoffset = end - hoffsets[acc++] - QGraphicsItemPrivate::get(child.item)->width();
if(child.item->x() != hoffset)
positionX(hoffset, child);
}