• Skip to content
  • Skip to link menu
Brand

API Documentation

  1. KDE API Reference
  2. Kirigami
  • KDE Home
  • Contact Us

Quick Links

Skip menu "Kirigami"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • File List
  • Related Pages

Class Picker

About

QtQuick plugins to build user interfaces based on the KDE UX guidelines

Maintainer
Marco Martin
Supported platforms
Android, Linux
Community
IRC: #plasma on Freenode
Mailing list: plasma-devel
Use with CMake
find_package(KF5Kirigami)
target_link_libraries(yourapp KF5::Kirigami)
Clone
git clone git://anongit.kde.org/kirigami1.git
Browse source
Kirigami on cgit.kde.org

Kirigami

  • src
  • controls
  • templates
controls/templates/AbstractListItem.qml
1 /*
2  * Copyright 2010 Marco Martin <notmart@gmail.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 Library 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 2.010-1301, USA.
18  */
19 
20 import QtQuick 2.1
21 import QtQuick.Layouts 1.0
22 import QtQuick.Controls 1.0 as Controls
23 import QtQuick.Controls.Private 1.0
24 import org.kde.kirigami 1.0
25 
33 Item {
34  id: listItem
35 
43  default property Item contentItem
44 
51  property alias supportsMouseEvents: itemMouse.enabled
52 
60  signal clicked
61 
62 
71  signal pressAndHold
72 
78  property bool checked: false
79 
85  property alias pressed: itemMouse.pressed
86 
92  property alias containsMouse: itemMouse.containsMouse
93 
99  property bool sectionDelegate: false
100 
106  property bool separatorVisible: true
107 
117  property Item background
118 
127  property color textColor: Theme.viewTextColor
128 
134  property color backgroundColor: Theme.viewBackgroundColor
135 
144  property color activeTextColor: Theme.highlightedTextColor
145 
151  property color activeBackgroundColor: Theme.highlightColor
152 
153  implicitWidth: contentItem ? contentItem.childrenRect.width : 0
154 
155  implicitHeight: contentItem.height + Units.smallSpacing * 5
156 
157  width: parent ? parent.width : implicitWidth
158  Layout.fillWidth: true
159 
160  opacity: enabled ? 1 : 0.6
161 
162  height: visible ? implicitHeight : 0
163 
164  onContentItemChanged: {
165  contentItem.parent = paddingItem;
166  }
167 
168  Component.onCompleted: {
169  itemMouse.integrateBackground()
170  }
171 
172  MouseArea {
173  id: itemMouse
174  anchors.fill: parent
175  enabled: true
176  hoverEnabled: !Settings.isMobile
177 
178  onClicked: listItem.clicked()
179  onPressAndHold: listItem.pressAndHold()
180 
181  Item {
182  id: paddingItem
183  z: 2
184  anchors {
185  fill: parent
186  margins: Units.smallSpacing
187  }
188  }
189 
190  function integrateBackground() {
191  if (background) {
192  background.parent = itemMouse;
193  background.anchors.fill = itemMouse;
194  }
195  }
196  }
197 
198  onBackgroundChanged: {
199  itemMouse.integrateBackground()
200  }
201 
202  Accessible.role: Accessible.ListItem
203 }
org::kde::kirigami::Units::smallSpacing
int smallSpacing
units.smallSpacing is the amount of spacing that should be used around smaller UI elements...
Definition: controls/Units.qml:56
org::kde::kirigami::Theme
Definition: controls/Theme.qml:22
org::kde::kirigami::Units
Definition: controls/Units.qml:24
This file is part of the KDE documentation.
Documentation copyright © 1996-2017 The KDE developers.
Generated on Fri Feb 17 2017 11:09:23 by doxygen 1.8.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal