Hello,
i have problems with the following code:
Rectangle {
width: 360
height: 360
MenuManager {
id: menu
}
ListView {
anchors.fill: parent
model: menu.activeMenu
delegate: Rectangle {
width: 360
height: 360
Button {
anchors.fill parent
text: "Back"
onClicked: {
menu.MenuBack() //<- dosen't work
}
}
// MouseArea {
// anchors.fill: parent
// onClicked: {
// menu.MenuBack() //<- works!
// }
// }
}
}
}
When i use the MouseArea Element in the delegate i can call a function of the MenuManager Object. When i use a Button it dosen’t work. In the Button’s onClicked method menu is undefined.
(The MenuManager Object is a c++ class. The methods are marked as Q_INVOKABLE, and the class is registerd via qmlRegisterType)
Any ideas what’s the reason for this behaviour?
Thanks
↧