Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Model View
Qt 6.11 is out! See what's new in the release blog

Model View

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.1k 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.
  • E Offline
    E Offline
    EugeneT
    wrote on last edited by
    #1

    Hi, I need to write an app which shows a lot of items at the same time some items update and undefined quantity new items come over the network. The list of items persistently grows.
    I wrote a Model inherited of QAbstractItemModel, and the some time it works well, but after a while the app starts to slow down.
    Do you know a decision how to fix it? Thanks.

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @EugeneT said in Model View:

      Do you know a decision how to fix it?

      I would say - fix your model or don't add more than maybe 100k items to it.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      E 1 Reply Last reply
      0
      • gde23G Offline
        gde23G Offline
        gde23
        wrote on last edited by
        #3

        You can try to implement fetchMore() for your model, so only the data that you want to see gets loaded dynamically.

        E 1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          @EugeneT said in Model View:

          Do you know a decision how to fix it?

          I would say - fix your model or don't add more than maybe 100k items to it.

          E Offline
          E Offline
          EugeneT
          wrote on last edited by
          #4

          @Christian-Ehrlicher , hello. I thought that Qt doesn't use or handle items which aren't visible, and it doesn't matter how many items you insert into a view. Approximately 100k items and the app is slow

          1 Reply Last reply
          0
          • gde23G gde23

            You can try to implement fetchMore() for your model, so only the data that you want to see gets loaded dynamically.

            E Offline
            E Offline
            EugeneT
            wrote on last edited by
            #5

            @gde23 thanks, I'll try your decision

            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