Important: Please read the Qt Code of Conduct -

StackView push changed since Qt 5.9

  • Hi,

    I have StackView component where its pages are loaded on demand (only first one is created at the beginning)
    There is an array with QML files which are created apparently:

    property var pages: ["Page1.qml", "Page2.qml, ...]

    so push() method


    creates them properly, then string in the array that points to the file is replaced by reference to created component

    pages[index] = stackView.currentItem

    Before Qt 5.9 it worked well, push() method was sane enough to create components from uri or just push it up when it existed, but it stopped working since update to latest Qt 5.9.

    Have You idea what is wrong?

  • @SeeLook Can you create a minimal working example that shows that behavior? If so, you could create a bugreport and attach the code sample to the created ticket. If it's a regression there is a good chance that it will get fixed in the next bugfix release , as 5.9 has now LTS.

  • @Schluchti thanks for response.

    It was rather my mistake or wrong StackLayout usage that worked by chance before but when was fixed in Qt 5.9 and it uncovered my bad.

    Before 5.9 it was possible to pushing the same item to stack multiple times - this is why it was worked for me.

    I fixed my code by using replace() instead push()- which replaces current item on the stack with desired one.

Log in to reply