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

QItemSelectionModel - indexesFromRange is not optimal for large amount of data

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 4.7.1
    • Fix Version/s: 5.0.0 Beta 2
    • Component/s: Widgets: Itemviews
    • Labels:
      None
    • Commits:
      d18eb260d70b75376411fe3f69da82bf46fb503f

      Description

      The model is not efficient for large amount of data, especially when you want to sort all but a few items. The sort itself is not the problem. The problem comes from the fucntion indexesFromRange that goes through all the indexes:
      static void indexesFromRange(const QItemSelectionRange &range, QModelIndexList &result) in qitemselectionmodel.cpp

      Test case - to reproduce:

      • select the entire table (click in top left)
      • then, deselect a couple of rows using ctrl-click
      • then, click the column 2 header to trigger a sort

      Also while it would help, reimplementing QItemSelectionModel is not a solution here as the virtual functions exposed are limited.

        Attachments

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

          Activity

            People

            Assignee:
            stephen.kelly Stephen Kelly (Unused account) (Inactive)
            Reporter:
            sanonymous Nokia Qt Support (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes