forked from qt-creator/qt-creator
This patch caches the last image from a document/model. The result ist that when reopening a file in the 3D editor the user sees immediately something. Since the view is not interactive, yet, we show a busy indicator until the view is fully initialized. Change-Id: I26c8b0ea69f98ceb41580624c51d48d1e633ab80 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
87 lines
2.7 KiB
QML
87 lines
2.7 KiB
QML
/****************************************************************************
|
|
**
|
|
** Copyright (C) 2022 The Qt Company Ltd.
|
|
** Contact: https://www.qt.io/licensing/
|
|
**
|
|
** This file is part of Qt Creator.
|
|
**
|
|
** Commercial License Usage
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
** accordance with the commercial license agreement provided with the
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
|
**
|
|
** GNU General Public License Usage
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
** General Public License version 3 as published by the Free Software
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
** included in the packaging of this file. Please review the following
|
|
** information to ensure the GNU General Public License requirements will
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
**
|
|
****************************************************************************/
|
|
|
|
import QtQuick
|
|
import QtQuick.Controls
|
|
|
|
BusyIndicator {
|
|
id: control
|
|
|
|
contentItem: Item {
|
|
implicitWidth: 64
|
|
implicitHeight: 64
|
|
|
|
Item {
|
|
id: item
|
|
anchors.centerIn: parent
|
|
width: 64
|
|
height: 64
|
|
opacity: control.running ? 1 : 0
|
|
|
|
Behavior on opacity {
|
|
OpacityAnimator {
|
|
duration: 250
|
|
}
|
|
}
|
|
|
|
RotationAnimator {
|
|
target: item
|
|
running: control.visible && control.running
|
|
from: 0
|
|
to: 360
|
|
loops: Animation.Infinite
|
|
duration: 2000
|
|
}
|
|
|
|
Repeater {
|
|
id: repeater
|
|
model: 6
|
|
|
|
Rectangle {
|
|
id: delegate
|
|
anchors.centerIn: parent
|
|
implicitWidth: 10
|
|
implicitHeight: 10
|
|
radius: 5
|
|
color: "#2aafd3"
|
|
|
|
required property int index
|
|
|
|
transform: [
|
|
Translate {
|
|
y: -Math.min(item.width, item.height) * 0.5 + 5
|
|
},
|
|
Rotation {
|
|
angle: delegate.index / repeater.count * 360
|
|
origin.x: 5
|
|
origin.y: 5
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|