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

QListWidget setSelectionModel stops emission of itemSelectionChanged signal

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.7.0 RC
    • 5.4.1, 5.5.1, 5.6.0 Beta
    • Widgets: Itemviews
    • None
    • 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

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              sgaist Samuel Gaist
              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