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

QListWidget setSelectionModel stops emission of itemSelectionChanged signal

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.4.1, 5.5.1, 5.6.0 Beta
    • Fix Version/s: 5.7.0 RC
    • Component/s: Widgets: Itemviews
    • Labels:
      None
    • Commits:
      6129aade0018437d8d65a0051040d7100c8ec681

      Description

      QAbstractItemView::setSelectionModel does not know to restore the connections created by QListWidgetPrivate::setup, so calling setSelectionModel on a QListWidget breaks the connections to QItemSelectionModel signals. Moving those connections from QListWidgetPrivate::setup to a new QListWidget::setSelectionModel override function fixes the problem. See attached modified files.

      (See also http://forum.qt.io/topic/63674/qlistwidget-setselectionmodel-stops-emission-of-itemselectionchanged-signal.)

        Attachments

        1. qlistwidget.cpp
          55 kB
        2. qlistwidget.h
          12 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            sgaist Samuel Gaist
            Reporter:
            franzamador Franz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes