diff options
author | Martin Jones <martin.jones@nokia.com> | 2011-04-12 05:09:48 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2011-04-12 05:13:47 (GMT) |
commit | c17150344510fc5fe239e39e6659bd16579586e8 (patch) | |
tree | 51871316a7636faa7327d346a1e061ea4b0b25ff | |
parent | ddae2b67a8eab5e6b298ce516234f4bf7c0367c1 (diff) | |
download | Qt-c17150344510fc5fe239e39e6659bd16579586e8.zip Qt-c17150344510fc5fe239e39e6659bd16579586e8.tar.gz Qt-c17150344510fc5fe239e39e6659bd16579586e8.tar.bz2 |
ListView has wrong keyPressEvent behaviour when vertical
Regression intorduced by RTL changes.
Change-Id: I272d07cd21d04f3e534aa183b1b10fcc8d062b79
Task-number: QTBUG-18581
Reviewed-by: Bea Lam
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativelistview.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 4da45d1..cb751f6 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -2770,7 +2770,7 @@ void QDeclarativeListView::keyPressEvent(QKeyEvent *event) return; if (d->model && d->model->count() && d->interactive) { - if ((!d->isRightToLeft() && event->key() == Qt::Key_Left) + if ((d->orient == QDeclarativeListView::Horizontal && !d->isRightToLeft() && event->key() == Qt::Key_Left) || (d->orient == QDeclarativeListView::Horizontal && d->isRightToLeft() && event->key() == Qt::Key_Right) || (d->orient == QDeclarativeListView::Vertical && event->key() == Qt::Key_Up)) { if (currentIndex() > 0 || (d->wrap && !event->isAutoRepeat())) { @@ -2781,7 +2781,7 @@ void QDeclarativeListView::keyPressEvent(QKeyEvent *event) event->accept(); return; } - } else if ((!d->isRightToLeft() && event->key() == Qt::Key_Right) + } else if ((d->orient == QDeclarativeListView::Horizontal && !d->isRightToLeft() && event->key() == Qt::Key_Right) || (d->orient == QDeclarativeListView::Horizontal && d->isRightToLeft() && event->key() == Qt::Key_Left) || (d->orient == QDeclarativeListView::Vertical && event->key() == Qt::Key_Down)) { if (currentIndex() < d->model->count() - 1 || (d->wrap && !event->isAutoRepeat())) { |