StackView pop not working
-
Hello! I'm trying to control StackView from C++ via signals and I have two major problems.
First problem: I have all my screens labeled by ID but I can't pass them from C++ as QString
For example, this is a screen I want to pass to my StackView
Item { id: scr_starting width: 800 height: 480 Image { source: "qrc:/assets/screens/scr-starting.png" } }
stackview.qml
... Connections { target: cppStackview function onPushScreen(screen_id) { mainStackview.push(screen_id) } function onPopScreen(screen_id) { mainStackview.pop(screen_id) } ...
So if I emit in C++
pushScreen("scr_starting")
- it doesn't work. It only works if I pass the .qml file path.So here comes the second issue - I can't pop from C++ via signal if I am passing the .qml file path.
pushScreen("main/scr_starting.qml");
- works
pushScreen("main/scr_starting_new.qml");
- works
popScreen("main/scr_starting.qml");
- doesn't work, even though the path is identical to the first pushIn fact, even empty pop doesn't work
pushScreen("main/scr_starting.qml");
- works
pushScreen("main/scr_starting_new.qml");
- works
pop();
- this does literally mainStackview.pop() from signal - doesn't workWhat am I doing wrong here?