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
11import './private' as P
12
13/**
14 * @brief A base item for delegates to be used in a FormCard.
15 *
16 * This component can be used to create your own custom FormCard delegates.
17 *
18 * By default, it includes a background with hover and click feedback.
19 * Set the `background` property to Item {} to remove it.
20 *
21 * @since KirigamiAddons 0.11.0
22 *
23 * @see FormDelegateBackground
24 *
25 * @inherit QtQuick.Controls.ItemDelegate
26 */
27T.ItemDelegate {
28 id: root
29
30 horizontalPadding: P.FormCardUnits.horizontalPadding
31 verticalPadding: P.FormCardUnits.verticalPadding
32
33 implicitWidth: contentItem.implicitWidth + leftPadding + rightPadding
34 implicitHeight: contentItem.implicitHeight + topPadding + bottomPadding
35
36 focusPolicy: Qt.StrongFocus
37 hoverEnabled: true
38 background: FormDelegateBackground { control: root }
39
40 icon {
41 width: Kirigami.Units.iconSizes.smallMedium
42 height: Kirigami.Units.iconSizes.smallMedium
43 }
44
45 Layout.fillWidth: true
46}
47
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 1 2024 18:53:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.