summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativegridview.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-05-14 03:32:49 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-05-14 03:32:49 (GMT)
commitbea52aaaaf188293a5e235d5b5f96b386efba5ac (patch)
tree779458f9465af791d76ddd6b2e4c70aa33f22238 /src/declarative/graphicsitems/qdeclarativegridview.cpp
parent1e395c0ab9676995419ae8b20e4d95ad3fe11f31 (diff)
downloadQt-bea52aaaaf188293a5e235d5b5f96b386efba5ac.zip
Qt-bea52aaaaf188293a5e235d5b5f96b386efba5ac.tar.gz
Qt-bea52aaaaf188293a5e235d5b5f96b386efba5ac.tar.bz2
Add a "priority" property to Keys and KeyNavigation
Allows intercepting keys before or after normal item key processing. Task-number: QTBUG-10467
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativegridview.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index fe78c84..e1874b8 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -1651,6 +1651,9 @@ qreal QDeclarativeGridView::maxXExtent() const
void QDeclarativeGridView::keyPressEvent(QKeyEvent *event)
{
Q_D(QDeclarativeGridView);
+ keyPressPreHandler(event);
+ if (event->isAccepted())
+ return;
if (d->model && d->model->count() && d->interactive) {
d->moveReason = QDeclarativeGridViewPrivate::SetIndex;
int oldCurrent = currentIndex();
@@ -1676,10 +1679,8 @@ void QDeclarativeGridView::keyPressEvent(QKeyEvent *event)
}
}
d->moveReason = QDeclarativeGridViewPrivate::Other;
- QDeclarativeFlickable::keyPressEvent(event);
- if (event->isAccepted())
- return;
event->ignore();
+ QDeclarativeFlickable::keyPressEvent(event);
}
/*!