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 2.15
7import QtQuick.Templates 2.15 as T
8import QtQuick.Layouts 1.15
9
10import org.kde.kirigami 2.12 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: parent._internal_formcard_margins ? parent._internal_formcard_margins : Kirigami.Units.gridUnit
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 Layout.fillWidth: true
40}
41
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 3 2024 11:46:57 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.