Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. StackView push changed since Qt 5.9
Forum Updated to NodeBB v4.3 + New Features

StackView push changed since Qt 5.9

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 1.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SeeLookS Offline
    SeeLookS Offline
    SeeLook
    wrote on last edited by SeeLook
    #1

    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

    stackView.push(pages[index])
    

    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?

    S 1 Reply Last reply
    0
    • SeeLookS SeeLook

      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

      stackView.push(pages[index])
      

      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?

      S Offline
      S Offline
      Schluchti
      wrote on last edited by
      #2

      @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.

      Want to read more about Qt?

      https://gympulsr.com/blog/qt/

      Latest Article: https://gympulsr.com/blog/qt/2017/06/14/ios-background-music-qt.html

      1 Reply Last reply
      1
      • SeeLookS Offline
        SeeLookS Offline
        SeeLook
        wrote on last edited by SeeLook
        #3

        @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.

        1 Reply Last reply
        3

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved