Kirigami-addons

FormRadioSelectorDelegate.qml
1// SPDX-License-Identifier: GPL-2.0-or-later
2// SPDX-FileCopyrightText: 2023 Mathis BrĂ¼chert <mbb@kaidan.im>
3
4import QtQuick
5import org.kde.kirigami as Kirigami
6import org.kde.kirigamiaddons.components as Components
7
8/**
9* @brief A FormCard delegate that allows sitching between multiple options. This wraps a RadioSelector.
10*
11* Example:
12*
13* @code{.qml}
14* FormCard.FormRadioSelectorDelegate {
15* consistentWidth: false
16* actions: [
17* Kirigami.Action {
18* text: i18nc("@option:radio", "Week")
19* icon.name: "view-calendar-week-symbolic"
20* },
21* Kirigami.Action {
22* text: i18nc("@option:radio", "3 Days")
23* icon.name: "view-calendar-upcoming-days-symbolic"
24* },
25* Kirigami.Action {
26* text: i18nc("@option:radio", "1 Day")
27* icon.name: "view-calendar-day-symbolic"
28* }
29* ]
30* }
31* @endcode
32* @since Kirigami Addons 1.6.0.
33*/
34AbstractFormDelegate {
35 id: root
36
37 /**
38 * @brief This property holds a list of actions, each holding one of the options.
39 */
40 property alias actions: radioSelector.actions
42 /**
43 * @brief This property holds whether all the items should have the same width.
44 */
45 property alias consistentWidth: radioSelector.consistentWidth
46
47 /**
48 * @brief This property holds the currently selected option.
49 */
50 property alias selectedIndex: radioSelector.selectedIndex
51
52 topPadding: Kirigami.Units.largeSpacing
53 bottomPadding: Kirigami.Units.largeSpacing
54
55 background: null
56 contentItem: Components.RadioSelector {
57 id: radioSelector
58 }
59}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:49:32 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.