summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-06-24 22:44:41 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-06-24 22:44:41 (GMT)
commit098e1939cfdf675ae850912d898f1af0b2c660cc (patch)
tree068677be10c039040012965716777549f7f32cb7 /src/declarative/fx
parent60e9ce020e4d3f78a6d96b9cf7c78275a326aef2 (diff)
downloadQt-098e1939cfdf675ae850912d898f1af0b2c660cc.zip
Qt-098e1939cfdf675ae850912d898f1af0b2c660cc.tar.gz
Qt-098e1939cfdf675ae850912d898f1af0b2c660cc.tar.bz2
Fix GridView handling of unrequested items.
If unrequested items were added before we had populated any items they would not be laid out at all.
Diffstat (limited to 'src/declarative/fx')
-rw-r--r--src/declarative/fx/qfxgridview.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/declarative/fx/qfxgridview.cpp b/src/declarative/fx/qfxgridview.cpp
index 0ca9393..a6ffbb9 100644
--- a/src/declarative/fx/qfxgridview.cpp
+++ b/src/declarative/fx/qfxgridview.cpp
@@ -234,6 +234,8 @@ public:
int count = columns - 1 - (modelIndex - visibleItems.last()->index - 1) % columns;
return visibleItems.last()->colPos() - count * colSize();
}
+ } else {
+ return (modelIndex % columns) * colSize();
}
return 0;
}
@@ -252,6 +254,8 @@ public:
int rows = col / (columns * colSize());
return visibleItems.last()->rowPos() + rows * rowSize();
}
+ } else {
+ return (modelIndex / columns) * rowSize();
}
return 0;
}