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

QItemSelectionModel::select slows rapidly as the number of already selected Items goes up.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: Not Evaluated Not Evaluated
    • None
    • 4.8.1
    • Widgets: Itemviews
    • None
    • PySide (but the PySide code appears to be running fast, according to profiling).

      I have an app in which dragging to select in a QGraphicsView causes mirroring select in a QTreeView. The gradually increasing selection in the Scene causes a series of select commands to the QItemSelectionModel with a gradually increasing number of items selected.

      The bad performance of the select method causes horrible lag.

      The main problem with the select method appears to me to be an initial iteration through the existing selection to check for any invalid indices. I am not 100% sure that is the problem but it would certainly appear to be.

      I am not sure if this is needed. There is a clear justification for it in the comments but perhaps there is a way round this issue, for example, a lazy check for invalid at a later stage, just before the selectionChanged signal is emitted.

      In any case the behaviour appears to be roughly quadratic to select n items one by one, and so not really very good.

        For Gerrit Dashboard: QTBUG-25904
        # Subject Branch Project Status CR V

            stephen.kelly Stephen Kelly (Unused account) (Inactive)
            bstrulo Ben Strulo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes