Allow keyboard navigation keys to be customized.
authorMitch Curtis <mitch.curtis@digia.com>
Wed, 29 Jan 2014 16:52:28 +0000 (17:52 +0100)
committerJens Bache-Wiig <jens.bache-wiig@digia.com>
Fri, 31 Jan 2014 09:02:32 +0000 (10:02 +0100)
commit2a6aff7c8ab37fb71ae4e9547de899fd339d6831
treece131f43a283cdeb5d645cc0abf85062b0bdf272
parent7c44e88269847b8cda306ee30ca953c9f206dde0
Allow keyboard navigation keys to be customized.

This change adds select* functions. These functions encapsulate the
common methods of interacting with the calendar via the keyboard, so
that it is possible to specify custom navigation keys:

Calendar {
    id: calendar

    Keys.onLeftPressed: {}
    Keys.onRightPressed: {}
    Keys.onUpPressed: {}
    Keys.onDownPressed: {}

    Keys.onPressed: {
        if (event.key === Qt.Key_W) {
            calendar.selectPreviousWeek();
            event.accepted = true;
        } else if (...) {
            ...
        } ...
    }
}

Change-Id: Ic82660f657eaadacd9a170baf07efbabf3eda332
Reviewed-by: Liang Qi <liang.qi@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
src/controls/Calendar.qml
src/controls/Styles/Base/CalendarStyle.qml
src/controls/Styles/Desktop/CalendarStyle.qml
tests/auto/controls/data/tst_calendar.qml