summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-19 11:51:17 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-19 11:51:17 (GMT)
commit7ac2e0cf47628c5a7ea08a5e3058c8bc55fbdd46 (patch)
treea5e3ccd57f46c07999d37e300118ac269f2f1752
parent78b2e9421c47371b68f4c65a181a077ba3a226ac (diff)
parentb6e74016305ea70ed36a7eb1504d3120106dbb23 (diff)
downloadQt-7ac2e0cf47628c5a7ea08a5e3058c8bc55fbdd46.zip
Qt-7ac2e0cf47628c5a7ea08a5e3058c8bc55fbdd46.tar.gz
Qt-7ac2e0cf47628c5a7ea08a5e3058c8bc55fbdd46.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Initialize variable. Setting stacking order from top to bottom seems to work better. Don't crash if an out of bounds model index is accessed.
-rw-r--r--src/declarative/graphicsitems/qdeclarativerepeater.cpp12
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp2
-rw-r--r--src/imports/particles/qdeclarativeparticles_p.h2
3 files changed, 7 insertions, 9 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
index b9696c8..e8f9b24 100644
--- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
@@ -358,14 +358,10 @@ void QDeclarativeRepeater::itemsMoved(int from, int to, int count)
removed << d->deletables.takeAt(from);
for (int i = 0; i < count; ++i)
d->deletables.insert(to + i, removed.at(i));
- for (int i = 0; i < d->model->count(); ++i) {
- if (i < from && i < to)
- continue;
- QDeclarativeItem *item = d->deletables.at(i);
- if (i < d->deletables.count()-1)
- item->stackBefore(d->deletables.at(i+1));
- else
- item->stackBefore(this);
+ d->deletables.last()->stackBefore(this);
+ for (int i = d->model->count()-1; i > 0; --i) {
+ QDeclarativeItem *item = d->deletables.at(i-1);
+ item->stackBefore(d->deletables.at(i));
}
}
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
index 6341764..b31bbd0 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
@@ -422,6 +422,8 @@ int QDeclarativeVisualDataModelDataMetaObject::createProperty(const char *name,
return -1;
QDeclarativeVisualDataModelPrivate *model = QDeclarativeVisualDataModelPrivate::get(data->m_model);
+ if (data->m_index < 0 || data->m_index >= model->modelCount())
+ return -1;
if ((!model->m_listModelInterface || !model->m_abstractItemModel) && model->m_listAccessor) {
if (model->m_listAccessor->type() == QDeclarativeListAccessor::ListProperty) {
diff --git a/src/imports/particles/qdeclarativeparticles_p.h b/src/imports/particles/qdeclarativeparticles_p.h
index 993796d..9035e3e 100644
--- a/src/imports/particles/qdeclarativeparticles_p.h
+++ b/src/imports/particles/qdeclarativeparticles_p.h
@@ -111,7 +111,7 @@ class QDeclarativeParticleMotionWander : public QDeclarativeParticleMotion
Q_OBJECT
public:
QDeclarativeParticleMotionWander()
- : QDeclarativeParticleMotion(), particles(0), _xvariance(0), _yvariance(0) {}
+ : QDeclarativeParticleMotion(), particles(0), _xvariance(0), _yvariance(0), _pace(100) {}
virtual void advance(QDeclarativeParticle &, int interval);
virtual void created(QDeclarativeParticle &);