Warning, /frameworks/kglobalaccel/tests/kglobalacceltest.qml is written in an unsupported language. File is not indexed.
0001 /* 0002 This file is part of the KDE libraries 0003 0004 SPDX-FileCopyrightText: 2022 Aleix Pol Gonzalez <aleixpol@kde.org> 0005 0006 SPDX-License-Identifier: LGPL-2.0-or-later 0007 */ 0008 0009 import QtQuick 2.15 0010 import QtQuick.Controls 2.15 0011 import org.kde.kquickcontrols 2.0 0012 import org.kde.globalaccel 1.0 0013 0014 ApplicationWindow 0015 { 0016 visible: true 0017 0018 ListView { 0019 anchors.fill: parent 0020 model: ListModel { 0021 ListElement { text: "Hola1"; sequence: "Meta+X" } 0022 ListElement { text: "Hola2"; sequence: "Meta+Shift+X" } 0023 ListElement { text: "Hola3"; sequence: "Meta+Y" } 0024 } 0025 0026 delegate: Rectangle { 0027 width: parent.width 0028 height: 100 0029 color: action.active ? "green" : "yellow" 0030 0031 GlobalAction { 0032 id: action 0033 text: model.text 0034 onTriggered: console.log("triggered", text) 0035 objectName: "org.kde.globalaccel.test.globalacceltest."+model.text 0036 shortcut: sequenceItem.keySequence 0037 } 0038 0039 KeySequenceItem 0040 { 0041 id: sequenceItem 0042 modifierlessAllowed: false 0043 keySequence: model.sequence 0044 } 0045 } 0046 } 0047 }