Kirigami2

FlexColumn.qml
1 /*
2  * SPDX-FileCopyrightText: 2020 Carson Black <[email protected]>
3  *
4  * SPDX-License-Identifier: LGPL-2.0-or-later
5  */
6 
7 import QtQuick 2.12
8 import QtQuick.Layouts 1.12
9 import org.kde.kirigami 2.13 as Kirigami
10 
11 //TODO KF6: how much is this used? can be removed?
12 /**
13  * @brief FlexColumn is a column that grows in width to a fixed cap.
14  * @inherit QtQuick.Layouts.ColumnLayout
15  */
16 ColumnLayout {
17  id: __outer
18 
19  default property alias columnChildren: __inner.children
20 
21  /**
22  * @brief This property holds the column's offset from the cross axis.
23  *
24  * Note that padding is applied on both sides
25  * when the column is aligned to a centered cross axis.
26  *
27  * default: ``Kirigami.Units.largeSpacing``
28  */
29  property real padding: Kirigami.Units.largeSpacing
30 
31  /**
32  * @brief This property holds maximum column width.
33  *
34  * default: ``Kirigami.Units.gridUnit * 50``
35  */
36  property real maximumWidth: Kirigami.Units.gridUnit * 50
37 
38  /**
39  * @brief This property sets column's alignment when it hits its maximum width.
40  *
41  * default: ``Qt.AlignHCenter | Qt.AlignTop``
42  *
43  * @property Qt::Alignment alignment
44  */
45  property int alignment: Qt.AlignHCenter | Qt.AlignTop
46 
47  Layout.fillWidth: true
48  Layout.fillHeight: true
49 
50  enum CrossAxis {
51  Left,
52  Center,
53  Right
54  }
55 
56  ColumnLayout {
57  id: __inner
58  Layout.maximumWidth: __outer.maximumWidth
59  Layout.leftMargin: __outer.alignment & Qt.AlignLeft || __outer.alignment & Qt.AlignHCenter ? __outer.padding : 0
60  Layout.rightMargin: __outer.alignment & Qt.AlignRight || __outer.alignment & Qt.AlignHCenter ? __outer.padding : 0
61  Layout.alignment: __outer.alignment
62  }
63 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Jan 29 2023 04:11:03 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.