From 098e1939cfdf675ae850912d898f1af0b2c660cc Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 25 Jun 2009 08:44:41 +1000 Subject: 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. --- src/declarative/extra/qmltimer.cpp | 2 +- src/declarative/fx/qfxgridview.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/declarative/extra/qmltimer.cpp b/src/declarative/extra/qmltimer.cpp index 0c13c4a..b891745 100644 --- a/src/declarative/extra/qmltimer.cpp +++ b/src/declarative/extra/qmltimer.cpp @@ -98,7 +98,7 @@ QmlTimer::QmlTimer(QObject *parent) /*! \qmlproperty int Timer::interval - Sets the \a interval between triggering. + Sets the \a interval in milliseconds between triggering. */ void QmlTimer::setInterval(int interval) { 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; } -- cgit v0.12