4 ms·
"But writing constraints as text is painful." I find writing the anchors in QML (Qt Quick's layout language) to be quite pleasant and easy. Eg: Rectangle
by dkersten 11y ago
"But writing constraints as text is painful."
I find writing the anchors in QML (Qt Quick's layout language) to be quite pleasant and easy.
Eg:
Rectangle {
Rectangle {
id: a
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: parent.left
width: parent.width / 2
}
Rectangle {
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: a.right
anchors.right: parent.right
}
The two most "interesting" parts of this are the width: parent.width / 2 and anchors.left: a.right
There is much much more, much of which makes it more concise, but that's the basics.