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

QItemSelectionModel does not emit selectionChanged when selection is changed through QStandardItem::setFlags

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: In Progress
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.15.3
    • Fix Version/s: None
    • Component/s: Core: Item Models
    • Labels:
      None

      Description

      See reproducer in https://codereview.qt-project.org/c/qt/qtbase/+/346010

      When a selection is cleared by calling
      model.item(j)->setFlags({ });
      i.e. by clearing the flags, a QItemSelectionModel connected the the model should emit selectionChanged because, well, the selection changed. However, this is not the case. The model emits the signal dataChanged() in that case. This signal is not connected to by QItemSelectionModel, see
      https://github.com/qt/qtbase/blob/582fdf06d179ee17ff68c67fb2f55ac10b7b6e4a/src/corelib/itemmodels/qitemselectionmodel.cpp#L606
      Proper handling is necessary here.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              andreasbuhr Andreas Buhr
              Reporter:
              andreasbuhr Andreas Buhr
              PM Owner:
              Vladimir Minenko Vladimir Minenko
              RnD Owner:
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: