I’m having some trouble using onPushed() and onPopped() in a NavigationStack. Here’s a sample of the code:
NavigationStack {
JobsPage { }
onPushed: {
console.log("push " + item);
console.log("push.id " + item.id);
console.log("push.name " + item.objectName);
}
onPopped: {
console.log("pop " + item);
console.log("pop.id " + item.id);
console.log("pop.name " + item.objectName);
}
}
The output looks like the following:
qml: push NavigationStack_QMLTYPE_62(0x60f0000b74c0, “_NavigationStack”)
qml: push.id undefined
qml: push.name _NavigationStack
qml: pop NavigationStack_QMLTYPE_62(0x60f0000b74c0, “_NavigationStack”)
qml: pop.id undefined
qml: pop.name _NavigationStack
How exactly am I suppose to recognize which page is pushed and popped? I can’t seem to identify the pages by id or objectName.