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 renders phantom row after model reset
Forum Updated to NodeBB v4.3 + New Features

ListView renders phantom row after model reset

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 166 Views
  • 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.
  • C Offline
    C Offline
    CodeCruncher
    wrote on last edited by CodeCruncher
    #1

    Qt 6.2.1
    ListView initially has a model with 100 items (generation 1 of the model).
    Renders fine.
    Model is reset to have 10 items (gen 2).
    Verified that onModelAboutToBeReset() and onModelReset() are both emitted properly.
    Bug is that for the first item, the ListView renders both gen 1 and gen 2 versions of the first item (on top of each other).
    Bug only happens if ListView.header property is set and the first ListView item is visible when the model is reset.

    I've whittled a repro situation down to two very simple 50 line files (qml + python).
    The bug is even more obvious when the model is reset so that gen 2 of the data has 0 items.
    Then the ListView continues to render the phantom first item from gen 1 all by itself (like its haunted...).

    Ideas? If true bug, how to submit?

    main.py
    https://pastebin.com/X2uV3c8z

    qtbug1.qml
    https://pastebin.com/NQM85qjV

    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