import QtQuick import QtQuick.Controls Rectangle { id: rectangle width: 300 height: Constants.height state: "clicked" Text { id: label text: qsTr("Hello UntitledProject477") anchors.top: button.bottom font.family: Constants.font.family anchors.topMargin: 45 anchors.horizontalCenter: parent.horizontalCenter } Rectangle { anchors.fill: parent color: Constants.backgroundColor } states: [ State { name: "something" when: rectangle.width > 200 PropertyChanges { target: label z: 1 } }, State { name: "someOther" when: rectangle.width < 200 PropertyChanges { target: label z: 0 } } ] }