summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-04-14 02:00:02 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-04-14 02:00:02 (GMT)
commit071f008b7f41575de364baa606652ef54502d636 (patch)
treeb3a6880e7f7351c60815219bc8c6dd79729b5b46 /src/declarative
parent428317f83fd8b7a62244a446b76299de050d1325 (diff)
parenta5ed6df017603118372f338d336c5e79f56886cd (diff)
downloadQt-071f008b7f41575de364baa606652ef54502d636.zip
Qt-071f008b7f41575de364baa606652ef54502d636.tar.gz
Qt-071f008b7f41575de364baa606652ef54502d636.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners.cpp9
3 files changed, 11 insertions, 6 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index fc7a87b..951b171 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -816,6 +816,8 @@ void QDeclarativeFlickable::wheelEvent(QGraphicsSceneWheelEvent *event)
d->vData.velocity = qMin(event->delta() - d->vData.smoothVelocity.value(), qreal(-250.0));
d->flicked = false;
d->flickY(d->vData.velocity);
+ if (d->flicked)
+ movementStarting();
event->accept();
} else if (xflick()) {
if (event->delta() > 0)
@@ -824,6 +826,8 @@ void QDeclarativeFlickable::wheelEvent(QGraphicsSceneWheelEvent *event)
d->hData.velocity = qMin(event->delta() - d->hData.smoothVelocity.value(), qreal(-250.0));
d->flicked = false;
d->flickX(d->hData.velocity);
+ if (d->flicked)
+ movementStarting();
event->accept();
} else {
QDeclarativeItem::wheelEvent(event);
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
index 06e3540..4aaa28d 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp
@@ -1102,7 +1102,6 @@ void QDeclarativePathView::refill()
// qDebug() << "append" << idx;
QDeclarativeItem *item = d->getItem(idx);
item->setZValue(idx+1);
- d->model->completeItem();
if (d->currentIndex == idx) {
item->setFocus(true);
if (QDeclarativePathViewAttached *att = d->attached(item))
@@ -1115,6 +1114,7 @@ void QDeclarativePathView::refill()
d->firstIndex = idx;
d->items.append(item);
d->updateItem(item, pos);
+ d->model->completeItem();
++idx;
if (idx >= d->model->count())
idx = 0;
@@ -1129,7 +1129,6 @@ void QDeclarativePathView::refill()
// qDebug() << "prepend" << idx;
QDeclarativeItem *item = d->getItem(idx);
item->setZValue(idx+1);
- d->model->completeItem();
if (d->currentIndex == idx) {
item->setFocus(true);
if (QDeclarativePathViewAttached *att = d->attached(item))
@@ -1140,6 +1139,7 @@ void QDeclarativePathView::refill()
}
d->items.prepend(item);
d->updateItem(item, pos);
+ d->model->completeItem();
d->firstIndex = idx;
idx = d->firstIndex - 1;
if (idx < 0)
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
index d33a8be..f436471 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
@@ -700,14 +700,15 @@ void QDeclarativeGrid::setRows(const int rows)
void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
{
- int c=_columns,r=_rows;//Actual number of rows/columns
+ int c = _columns;
+ int r = _rows;
int numVisible = positionedItems.count();
- if (_columns==-1 && _rows==-1){
+ if (_columns <= 0 && _rows <= 0){
c = 4;
r = (numVisible+3)/4;
- }else if (_rows==-1){
+ } else if (_rows <= 0){
r = (numVisible+(_columns-1))/_columns;
- }else if (_columns==-1){
+ } else if (_columns <= 0){
c = (numVisible+(_rows-1))/_rows;
}