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
    • Story Points:
      21
    • Sprint:
      Qt6_Foundation_Sprint 37, Qt6_Foundation_Sprint 38, Team 1 Foundation_Sprint 45, Team 1 Foundation_Sprint 46, Team 1 Foundation_Sprint 47, Team 1 Foundation_Sprint 48, Team One Foundation Sprint 49, Team One Foundation Sprint 50

      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:
              cnn Qt Core & Network
              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: