property string pageid.... Button { id: p1 text: "Push 1" onClicked: { pageid = String(this.id) // не работает!! как получить? console.log(pageid) } }
QtObject { Component.onCompleted: console.log(this.toString())}
Button { id: p1 text: "1" onClicked: { pageid = text } }
ComboBox { id: zadaniye currentIndex: 0 displayText: "Задание: " + currentText model: [ "1","2","3","4","5","6","7","8","9", "10","11","12","13","14","15","16","17","18","19", "20","21","22","23","24","25","26","27","28","29", "30","31","32","33","34","35","36","37","38","39", "40","41","42","43","44","45","46","47","48","49", "50","51","52" ] } Button { id: p1 text: "Открыть" onClicked: { pageid = zadaniye.currentText console.log("onClicked! pageid = " + pageid ) stack.push(comp2) } }
Button {id: ...property var clickFunction: function() {code here}onClicked: clickFunction()}