This commit is contained in:
2020-06-18 18:25:03 -06:00
commit e01c09fbcc
17 changed files with 2689 additions and 0 deletions

103
src/qml/main.qml Normal file
View File

@@ -0,0 +1,103 @@
import QtQuick 2.12
import QtQuick.Controls 2.5
import QtQuick.Layouts 1.3
import Magnum 1.0
ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("My Application")
RowLayout {
id: root
anchors.fill: parent
spacing: 0
ColumnLayout {
Layout.fillHeight: true
Layout.preferredWidth: parent.width * 0.25
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.margins: 20
spacing: 20
Label {
text: "Controls"
font.pointSize: 14
}
GroupBox {
Layout.preferredWidth: parent.width
RowLayout {
anchors.left: parent.left
anchors.right: parent.right
Label {
Layout.preferredWidth: parent.width/4
text: "Hue"
}
Label {
text: qsTr("%1°").arg(Math.round((180/Math.PI)*hue.value))
color: palette.highlight
}
Slider {
id: hue
anchors.right: parent.right
Layout.preferredWidth: parent.width/2
from: 0
to: Math.PI*2
}
}
}
GroupBox {
Layout.preferredWidth: parent.width
RowLayout {
anchors.left: parent.left
anchors.right: parent.right
Label {
Layout.preferredWidth: parent.width/4
text: "Count"
}
Label {
text: count.value
color: palette.highlight
}
Slider {
id: count
anchors.right: parent.right
Layout.preferredWidth: parent.width/2
from: 1
to: 5
stepSize: 1
snapMode: Slider.SnapAlways
}
}
}
Item {
Layout.preferredWidth: parent.width
CheckBox {
text: "Lagging"
}
}
}
Magnum {
Layout.fillHeight: true
Layout.fillWidth: true
hue: hue.value
count: count.value
SequentialAnimation on t {
NumberAnimation { to: 1; duration: 2500; easing.type: Easing.InQuad }
NumberAnimation { to: 0; duration: 2500; easing.type: Easing.OutQuad }
loops: Animation.Infinite
running: true
}
}
}
}

6
src/qml/main.qrc Normal file
View File

@@ -0,0 +1,6 @@
<RCC>
<qresource prefix="/">
<file>main.qml</file>
<file>qtquickcontrols2.conf</file>
</qresource>
</RCC>

View File

@@ -0,0 +1,9 @@
; This file can be edited to change the style of the application
; Read "Qt Quick Controls 2 Configuration File" for details:
; http://doc.qt.io/qt-5/qtquickcontrols2-configuration.html
[Controls]
Style=Fusion
[Fusion\Palette]
Highlight=#ff0000