summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/graphicsitems')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader.cpp9
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader_p_p.h1
-rw-r--r--src/declarative/graphicsitems/qdeclarativescalegrid.cpp10
6 files changed, 15 insertions, 16 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index a713bf0..ba5e12c 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -299,7 +299,7 @@ void QDeclarativeFlickablePrivate::fixup(AxisData &data, qreal minExtent, qreal
timeline.move(data.move, maxExtent - dist/2, QEasingCurve(QEasingCurve::InQuad), fixupDuration/4);
timeline.move(data.move, maxExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4);
} else {
- timeline.set(data.move, minExtent);
+ timeline.set(data.move, maxExtent);
}
}
vTime = timeline.time();
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index 5669812..6a6ff64 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -2139,13 +2139,15 @@ void QDeclarativeGridViewPrivate::positionViewAtIndex(int index, int mode)
layout();
qreal pos = position();
FxGridItem *item = visibleItem(idx);
+ qreal maxExtent = flow == QDeclarativeGridView::LeftToRight ? -q->maxYExtent() : -q->maxXExtent();
if (!item) {
int itemPos = rowPosAt(idx);
// save the currently visible items in case any of them end up visible again
QList<FxGridItem*> oldVisible = visibleItems;
visibleItems.clear();
visibleIndex = idx - idx % columns;
- setPosition(itemPos);
+ maxExtent = flow == QDeclarativeGridView::LeftToRight ? -q->maxYExtent() : -q->maxXExtent();
+ setPosition(qMin(qreal(itemPos), maxExtent));
// now release the reference to all the old visible items.
for (int i = 0; i < oldVisible.count(); ++i)
releaseItem(oldVisible.at(i));
@@ -2185,7 +2187,6 @@ void QDeclarativeGridViewPrivate::positionViewAtIndex(int index, int mode)
if (itemPos < pos)
pos = itemPos;
}
- qreal maxExtent = flow == QDeclarativeGridView::LeftToRight ? -q->maxYExtent() : -q->maxXExtent();
pos = qMin(pos, maxExtent);
qreal minExtent = flow == QDeclarativeGridView::LeftToRight ? -q->minYExtent() : -q->minXExtent();
pos = qMax(pos, minExtent);
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index da1e33d..cbc4311 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -2572,6 +2572,7 @@ void QDeclarativeListViewPrivate::positionViewAtIndex(int index, int mode)
layout();
qreal pos = position();
FxListItem *item = visibleItem(idx);
+ qreal maxExtent = orient == QDeclarativeListView::Vertical ? -q->maxYExtent() : -q->maxXExtent();
if (!item) {
int itemPos = positionAt(idx);
// save the currently visible items in case any of them end up visible again
@@ -2579,7 +2580,7 @@ void QDeclarativeListViewPrivate::positionViewAtIndex(int index, int mode)
visibleItems.clear();
visiblePos = itemPos;
visibleIndex = idx;
- setPosition(itemPos);
+ setPosition(qMin(qreal(itemPos), maxExtent));
// now release the reference to all the old visible items.
for (int i = 0; i < oldVisible.count(); ++i)
releaseItem(oldVisible.at(i));
@@ -2613,7 +2614,6 @@ void QDeclarativeListViewPrivate::positionViewAtIndex(int index, int mode)
if (itemPos < pos)
pos = itemPos;
}
- qreal maxExtent = orient == QDeclarativeListView::Vertical ? -q->maxYExtent() : -q->maxXExtent();
pos = qMin(pos, maxExtent);
qreal minExtent = orient == QDeclarativeListView::Vertical ? -q->minYExtent() : -q->minXExtent();
pos = qMax(pos, minExtent);
diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp
index b5f8b1d..562ef08 100644
--- a/src/declarative/graphicsitems/qdeclarativeloader.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp
@@ -48,7 +48,7 @@
QT_BEGIN_NAMESPACE
QDeclarativeLoaderPrivate::QDeclarativeLoaderPrivate()
- : item(0), component(0), ownComponent(false), isComponentComplete(false), updatingSize(false),
+ : item(0), component(0), ownComponent(false), updatingSize(false),
itemWidthValid(false), itemHeightValid(false)
{
}
@@ -279,7 +279,7 @@ void QDeclarativeLoader::setSource(const QUrl &url)
d->component = new QDeclarativeComponent(qmlEngine(this), d->source, this);
d->ownComponent = true;
- if (d->isComponentComplete)
+ if (isComponentComplete())
d->load();
}
@@ -330,7 +330,7 @@ void QDeclarativeLoader::setSourceComponent(QDeclarativeComponent *comp)
return;
}
- if (d->isComponentComplete)
+ if (isComponentComplete())
d->load();
}
@@ -343,7 +343,7 @@ void QDeclarativeLoaderPrivate::load()
{
Q_Q(QDeclarativeLoader);
- if (!isComponentComplete || !component)
+ if (!q->isComponentComplete() || !component)
return;
if (!component->isLoading()) {
@@ -477,7 +477,6 @@ void QDeclarativeLoader::componentComplete()
Q_D(QDeclarativeLoader);
QDeclarativeItem::componentComplete();
- d->isComponentComplete = true;
d->load();
}
diff --git a/src/declarative/graphicsitems/qdeclarativeloader_p_p.h b/src/declarative/graphicsitems/qdeclarativeloader_p_p.h
index 6a40bf3..4593dfc 100644
--- a/src/declarative/graphicsitems/qdeclarativeloader_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeloader_p_p.h
@@ -78,7 +78,6 @@ public:
QGraphicsObject *item;
QDeclarativeComponent *component;
bool ownComponent : 1;
- bool isComponentComplete : 1;
bool updatingSize: 1;
bool itemWidthValid : 1;
bool itemHeightValid : 1;
diff --git a/src/declarative/graphicsitems/qdeclarativescalegrid.cpp b/src/declarative/graphicsitems/qdeclarativescalegrid.cpp
index 804e91d..3ad0da6 100644
--- a/src/declarative/graphicsitems/qdeclarativescalegrid.cpp
+++ b/src/declarative/graphicsitems/qdeclarativescalegrid.cpp
@@ -136,12 +136,12 @@ QDeclarativeGridScaledImage::QDeclarativeGridScaledImage(QIODevice *data)
if (line.isEmpty() || line.startsWith(QLatin1Char('#')))
continue;
- QStringList list = line.split(QLatin1Char(':'));
- if (list.count() != 2)
+ int colonId = line.indexOf(QLatin1Char(':'));
+ if (colonId <= 0)
return;
-
- list[0] = list[0].trimmed();
- list[1] = list[1].trimmed();
+ QStringList list;
+ list.append(line.left(colonId).trimmed());
+ list.append(line.mid(colonId+1).trimmed());
if (list[0] == QLatin1String("border.left"))
l = list[1].toInt();