C

Qt Quick Ultralite studio_components Example

/****************************************************************************** ** ** Copyright (C) 2023 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Quick Ultralite module. ** ** $QT_BEGIN_LICENSE:COMM$ ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with thes ** 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 http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** $QT_END_LICENSE$ ** ******************************************************************************/
import QtQuick Item { id: root property bool activated: false property bool hasOutlineArc: true signal changeArcWidth(int arcWidth) signal changeFillColor(int colorNumber) signal switchOutlineArc signal switchRound function restart() { root.activated = false; tmIdle.restart(); } Timer { id: tmIdle interval: 10000 repeat: true running: true onTriggered: { root.activated = true; } } Timer { id: tmOutlineArc interval: root.hasOutlineArc ? 12000 : 8000 repeat: true running: root.activated onTriggered: { root.switchOutlineArc(); } } Timer { id: tmRound interval: 2500 repeat: true running: root.activated && root.hasOutlineArc onTriggered: { switchRound(); } } Timer { id: tmArcWidth property int index: 0 interval: 4000 repeat: true running: root.activated && root.hasOutlineArc onTriggered: { tmArcWidth.index = (tmArcWidth.index + 1) % 3; switch (tmArcWidth.index) { case 1: root.changeArcWidth(8); break; case 2: root.changeArcWidth(40); break; default: root.changeArcWidth(28); break; } } } Timer { id: tmFillColor property int index: 0 interval: 2000 repeat: true running: root.activated onTriggered: { tmFillColor.index = (tmFillColor.index + 1) % 4; root.changeFillColor(tmFillColor.index); } } }