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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.15.3
    • Core: Item Models
    • None
    • 21
    • 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

              cnn Qt Core & Network
              andreasbuhr Andreas Buhr
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: