texcrafting/Main.qml

78 lines
1.4 KiB
QML
Raw Permalink Normal View History

2024-09-09 21:12:05 +00:00
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import texcrafting
ApplicationWindow {
width: 640
height: 480
visible: true
title: qsTr("Hello World")
TextureCrafter {
id: crafter
}
RowLayout {
anchors.fill: parent
ColumnLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
TexSlot {
id: texSlotR
rectColor: "red"
}
TexSlot {
id: texSlotG
rectColor: "green"
}
TexSlot {
id: texSlotB
rectColor: "blue"
}
}
ColumnLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
ProgressBar {
value: 0.5
}
Button {
Layout.alignment: Qt.AlignHCenter
text: qsTr("Craft!")
onClicked: {
var outUrl = crafter.packChannels([texSlotR.filePath, texSlotG.filePath, texSlotB.filePath]);
outSlot.filePath = outUrl;
}
2024-09-09 21:12:05 +00:00
}
}
ColumnLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
TexSlot {
id: outSlot
2024-09-09 21:12:05 +00:00
rectColor: "gray"
2024-09-09 21:12:05 +00:00
}
}
}
}