Kirigami2

LoadingPlaceholder.qml
1 // SPDX-FileCopyrightText: 2022 Felipe Kinoshita <[email protected]>
2 // SPDX-License-Identifier: GPL-2.0-or-later
3 
4 import QtQuick 2.15
5 import QtQuick.Controls 2.15 as QQC2
6 import QtQuick.Layouts 1.15
7 import org.kde.kirigami 2.19 as Kirigami
8 
9 /**
10  * @brief A placeholder for loading pages.
11  *
12  * Example usage:
13  * @code{.qml}
14  * Kirigami.Page {
15  * Kirigami.LoadingPlaceholder {
16  * anchors.centerIn: parent
17  * }
18  * }
19  * @endcode
20  * @code{.qml}
21  * Kirigami.Page {
22  * Kirigami.LoadingPlaceholder {
23  * anchors.centerIn: parent
24  * determinate: true
25  * progressBar.value: loadingValue
26  * }
27  * }
28  * @endcode
29  * @inherit org::kde::kirigami::PlaceholderMessage
30  */
31 Kirigami.PlaceholderMessage {
32  id: loadingPlaceholder
33 
34  /**
35  * @brief This property holds whether the loading message shows a
36  * determinate progress bar or not.
37  *
38  * This should be true if you want to display the actual
39  * percentage when it's loading.
40  *
41  * default: ``false``
42  */
43  property bool determinate: false
44 
45  /**
46  * @brief This property holds a progress bar.
47  *
48  * This should be used to access the progress bar to change its value.
49  *
50  * @property QtQuick.Controls.ProgressBar _progressBar
51  */
52  property alias progressBar: _progressBar
53 
54  text: qsTr("Loading…")
55 
56  QQC2.ProgressBar {
57  id: _progressBar
58  Layout.alignment: Qt.AlignHCenter
59  Layout.fillWidth: true
60  Layout.maximumWidth: Kirigami.Units.gridUnit * 20
61  indeterminate: !determinate
62  from: 0
63  to: 100
64  }
65 }
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.