Warning, /maui/mauikit/src/controls.5/AppViewLoader.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 * Copyright 2020 Camilo Higuita <milo.h@aol.com>
0003 *
0004 * This program is free software; you can redistribute it and/or modify
0005 * it under the terms of the GNU Library General Public License as
0006 * published by the Free Software Foundation; either version 2, or
0007 * (at your option) any later version.
0008 *
0009 * This program is distributed in the hope that it will be useful,
0010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0012 * GNU General Public License for more details
0013 *
0014 * You should have received a copy of the GNU Library General Public
0015 * License along with this program; if not, write to the
0016 * Free Software Foundation, Inc.,
0017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0018 */
0019
0020 import QtQuick 2.14
0021 import QtQuick.Controls 2.14
0022 import org.mauikit.controls 1.3 as Maui
0023
0024
0025 /*!
0026 \ since org.maui*kit.controls 1.0
0027 \inqmlmodule org.mauikit.controls
0028 \brief Lazy-loads app views
0029
0030 Wraps a component into a loader that is active only if it is the next, current or previous view in used, or if it has already been created.
0031 This component is useful when the AppViews has more then 4 different views to relief the loading of many views at the same time.
0032 */
0033 Loader
0034 {
0035 id: control
0036
0037 /*!
0038 \ qmlprope*rty Component ApplicationWindow::content
0039
0040 The source component to be loaded.
0041 */
0042 asynchronous: true
0043 default property alias content : control.sourceComponent
0044 active: (SwipeView.view.visible && SwipeView.isCurrentItem) || item
0045
0046 Maui.ProgressIndicator
0047 {
0048 width: parent.width
0049 anchors.bottom: parent.bottom
0050 visible: control.status === Loader.Loading
0051 }
0052 }