This code does not compile. Where are the import statements?, I have to assume you are using QtQuick.Controls 1.4 not Quick 2.
It is important to give as much info as you can and where possible, learn how to paste it properly making it readable and repeatable for those reading/helping.
You are using components that do not exist, where does 'widthValue' and 'heightValue' come from in Rectangle?
Not forgetting the strange use of anchors, why are you trying to anchor the rectangle to the top of itself?, error after error.
So, all you are wanting to do, is place SpinBox in a Rectangle?;
Rectangle{
id: upperValue
color: "red"
width: 200
height: 100
anchors.centerIn: parent
SpinBox {
id:spinbox
minimumValue: 0.2
maximumValue: 40
stepSize: 0.2
decimals: 2
focus: true
anchors.centerIn: parent
}
}
}
[image: 8cb34146-fb49-48cd-be1b-40905688d151.JPG]