Kirigami-addons

AbstractFormDelegate.qml
1/*
2 * Copyright 2022 Devin Lin <devin@kde.org>
3 * SPDX-License-Identifier: LGPL-2.0-or-later
4 */
5
6import QtQuick
7import QtQuick.Templates as T
8import QtQuick.Layouts
9
10import org.kde.kirigami as Kirigami
11
12/**
13 * @brief A base item for delegates to be used in a FormCard.
14 *
15 * This component can be used to create your own custom FormCard delegates.
16 *
17 * By default, it includes a background with hover and click feedback.
18 * Set the `background` property to Item {} to remove it.
19 *
20 * @since KirigamiAddons 0.11.0
21 *
22 * @see FormDelegateBackground
23 *
24 * @inherit QtQuick.Controls.ItemDelegate
25 */
26T.ItemDelegate {
27 id: root
28
29 horizontalPadding: Kirigami.Units.largeSpacing + Kirigami.Units.smallSpacing
30 verticalPadding: Kirigami.Units.largeSpacing + Kirigami.Units.smallSpacing
31
32 implicitWidth: contentItem.implicitWidth + leftPadding + rightPadding
33 implicitHeight: contentItem.implicitHeight + topPadding + bottomPadding
34
35 focusPolicy: Qt.StrongFocus
36 hoverEnabled: true
37 background: FormDelegateBackground { control: root }
38
39 icon {
40 width: Kirigami.Units.iconSizes.smallMedium
41 height: Kirigami.Units.iconSizes.smallMedium
42 }
43
44 Layout.fillWidth: true
45}
46
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:10:34 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.