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

Filling model in batches stops after a few batches if view is attached (KIO dependency)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.2.0 Beta1
    • None
    • Linux. Not tested others.

    Description

      Hi,

      Attached is sample code to replicate this issue.
      The issue is a bit complicated to explain. I've only been successful in replicating this using KIO for directory listing. That sends the directory content in batches. So that means the model is also filled in batches (as they flow in from KIO).

      The steps:
      1. Create a new folder and enter it on the command line
      2. type touch

      {1..50000}

      .txt (my testcase, more info down below on the number)
      3. open main.cpp from the example and change the "url" value to the folder you just made and filled with empty files.
      4. Run the code.
      5. Now you should see:

      • On rows inserted: false 0 200
      • On rows inserted: false 201 401
      • ... much more till 50001 (including . and ..)

      Step 5 is how you "should" see it. When you run the example code as provided it won't show all 50.000 entries. Rather it will show just a few hundred. This behavior has been replicated by a few other people as well.

      A note on the number. 50.000 is my test benchmark for this. You should be safe making a folder with 2000 entries or even 1000. I just picked a high number to be sure

      The model itself doesn't seem to be the problem. If you comment the view lines:
      QListView* view = new QListView;
      view->setModel(model);
      view->show();

      and re-run the model, you will see:

      • On rows inserted: false 0 200
      • On rows inserted: false 201 401
      • ... a lot more

      That leads me to think that the view is somehow, somewhere killing "a" signal. I tried 3 different views:

      • QListView (shows the symptom)
      • QTreeView (shows the symptom)
      • CustomView (shows the symptom)

      so that leads me to think that it's somewhere in the abstraction behind the views. This however is a bit too deep and complicated for me hence the bug report.

      Lastly, i tried replicating this using a timer rather then KIO, but that didn't work. The code i tried that with is commented in the provided main.cpp example. I could only replicate it using KIO thus KIO is required to run the example. Sorry for that.

      I'm very curious to know what is causing this. Please do keep this bug report updated with your findings.

      Cheers,
      Mark

      Attachments

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

        Activity

          People

            stephen.kelly Stephen Kelly (Unused account) (Inactive)
            markg85 Mark
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes