main.qml Example File
interaction/qml/interaction/main.qml
import QtQuick 2.0
import QtCanvas3D 1.0
import QtQuick.Controls 1.0
import QtQuick.Layouts 1.0
import "interaction.js" as GLCode
Item {
id: mainview
width: 1280
height: 768
visible: true
Canvas3D {
id: canvas3d
anchors.fill: parent
focus: true
property double xRotSlider: 0
property double yRotSlider: 0
property double zRotSlider: 0
onInitializeGL: {
GLCode.initializeGL(canvas3d);
}
onPaintGL: {
GLCode.paintGL(canvas3d);
}
onResizeGL: {
GLCode.resizeGL(canvas3d);
}
}
RowLayout {
id: controlLayout
spacing: 5
x: 12
y: parent.height - 100
width: parent.width - (2 * x)
height: 100
visible: true
Label {
id: xRotLabel
Layout.alignment: Qt.AlignRight
Layout.fillWidth: false
text: "X-axis:"
}
Slider {
id: xSlider
Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true
minimumValue: 0;
maximumValue: 360;
onValueChanged: canvas3d.xRotSlider = value;
}
Label {
id: yRotLabel
Layout.alignment: Qt.AlignRight
Layout.fillWidth: false
text: "Y-axis:"
}
Slider {
id: ySlider
Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true
minimumValue: 0;
maximumValue: 360;
onValueChanged: canvas3d.yRotSlider = value;
}
Label {
id: zRotLabel
Layout.alignment: Qt.AlignRight
Layout.fillWidth: false
text: "Z-axis:"
}
Slider {
id: zSlider
Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true
minimumValue: 0;
maximumValue: 360;
onValueChanged: canvas3d.zRotSlider = value;
}
}
}