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. ListView or animating the 'X' property
Qt 6.11 is out! See what's new in the release blog

ListView or animating the 'X' property

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 3.5k 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.
  • M Offline
    M Offline
    mario
    wrote on last edited by
    #1

    Which way should one go when creating horizontal "sliding view" in an application.

    The ListView is very convenient to use but the question is if it adds much overhead when sliding a page compared to just animating the 'X' property on an Item?

    Obviously, the ListView requires more memory resources to hold the list etc but is the sliding as efficient as just changing the 'X' property on an Item.

    1 Reply Last reply
    0
    • B Offline
      B Offline
      blam
      wrote on last edited by
      #2

      It depends on what you are doing. If you have a model of items that you want to display, then it seems easier to use a ListView. If you don't have a list of items, then just use a single Item.

      ListView is pretty good with managing resources. It only creates delegates when necessary and destroys them when they are no longer required.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mario
        wrote on last edited by
        #3

        Do you know if the resource handling is also true when using VisualItemModel together with ListView?

        1 Reply Last reply
        0
        • B Offline
          B Offline
          blam
          wrote on last edited by
          #4

          When you use a VisualItemModel, you are defining the visual items within the model, so they can't be dynamically created and destroyed by a view, since they are owned by the model.

          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