Quantcast
Viewing all articles
Browse latest Browse all 4972

How to set a "instant" value instead of a relative value of a property? Simple example...

rect2 width and height must be half of its parent width and height. But I want that just at the beginning. If the user resizes the window, I don’t want the rect2 to recalculate his width and height based on its parent size. Example: Rectangle {     id: rect;     width: 360;     height: 360;     color: "black";       Rectangle {         id: rect2;         width: rect.width*0.5;         height: rect.height*0.5;         anchors.horizontalCenter: parent.horizontalCenter;         anchors.verticalCenter: parent.verticalCenter;         color: "white";     } } In this example, I want the rect2 to be “forever” 180 × 180. PS: I’m a Qt Programmer. Beginner at QtQuick.

Viewing all articles
Browse latest Browse all 4972

Trending Articles