KCMUtils

GridDelegateMenu.qml
1/*
2 SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7pragma ComponentBehavior: Bound
8
9import QtQuick
10import QtQuick.Controls as QQC2
11import QtQuick.Templates as T
12import org.kde.kirigami as Kirigami
13
14QQC2.Menu {
15 id: menu
16
17 function trigger() {
18 parent.clicked();
19 if (parent.actions.length > 0) {
20 popup(parent, thumbnail.x, thumbnail.y + thumbnail.height);
21 }
22 }
23
24 onClosed: parent.forceActiveFocus()
25
26 Repeater {
27 model: menu.parent.actions
28 delegate: QQC2.MenuItem {
29 required property Kirigami.Action modelData
30
31 text: modelData.text || modelData.tooltip
32 icon.name: modelData.icon.name
33 enabled: modelData.enabled
34 visible: modelData.visible
35
36 onTriggered: modelData.trigger()
37 }
38 }
39}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:20 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.