Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-106164

ListView doesn't render Text in delegates on dataChanged signal



    • Linux/X11
    • f3b1d6135 (dev), 99b2aacd8 (6.5)


      When associating a C++ model to a ListView,  delegates not currently displayed are not correctly rendered on model dataChanged signals.


      To meet this issue, several conditions must be present:

      • C++ model must fill its data after the ListView initialization
      • C++ model must have more rows than displayed in the ListView (you must scroll the ListView)
      • ListView must use a delegate with a Text meeting three conditions:
        • When the model is not loaded, Text must be empty
        • the Text must have a fixed width
        • the Text must be clipped

      When all these conditions are present, when the model load its data and launch for each of them a dataChanged signal, all Text of lines not displayed on ListView initial position are not rendered (even if currently displayed on model loading).


      The Text component have a correct width, implicitWidth and contentWidth and calling forceLayout() or update() doesn't solve it. Changing most of properties doesn't change anything as well (rotation, antialiasing, etc.) except:

      • clip: you can set the clip property to false, let QML do at least a frame rendering and then set again the clip property to true
      • width: set a new width and immediately restore the previous one


      The issue wasn't there on Qt5.14.2.

      I've created a test program to reproduce the issue attached to the ticket, just launch it and click on "Load All Model" to simulate a delayed model.



        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.



              piwierci Piotr Wierciński
              steelskin3 Simon Bony
              0 Vote for this issue
              3 Start watching this issue



                Gerrit Reviews

                  There are no open Gerrit changes