aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickitem2/data
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2013-05-30 17:06:58 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-01 18:02:33 +0200
commitea045d82a3a837f83fec82462feebf2bc262f9d9 (patch)
tree5236ec962b89f3fdc883fc2fa813bdbe9317ba81 /tests/auto/quick/qquickitem2/data
parent101a5185138f4eb4d1ed0e69065d8e4c30a7fff7 (diff)
Add bool QQuickKeyEvent::matches(QKeySequence::StandardKey)
Change-Id: Iaa8392c1b113856fa80cd2507f8640050eb9bec2 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Diffstat (limited to 'tests/auto/quick/qquickitem2/data')
-rw-r--r--tests/auto/quick/qquickitem2/data/standardkeys.qml57
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickitem2/data/standardkeys.qml b/tests/auto/quick/qquickitem2/data/standardkeys.qml
new file mode 100644
index 0000000000..c29a143c28
--- /dev/null
+++ b/tests/auto/quick/qquickitem2/data/standardkeys.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.2
+
+Item {
+ focus: true
+
+ property bool pressed: false
+ property bool released: false
+
+ Keys.onPressed: {
+ pressed = event.matches(standardKey)
+ }
+
+ Keys.onReleased: {
+ released = event.matches(standardKey)
+ }
+}