—Hi everyone,
I am trying to build a message box that can be simply added and then apply a custom function to the onClicked function of each button. I have manage to create properties that can be passed through, but I was wondering if I can do this with signals in QML only?
Main.qml
import "../MessageBox" as MessageBox
Rectangle{
width :300
height:300
MessageBox.YesNo{
captionText: "Are you sure you want to quit?"
///buttonYes.onClicked...
////buttonNo.onClicked...
}
Then here is YesNo.qml
Rectangle{
width: parent.width
height: 200
property string captionText: qsTr("")
RowLayout{
Button{
id: buttonYes
onClicked: parent.destroy()
}
Button{
id: buttonNo
onClicked: parent.destroy()
}
}
Thanks in advance
↧