diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-08-24 00:25:13 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-08-24 00:27:34 (GMT) |
commit | 35db70bf1c046f880861bbf4f48b8741ced405c4 (patch) | |
tree | be12bd794d3d9c6265bd17e123ab27766b295d2c /src/declarative | |
parent | 0d2e88f417275a85b4e22a274fa04bc80742382e (diff) | |
download | Qt-35db70bf1c046f880861bbf4f48b8741ced405c4.zip Qt-35db70bf1c046f880861bbf4f48b8741ced405c4.tar.gz Qt-35db70bf1c046f880861bbf4f48b8741ced405c4.tar.bz2 |
Fix PathView when setting an empty model that is later filled.
Task-number: QTBUG-13017
Reviewed-by: Martin Jones
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativepathview.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp index 535fb90..4b97505 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview.cpp +++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp @@ -480,7 +480,8 @@ void QDeclarativePathView::setModel(const QVariant &model) connect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset())); connect(d->model, SIGNAL(createdItem(int, QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*))); } - d->offset = qmlMod(d->offset, qreal(d->model->count())); + if (d->model->count()) + d->offset = qmlMod(d->offset, qreal(d->model->count())); if (d->offset < 0) d->offset = d->model->count() + d->offset; d->regenerate(); |