MauiKit Controls

ListDelegate.qml
1/*
2 * Copyright 2018 Camilo Higuita <milo.h@aol.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License as
6 * published by the Free Software Foundation; either version 2, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20import QtQuick
21import QtQuick.Controls
22
23import org.mauikit.controls 1.3 as Maui
24
25/**
26 * @inherit ItemDelegate
27 * @brief A basic delagate for a label and an icon, to be used in a list browser.
28 * This controls inherits from MauiKit ItemDelegate, to checkout its inherited properties refer to docs.
29 *
30 * @note This is a simplified version fo the ListBrowserDelegate. The main difference is this one is not checkable.
31 */
32Maui.ItemDelegate
33{
34 id: control
35
36 implicitHeight: _template.implicitHeight + topPadding + bottomPadding
38 padding: Maui.Style.defaultPadding
39 spacing: Maui.Style.space.medium
40
41 /**
42 * @see ListItemTemplate::labelsVisible
43 */
44 property alias labelVisible : _template.labelsVisible
46 /**
47 * @see ListItemTemplate::iconSizeHint
48 */
49 property alias iconSize : _template.iconSizeHint
50
51 /**
52 * @see ListItemTemplate::iconVisible
53 */
54 property alias iconVisible : _template.iconVisible
55
56 /**
57 * @see ListItemTemplate::text1
58 */
59 property alias label: _template.text1
60
61 /**
62 * @see ListItemTemplate::text2
63 */
64 property alias label2: _template.text2
65
66 /**
67 * @see ListItemTemplate::iconSource
68 */
69 property alias iconName: _template.iconSource
70
71 /**
72 * @see An alias to the template item handling the information.
73 * @property ListItemTemplate ListDelegate::template
74 */
75 property alias template : _template
76
77 isCurrentItem : ListView.isCurrentItem
78
79 ToolTip.delay: 1000
80 ToolTip.timeout: 5000
81 ToolTip.visible: hovered
82 ToolTip.text: control.label
83
84 Maui.ListItemTemplate
85 {
86 id: _template
87 spacing: control.spacing
88
89 anchors.fill: parent
90 hovered: control.hovered
91 isCurrentItem: control.isCurrentItem
92 highlighted: control.containsPress
93 }
94}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:56:16 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.