on xenial help sign in
Copyright + remove key handling
673e1c3Albert Astals
tests/plugins/ListViewWithPageHeader/test.qml+16−20
@@ -1,3 +1,19 @@
1+/*
2+ * Copyright (C) 2013 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
1import QtQuick 2.0
17import QtQuick 2.0
2import ListViewWithPageHeader 0.1
18import ListViewWithPageHeader 0.1
3
19
@@ -6,26 +22,6 @@ Rectangle {
6 height: 542
22 height: 542
7 color: "lightblue"
23 color: "lightblue"
8
24
9− focus: true
10− Keys.onPressed: {
11− if (event.key == Qt.Key_B) {
12− listView.positionAtBeginning()
13− } else if (event.key == Qt.Key_1) {
14− animalsModel.setProperty(0, "size", 400);
15− } else if (event.key == Qt.Key_2) {
16− animalsModel.setProperty(1, "size", 400);
17− } else if (event.key == Qt.Key_3) {
18− animalsModel.setProperty(1, "size", 10);
19− } else if (event.key == Qt.Key_H) {
20− listView.headerItem.height = 100
21− } else if (event.key == Qt.Key_D) {
22− listView.delegate = otherRect
23− } else if (event.key == Qt.Key_F) {
24− listView.header = null
25− }
26− }
27−
28−
29 ListModel {
25 ListModel {
30 id: model
26 id: model
31
27