summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/fx/qfxgridview.cpp12
-rw-r--r--src/declarative/fx/qfxlistview.cpp8
2 files changed, 10 insertions, 10 deletions
diff --git a/src/declarative/fx/qfxgridview.cpp b/src/declarative/fx/qfxgridview.cpp
index 7e755fb..ff89717 100644
--- a/src/declarative/fx/qfxgridview.cpp
+++ b/src/declarative/fx/qfxgridview.cpp
@@ -1104,8 +1104,8 @@ void QFxGridView::keyPressEvent(QKeyEvent *event)
int index = currentIndex() - d->columns;
setCurrentIndex(index >= 0 ? index : d->model->count()-1);
event->accept();
+ return;
}
- return;
} else if ((d->flow == QFxGridView::LeftToRight && event->key() == Qt::Key_Down)
|| (d->flow == QFxGridView::TopToBottom && event->key() == Qt::Key_Right)) {
if (currentIndex() < d->model->count() - d->columns || d->wrap) {
@@ -1113,8 +1113,8 @@ void QFxGridView::keyPressEvent(QKeyEvent *event)
int index = currentIndex()+d->columns;
setCurrentIndex(index < d->model->count() ? index : 0);
event->accept();
+ return;
}
- return;
} else if ((d->flow == QFxGridView::LeftToRight && event->key() == Qt::Key_Left)
|| (d->flow == QFxGridView::TopToBottom && event->key() == Qt::Key_Up)) {
if (currentIndex() > 0 || d->wrap) {
@@ -1122,8 +1122,8 @@ void QFxGridView::keyPressEvent(QKeyEvent *event)
int index = currentIndex() - 1;
setCurrentIndex(index >= 0 ? index : d->model->count()-1);
event->accept();
+ return;
}
- return;
} else if ((d->flow == QFxGridView::LeftToRight && event->key() == Qt::Key_Right)
|| (d->flow == QFxGridView::TopToBottom && event->key() == Qt::Key_Down)) {
if (currentIndex() < d->model->count() - 1 || d->wrap) {
@@ -1131,13 +1131,13 @@ void QFxGridView::keyPressEvent(QKeyEvent *event)
int index = currentIndex() + 1;
setCurrentIndex(index < d->model->count() ? index : 0);
event->accept();
+ return;
}
- return;
}
}
d->moveReason = QFxGridViewPrivate::Other;
- if (!event->isAccepted())
- QFxFlickable::keyPressEvent(event);
+ event->ignore();
+ QFxFlickable::keyPressEvent(event);
}
/*!
diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp
index 9e08b69..5966e0d 100644
--- a/src/declarative/fx/qfxlistview.cpp
+++ b/src/declarative/fx/qfxlistview.cpp
@@ -1348,8 +1348,8 @@ void QFxListView::keyPressEvent(QKeyEvent *event)
int index = currentIndex()-1;
d->updateCurrent(index >= 0 ? index : d->model->count()-1);
event->accept();
+ return;
}
- return;
} else if ((d->orient == Qt::Horizontal && event->key() == Qt::Key_Right)
|| (d->orient == Qt::Vertical && event->key() == Qt::Key_Down)) {
if (currentIndex() < d->model->count() - 1 || d->wrap) {
@@ -1357,13 +1357,13 @@ void QFxListView::keyPressEvent(QKeyEvent *event)
int index = currentIndex()+1;
d->updateCurrent(index < d->model->count() ? index : 0);
event->accept();
+ return;
}
- return;
}
}
d->moveReason = QFxListViewPrivate::Other;
- if (!event->isAccepted())
- QFxFlickable::keyPressEvent(event);
+ event->ignore();
+ QFxFlickable::keyPressEvent(event);
}
void QFxListView::componentComplete()