HelLo Forum,
I am trying to relocate the rectange with the following command :
Rectangle {
id: rect
x: -100
color: "red"
radius: 10
opacity: 0.1
border.color: "black"
anchors.fill: controlLayout
}
Rectangle {
id: rect
x: -100
color: "red"
radius: 10
opacity: 0.1
border.color: "black"
anchors.fill: controlLayout
}
To copy to clipboard, switch view to plain text mode
But the rectange is not moving at all, it is pinned at the left corder of the window. Here goes the contents of the whole .qml file.
import QtQuick 2.0
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import TeapotTessellation 1.0
Item {
id: root
width: 512; height: 512
Text {
text: "F1 - Show/Hide Settings"
font.pixelSize: 15
anchors.top: parent.top
anchors.topMargin: 15
anchors.right: parent.right
anchors.rightMargin: 15
opacity: 0.5
}
TessellationSceneItem
{
id: tessSceneItem
}
GridLayout {
id: controlLayout
columns: 2
Text {
id: outerTessellationText
text: qsTr("Outer Tessellation Factor: ")
color: "black"
opacity: 1.0
}
Slider {
id: outerTessellationSlider
opacity: 1.0
minimumValue: 1.0
maximumValue: tessSceneItem.maxTessLevel
stepSize: 1.0
Layout.fillWidth: true
onValueChanged: tessSceneItem.outer = value
}
Text {
id: innerTessellationText
text: qsTr("Inner Tessellation Factor: ")
color: "black"
opacity: 1.0
}
Slider {
id: innerTessellationSlider
opacity: 1.0
minimumValue: 1.0
maximumValue: tessSceneItem.maxTessLevel
stepSize: 1.0
Layout.fillWidth: true
onValueChanged: tessSceneItem.inner = value
}
}
Rectangle {
id: rect
x: -120
color: "red"
radius: 10
opacity: 0.1
border.color: "black"
anchors.fill: controlLayout
}
}
import QtQuick 2.0
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import TeapotTessellation 1.0
Item {
id: root
width: 512; height: 512
Text {
text: "F1 - Show/Hide Settings"
font.pixelSize: 15
anchors.top: parent.top
anchors.topMargin: 15
anchors.right: parent.right
anchors.rightMargin: 15
opacity: 0.5
}
TessellationSceneItem
{
id: tessSceneItem
}
GridLayout {
id: controlLayout
columns: 2
Text {
id: outerTessellationText
text: qsTr("Outer Tessellation Factor: ")
color: "black"
opacity: 1.0
}
Slider {
id: outerTessellationSlider
opacity: 1.0
minimumValue: 1.0
maximumValue: tessSceneItem.maxTessLevel
stepSize: 1.0
Layout.fillWidth: true
onValueChanged: tessSceneItem.outer = value
}
Text {
id: innerTessellationText
text: qsTr("Inner Tessellation Factor: ")
color: "black"
opacity: 1.0
}
Slider {
id: innerTessellationSlider
opacity: 1.0
minimumValue: 1.0
maximumValue: tessSceneItem.maxTessLevel
stepSize: 1.0
Layout.fillWidth: true
onValueChanged: tessSceneItem.inner = value
}
}
Rectangle {
id: rect
x: -120
color: "red"
radius: 10
opacity: 0.1
border.color: "black"
anchors.fill: controlLayout
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks