summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx/qfxpathview.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-07-31 05:22:56 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-07-31 05:22:56 (GMT)
commitfc5af680d26aba684f4cbd4caa0440aabc3153d4 (patch)
tree3a98cee656f1b48f5db03223bb5ff27400e3c905 /src/declarative/fx/qfxpathview.cpp
parentcb9384b7ffb2f2cebba432c225a8d9a664ffd846 (diff)
parentfcabdbdf2867721a0925ade8c1dca6425b6aa632 (diff)
downloadQt-fc5af680d26aba684f4cbd4caa0440aabc3153d4.zip
Qt-fc5af680d26aba684f4cbd4caa0440aabc3153d4.tar.gz
Qt-fc5af680d26aba684f4cbd4caa0440aabc3153d4.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/fx/qfxpathview.cpp')
-rw-r--r--src/declarative/fx/qfxpathview.cpp19
1 files changed, 14 insertions, 5 deletions
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;