summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2010-10-22 07:29:28 (GMT)
committerSami Merila <sami.merila@nokia.com>2010-10-22 07:29:28 (GMT)
commite853b240e1b974067aa1bc377c0ae01a60e9c274 (patch)
tree0adb9e777bb11d5e04dea2016b0a1632afd28510 /src
parent80d7253b5881ed7f1e2a175c66f1f3ed57773227 (diff)
parentdb08a136e5999a82869269af09323222ff2c6e1d (diff)
downloadQt-e853b240e1b974067aa1bc377c0ae01a60e9c274.zip
Qt-e853b240e1b974067aa1bc377c0ae01a60e9c274.tar.gz
Qt-e853b240e1b974067aa1bc377c0ae01a60e9c274.tar.bz2
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp36
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable_p.h2
-rw-r--r--src/gui/itemviews/qitemselectionmodel.cpp13
-rw-r--r--src/plugins/graphicssystems/meego/qmeegographicssystem.cpp5
4 files changed, 43 insertions, 13 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 2e5a43d..b737785 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -483,9 +483,9 @@ qreal QDeclarativeFlickable::contentX() const
void QDeclarativeFlickable::setContentX(qreal pos)
{
Q_D(QDeclarativeFlickable);
- pos = qRound(pos);
d->timeline.reset(d->hData.move);
d->vTime = d->timeline.time();
+ movementXEnding();
if (-pos != d->hData.move.value()) {
d->hData.move.setValue(-pos);
viewportMoved();
@@ -501,9 +501,9 @@ qreal QDeclarativeFlickable::contentY() const
void QDeclarativeFlickable::setContentY(qreal pos)
{
Q_D(QDeclarativeFlickable);
- pos = qRound(pos);
d->timeline.reset(d->vData.move);
d->vTime = d->timeline.time();
+ movementYEnding();
if (-pos != d->vData.move.value()) {
d->vData.move.setValue(-pos);
viewportMoved();
@@ -1516,6 +1516,15 @@ void QDeclarativeFlickable::movementStarting()
void QDeclarativeFlickable::movementEnding()
{
Q_D(QDeclarativeFlickable);
+ movementXEnding();
+ movementYEnding();
+ d->hData.smoothVelocity.setValue(0);
+ d->vData.smoothVelocity.setValue(0);
+}
+
+void QDeclarativeFlickable::movementXEnding()
+{
+ Q_D(QDeclarativeFlickable);
if (d->flickingHorizontally) {
d->flickingHorizontally = false;
emit flickingChanged();
@@ -1523,13 +1532,6 @@ void QDeclarativeFlickable::movementEnding()
if (!d->flickingVertically)
emit flickEnded();
}
- if (d->flickingVertically) {
- d->flickingVertically = false;
- emit flickingChanged();
- emit flickingVerticallyChanged();
- if (!d->flickingHorizontally)
- emit flickEnded();
- }
if (!d->pressed && !d->stealMouse) {
if (d->movingHorizontally) {
d->movingHorizontally = false;
@@ -1539,6 +1541,20 @@ void QDeclarativeFlickable::movementEnding()
if (!d->movingVertically)
emit movementEnded();
}
+ }
+}
+
+void QDeclarativeFlickable::movementYEnding()
+{
+ Q_D(QDeclarativeFlickable);
+ if (d->flickingVertically) {
+ d->flickingVertically = false;
+ emit flickingChanged();
+ emit flickingVerticallyChanged();
+ if (!d->flickingHorizontally)
+ emit flickEnded();
+ }
+ if (!d->pressed && !d->stealMouse) {
if (d->movingVertically) {
d->movingVertically = false;
d->vMoved = false;
@@ -1548,8 +1564,6 @@ void QDeclarativeFlickable::movementEnding()
emit movementEnded();
}
}
- d->hData.smoothVelocity.setValue(0);
- d->vData.smoothVelocity.setValue(0);
}
void QDeclarativeFlickablePrivate::updateVelocity()
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p.h
index 4fb9c25..6e4d8ed 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeflickable_p.h
@@ -190,6 +190,8 @@ protected Q_SLOTS:
void movementEnding();
protected:
+ void movementXEnding();
+ void movementYEnding();
virtual qreal minXExtent() const;
virtual qreal minYExtent() const;
virtual qreal maxXExtent() const;
diff --git a/src/gui/itemviews/qitemselectionmodel.cpp b/src/gui/itemviews/qitemselectionmodel.cpp
index f848321..e69cd65 100644
--- a/src/gui/itemviews/qitemselectionmodel.cpp
+++ b/src/gui/itemviews/qitemselectionmodel.cpp
@@ -1059,6 +1059,19 @@ void QItemSelectionModel::select(const QItemSelection &selection, QItemSelection
// store old selection
QItemSelection sel = selection;
+ // If d->ranges is non-empty when the source model is reset the persistent indexes
+ // it contains will be invalid. We can't clear them in a modelReset slot because that might already
+ // be too late if another model observer is connected to the same modelReset slot and is invoked first
+ // it might call select() on this selection model before any such QItemSelectionModelPrivate::_q_modelReset() slot
+ // is invoked, so it would not be cleared yet. We clear it invalid ranges in it here.
+ QItemSelection::iterator it = d->ranges.begin();
+ while (it != d->ranges.end()) {
+ if (!it->isValid())
+ it = d->ranges.erase(it);
+ else
+ ++it;
+ }
+
QItemSelection old = d->ranges;
old.merge(d->currentSelection, d->currentCommand);
diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
index 27e728a..772db44 100644
--- a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
+++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
@@ -150,8 +150,9 @@ void QMeeGoGraphicsSystem::setTranslucent(bool translucent)
QPixmapData *QMeeGoGraphicsSystem::pixmapDataFromEGLSharedImage(Qt::HANDLE handle, const QImage &softImage)
{
if (softImage.format() != QImage::Format_ARGB32_Premultiplied &&
- softImage.format() != QImage::Format_ARGB32) {
- qFatal("For egl shared images, the soft image has to be ARGB32 or ARGB32_Premultiplied");
+ softImage.format() != QImage::Format_ARGB32 &&
+ softImage.format() != QImage::Format_RGB32) {
+ qFatal("For egl shared images, the soft image has to be ARGB32, ARGB32_Premultiplied or RGB32");
return NULL;
}