Please nominate your Qt Champions for 2021!

ListView or animating the 'X' property

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

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

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

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

Log in to reply