Spinbox not fitting to rectangle, If it fits focus is missing
-
Rectangle{
id:upperValue
width:0.065 * widthValue
height:0.086 * heightValue
color: "gray"
anchors{
top: upperValue.top
topMargin: 0.006 * heightValue
bottom: upperValue.bottom
}SpinBox{ id:spinbox minimumValue: 0.2 maximumValue: 39.0 stepSize: 0.1 decimals: 2 anchors.fill:parent onEditingFinished: { upperValueTxt.visible = true upperValueTxt.text = spinbox.value spinbox.visible = false } }
}
-
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 } } }