Warning, /frameworks/kirigami/src/controls/LoadingPlaceholder.qml is written in an unsupported language. File is not indexed.
0001 // SPDX-FileCopyrightText: 2022 Felipe Kinoshita <kinofhek@gmail.com>
0002 // SPDX-License-Identifier: GPL-2.0-or-later
0003
0004 import QtQuick
0005 import QtQuick.Controls as QQC2
0006 import QtQuick.Layouts
0007 import org.kde.kirigami as Kirigami
0008
0009 /**
0010 * @brief A placeholder for loading pages.
0011 *
0012 * Example usage:
0013 * @code{.qml}
0014 * Kirigami.Page {
0015 * Kirigami.LoadingPlaceholder {
0016 * anchors.centerIn: parent
0017 * }
0018 * }
0019 * @endcode
0020 * @code{.qml}
0021 * Kirigami.Page {
0022 * Kirigami.LoadingPlaceholder {
0023 * anchors.centerIn: parent
0024 * determinate: true
0025 * progressBar.value: loadingValue
0026 * }
0027 * }
0028 * @endcode
0029 * @inherit org::kde::kirigami::PlaceholderMessage
0030 */
0031 Kirigami.PlaceholderMessage {
0032 id: loadingPlaceholder
0033
0034 /**
0035 * @brief This property holds whether the loading message shows a
0036 * determinate progress bar or not.
0037 *
0038 * This should be true if you want to display the actual
0039 * percentage when it's loading.
0040 *
0041 * default: ``false``
0042 */
0043 property bool determinate: false
0044
0045 /**
0046 * @brief This property holds a progress bar.
0047 *
0048 * This should be used to access the progress bar to change its value.
0049 *
0050 * @property QtQuick.Controls.ProgressBar _progressBar
0051 */
0052 property alias progressBar: _progressBar
0053
0054 text: qsTr("Loading…")
0055
0056 QQC2.ProgressBar {
0057 id: _progressBar
0058 Layout.alignment: Qt.AlignHCenter
0059 Layout.fillWidth: true
0060 Layout.maximumWidth: Kirigami.Units.gridUnit * 20
0061 indeterminate: !determinate
0062 from: 0
0063 to: 100
0064 }
0065 }