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. How to append new elements at the top of ListView
Forum Updated to NodeBB v4.3 + New Features

How to append new elements at the top of ListView

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 961 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
    mivoligo
    wrote on last edited by
    #1

    By default when an element is appended to the ListView, it goes to the bottom of the list. Is there any easy way to do the opposite?
    I've tried this example http://qt-project.org/wiki/How_to_make_QML_ListView_align_bottom-to-top and it works but scrolling the list with a mouse is mirrored. When I scroll up, the list moves down.
    Maybe there's a method to change that?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      daliusd
      wrote on last edited by
      #2

      I personally would use insert on ListView's model to insert in beginning and ListView's method positionViewAtBeginning() (I have not tested if that works but it should). That example you have pointed at is not very good way to do in my opinion but that should work as well.

      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