Emit the highlighted signal if the model changes.
authorStephen Kelly <stephen.kelly@kdab.com>
Mon, 13 Aug 2012 16:12:28 +0000 (18:12 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 15 Aug 2012 11:58:29 +0000 (13:58 +0200)
commit351904be50ce1b76b06aa2bad5c7f8ab8567ccfb
tree7b41359711818ebe46151bb69095d12970478723
parent61fa926857c3e01eb7129b633d948f17db418f84
Emit the highlighted signal if the model changes.

The bug is that the connection to emit that signal can be made
obsolete if the connection is made too early and the model is replaced.
In the bug report, the connection is made by calling view() early (thereby
causing the creation of a view and a QItemSelectionModel which operates on
the built-in QItemSelectionModel, and then connecting to that
QItemSelectionModel), and then when QComboBox::setModel() is called later
the built-in view creates a new QItemSelectionModel for it. The bug was
that that new QItemSelectionModel is not connected to. This patch fixes that
bug.

Task-number: QTBUG-4454
Change-Id: Ibbdb8731f16ab071008b4a19dc2cc7ae03cebc84
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
src/widgets/widgets/qcombobox.cpp
tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp