Rectangle{ id: myButton width: 93 height: 93 color: "transparent" Button{ id: butPage anchors.fill: parent onClicked: { updateFocusAudio(myButton); } Text { id: temeratureText text: "12" }}
Rectangle{ id: myButton property bool activePage: false property string textButton: "" property string imageSource: "" Button{ id: but anchors.fill: parent highlighted: activePage clip: true onClicked: { callback(); //как вынести этот callback в свойства // Запускаем анимацию colorRect.x = pressX colorRect.y = pressY circleAnimation.start() colorAnim.start() } }}
Window { width: 640 height: 480 visible: true title: qsTr("Hello World") B { callback: () => console.log("hello") } component B: Item { property var callback Button { onClicked: callback() text: "test" } }}
component B: Item {
component B: Item { ... }
// B.qmlItem { ... }