From 4a01dc326faa0bc7d61f67e8848e194c3c3b99c5 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 12 Nov 2010 15:54:50 +1000 Subject: Fix PathView key navigation docs. Task-number: QTBUG-15222 Reviewed-by: Yann Bodson --- src/declarative/graphicsitems/qdeclarativepathview.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp index ea929cf..926bec2 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview.cpp +++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp @@ -373,7 +373,21 @@ void QDeclarativePathViewPrivate::regenerate() opacity of the items as they rotate. This additional code can be seen in the PathAttribute documentation.) - The \c focus can be set to \c true to enable keyboard navigation. + PathView does not automatically handle keyboard navigation. This is because + the keys to use for navigation will depend upon the shape of the path. Navigation + can be added quite simply by setting \c focus to \c true and calling + \l decrementCurrentIndex() or \l incrementCurrentIndex(), for example to navigate + using the left and right arrow keys: + + \code + PathView { + ... + focus: true + Keys.onLeftPressed: decrementCurrentIndex() + Keys.onRightPressed: incrementCurrentIndex() + } + \endcode + The path view itself is a focus scope (see \l{qmlfocus#Acquiring Focus and Focus Scopes}{the focus documentation page} for more details). Delegates are instantiated as needed and may be destroyed at any time. -- cgit v0.12