summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-08-17 00:44:33 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-08-17 00:44:33 (GMT)
commit276c88708a5c9689a3123a355924a53898fe890c (patch)
treed42e222d9c4af85ecc3b7e970aef5c1c41165bf4
parent02e5239002786a55d68f04a512baa7d4c5f40e66 (diff)
downloadQt-276c88708a5c9689a3123a355924a53898fe890c.zip
Qt-276c88708a5c9689a3123a355924a53898fe890c.tar.gz
Qt-276c88708a5c9689a3123a355924a53898fe890c.tar.bz2
Ignore key events that we don't handle.
-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()