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. [solved] Loader and QML files
Forum Updated to NodeBB v4.3 + New Features

[solved] Loader and QML files

Scheduled Pinned Locked Moved QML and Qt Quick
loaderqmlqt quick
4 Posts 3 Posters 1.6k Views 2 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.
  • David.GD Offline
    David.GD Offline
    David.G
    wrote on last edited by David.G
    #1

    Hello,

    I'm having a small problem recently. I started using the Loader and it has worked quite well, except I need to keep the three views I've created (table view, list view, grid view) where the user left off (say the user changed the item's width in a split view, if he goes to table view and goes back to the previous one it reloads the file).

    How can I achieve this in qt quick? (switching between already initialized views without losing modifications)

    p3c0P 1 Reply Last reply
    0
    • David.GD David.G

      Hello,

      I'm having a small problem recently. I started using the Loader and it has worked quite well, except I need to keep the three views I've created (table view, list view, grid view) where the user left off (say the user changed the item's width in a split view, if he goes to table view and goes back to the previous one it reloads the file).

      How can I achieve this in qt quick? (switching between already initialized views without losing modifications)

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      @David.G Loader can only load a single file or component at a time. So when you change the source it is going to reload it and the changes will be lost unless you save it somewhere and load it I think you should use a StackView instead and set destroOnPop to false when pushing.

      157

      1 Reply Last reply
      0
      • David.GD Offline
        David.GD Offline
        David.G
        wrote on last edited by
        #3

        Hey @p3c0, thanks for replying.

        I ended up pushing for that route. I was planning to use Binders (Binding) but thought the process would be too expensive for the cause. I ran into a little problem, since I have a sidebar on the left the StackView animation would run over it which wasn't desirable. So for future reference all you need to do is play with the z index.

        1 Reply Last reply
        0
        • MonomixM Offline
          MonomixM Offline
          Monomix
          wrote on last edited by
          #4

          I know this is marked as solved, but just as an aside: to do this with a Loader, you could use a Settings object to store the properties that should be reset to restore the state of the user's view - still a Labs feature just now, but it works very nicely.

          1 Reply Last reply
          0

          • Login

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