Kirigami2

LoadingPlaceholder.qml
1// SPDX-FileCopyrightText: 2022 Felipe Kinoshita <kinofhek@gmail.com>
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4import QtQuick
5import QtQuick.Controls as QQC2
6import QtQuick.Layouts
7import org.kde.kirigami 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 */
31Kirigami.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-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:18:46 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.