diff options
author | Martin Jones <martin.jones@nokia.com> | 2011-04-12 15:09:48 +1000 |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2011-04-12 15:13:47 +1000 |
commit | c17150344510fc5fe239e39e6659bd16579586e8 (patch) | |
tree | 51871316a7636faa7327d346a1e061ea4b0b25ff /src | |
parent | ddae2b67a8eab5e6b298ce516234f4bf7c0367c1 (diff) | |
download | qt4-tools-c17150344510fc5fe239e39e6659bd16579586e8.tar.gz |
ListView has wrong keyPressEvent behaviour when vertical
Regression intorduced by RTL changes.
Change-Id: I272d07cd21d04f3e534aa183b1b10fcc8d062b79
Task-number: QTBUG-18581
Reviewed-by: Bea Lam
Diffstat (limited to 'src')
-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 4da45d1f66..cb751f6e66 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())) { |