summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-07-31 05:21:36 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-07-31 05:21:36 (GMT)
commitfcabdbdf2867721a0925ade8c1dca6425b6aa632 (patch)
tree480d4ebafe58458ee080f23d6ea754543df25fec /src/declarative/fx
parent0377ff72f53f5b1a7f94014c2c074f43c8e64fe0 (diff)
parent3e74b943b05bdff967d6cbae108c1842f410f412 (diff)
downloadQt-fcabdbdf2867721a0925ade8c1dca6425b6aa632.zip
Qt-fcabdbdf2867721a0925ade8c1dca6425b6aa632.tar.gz
Qt-fcabdbdf2867721a0925ade8c1dca6425b6aa632.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/fx')
-rw-r--r--src/declarative/fx/qfxevents.cpp11
-rw-r--r--src/declarative/fx/qfxpathview.cpp19
2 files changed, 25 insertions, 5 deletions
diff --git a/src/declarative/fx/qfxevents.cpp b/src/declarative/fx/qfxevents.cpp
index 94c2d2e..f3a3427 100644
--- a/src/declarative/fx/qfxevents.cpp
+++ b/src/declarative/fx/qfxevents.cpp
@@ -106,6 +106,17 @@ Item {
*/
/*!
+ \qmlproperty bool KeyEvent::accepted
+
+ Setting \a accepted to true prevents the key event from being
+ propagated to the item's parent.
+
+ Generally, if the item acts on the key event then it should be accepted
+ so that ancestor items do not also respond to the same event.
+*/
+
+
+/*!
\qmlclass MouseEvent QFxMouseEvent
\brief The MouseEvent object provides information about a mouse event.
diff --git a/src/declarative/fx/qfxpathview.cpp b/src/declarative/fx/qfxpathview.cpp
index 6546f69..ee3ad2b 100644
--- a/src/declarative/fx/qfxpathview.cpp
+++ b/src/declarative/fx/qfxpathview.cpp
@@ -576,13 +576,16 @@ void QFxPathViewPrivate::regenerate()
int numItems = pathItems >= 0 ? pathItems : model->count();
for (int i=0; i < numItems && i < model->count(); ++i){
- QFxItem *item = getItem((i + firstIndex) % model->count());
+ int index = (i + firstIndex) % model->count();
+ QFxItem *item = getItem(index);
if (!item) {
qWarning() << "PathView: Cannot create item, index" << (i + firstIndex) % model->count();
return;
}
items.append(item);
item->setZValue(i);
+ if (currentIndex == index)
+ item->setFocus(true);
}
q->refill();
}
@@ -639,8 +642,11 @@ void QFxPathView::refill()
d->firstIndex++;
d->firstIndex %= d->model->count();
int index = (d->firstIndex + d->items.count())%d->model->count();
- d->items << d->getItem(index);
- d->items.last()->setZValue(wrapIndex);
+ QFxItem *item = d->getItem(index);
+ item->setZValue(wrapIndex);
+ if (d->currentIndex == index)
+ item->setFocus(true);
+ d->items << item;
d->pathOffset++;
d->pathOffset=d->pathOffset % d->items.count();
}
@@ -652,8 +658,11 @@ void QFxPathView::refill()
d->firstIndex--;
if (d->firstIndex < 0)
d->firstIndex = d->model->count() - 1;
- d->items.prepend(d->getItem(d->firstIndex));
- d->items.first()->setZValue(d->firstIndex);
+ QFxItem *item = d->getItem(d->firstIndex);
+ item->setZValue(d->firstIndex);
+ if (d->currentIndex == d->firstIndex)
+ item->setFocus(true);
+ d->items.prepend(item);
d->pathOffset--;
if (d->pathOffset < 0)
d->pathOffset = d->items.count() - 1;