Solved Sometimes Stack Pop is not working properly.
-
So when i click on back button i need to go to the previous page. To do that i have used stack.pop()
but it's not working properly. One page intersecting the other. -
@trupti007 you should also check your depth property when you call pop, to check if you have actually more items on the stack than you expect.
-
Hm I thought old items are always visible only in SwipeView, but maybe they are so as well in StackView. Documentation does not seem to mention it.
Can you share some code of how you operate your Stack?
-
@sierdzio
on my page page i have defined the stack view
StackView{
id: stackView
focus: true
anchors.fill: parent
clip: true
}
And this is how i have used stackView.pop(). On some pages it is working fine but some pages it is just not.
Keys.onBackPressed: {
stackView.pop();
} -
@trupti007 said in Sometimes Stack Pop is not working properly.:
On some pages it is working fine but some pages it is just not
Then analyze the code differences between those pages. If it only fails for some cases, you are likely to find a bug in your code. Maybe an element has it's
visible
property forced totrue
somewhere? -
@sierdzio no there aren't any such property. can you suggest me something else in place of stack pop?
-
@trupti007 you should also check your depth property when you call pop, to check if you have actually more items on the stack than you expect.
-
@J-Hilk can you give me an example ?
-
StackView{ id: sView function popOne(){ console.log("stackdepth",sView.depth) sView.pop() } }
-
@J-Hilk cool i will try it. thanks
-
This post is deleted!