summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-09-16 15:27:45 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-09-16 15:27:45 +0200
commitc95b119596c17d8430b24d5e10c4f48fd0a88cb1 (patch)
tree6afae4fc1d2acc48e1d3715b8b80b9e8347ded20 /src
parent7e729ca887f6e106f41acfc9f2081c31b446d114 (diff)
parentf09b12cea1143f1b2763064bb0d3e6592081de2b (diff)
downloadqtquick1-c95b119596c17d8430b24d5e10c4f48fd0a88cb1.tar.gz
Merge remote-tracking branch 'origin/5.3' into 5.4
Conflicts: .qmake.conf Change-Id: I842b005b9818c9e201a09d51bcf418e2dd0a1ef9
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp8
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp8
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp14
-rw-r--r--src/declarative/graphicsitems/qdeclarativerepeater.cpp11
4 files changed, 33 insertions, 8 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index c3e27e74..14e77ec6 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -2759,8 +2759,10 @@ void QDeclarativeGridView::trackedPositionChanged()
void QDeclarativeGridView::itemsInserted(int modelIndex, int count)
{
Q_D(QDeclarativeGridView);
- if (!isComponentComplete())
+ if (!isComponentComplete()) {
+ emit countChanged();
return;
+ }
int index = d->visibleItems.count() ? d->mapFromModel(modelIndex) : 0;
if (index < 0) {
@@ -2895,8 +2897,10 @@ void QDeclarativeGridView::itemsInserted(int modelIndex, int count)
void QDeclarativeGridView::itemsRemoved(int modelIndex, int count)
{
Q_D(QDeclarativeGridView);
- if (!isComponentComplete())
+ if (!isComponentComplete()) {
+ emit countChanged();
return;
+ }
d->itemCount -= count;
bool currentRemoved = d->currentIndex >= modelIndex && d->currentIndex < modelIndex + count;
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index a8d97fa7..a2beb4fe 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -3203,8 +3203,10 @@ void QDeclarativeListView::trackedPositionChanged()
void QDeclarativeListView::itemsInserted(int modelIndex, int count)
{
Q_D(QDeclarativeListView);
- if (!isComponentComplete())
+ if (!isComponentComplete()) {
+ emit countChanged();
return;
+ }
d->updateUnrequestedIndexes();
d->moveReason = QDeclarativeListViewPrivate::Other;
@@ -3356,8 +3358,10 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
void QDeclarativeListView::itemsRemoved(int modelIndex, int count)
{
Q_D(QDeclarativeListView);
- if (!isComponentComplete())
+ if (!isComponentComplete()) {
+ emit countChanged();
return;
+ }
d->moveReason = QDeclarativeListViewPrivate::Other;
d->updateUnrequestedIndexes();
d->itemCount -= count;
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
index 001d5d5b..c902e1c8 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp
@@ -1468,8 +1468,13 @@ void QDeclarativePathView::itemsInserted(int modelIndex, int count)
{
//XXX support animated insertion
Q_D(QDeclarativePathView);
- if (!d->isValid() || !isComponentComplete())
+ if (!d->isValid())
+ return;
+
+ if (!isComponentComplete()) {
+ emit countChanged();
return;
+ }
if (d->modelCount) {
d->itemCache += d->items;
@@ -1498,9 +1503,14 @@ void QDeclarativePathView::itemsRemoved(int modelIndex, int count)
{
//XXX support animated removal
Q_D(QDeclarativePathView);
- if (!d->model || !d->modelCount || !d->model->isValid() || !d->path || !isComponentComplete())
+ if (!d->model || !d->modelCount || !d->model->isValid() || !d->path)
return;
+ if (!isComponentComplete()) {
+ emit countChanged();
+ return;
+ }
+
// fix current
bool currentChanged = false;
if (d->currentIndex >= modelIndex + count) {
diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
index 43d20442..2fe36303 100644
--- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
@@ -373,8 +373,10 @@ void QDeclarativeRepeater::regenerate()
void QDeclarativeRepeater::itemsInserted(int index, int count)
{
Q_D(QDeclarativeRepeater);
- if (!isComponentComplete())
+ if (!isComponentComplete()) {
+ emit countChanged();
return;
+ }
for (int i = 0; i < count; ++i) {
int modelIndex = index + i;
QDeclarativeItem *item = d->model->item(modelIndex);
@@ -395,8 +397,13 @@ void QDeclarativeRepeater::itemsInserted(int index, int count)
void QDeclarativeRepeater::itemsRemoved(int index, int count)
{
Q_D(QDeclarativeRepeater);
- if (!isComponentComplete() || count <= 0)
+ if (count <= 0)
return;
+
+ if (!isComponentComplete()) {
+ emit countChanged();
+ return;
+ }
while (count--) {
QDeclarativeItem *item = d->deletables.takeAt(index);
emit itemRemoved(index, item);