Fix crash in QCombobox when resetting model during currentIndexChanged()

Task-number: QTBUG-20415
Change-Id: Idffc0f29cc55d834c2736ce7562dd7cfe912d327
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This commit is contained in:
Alex Blasche 2014-09-19 17:38:48 +02:00
parent b53f6fdd31
commit 23a03ebcd1

View File

@ -1280,8 +1280,8 @@ void QComboBoxPrivate::_q_emitHighlighted(const QModelIndex &index)
void QComboBoxPrivate::_q_emitCurrentIndexChanged(const QModelIndex &index) void QComboBoxPrivate::_q_emitCurrentIndexChanged(const QModelIndex &index)
{ {
Q_Q(QComboBox); Q_Q(QComboBox);
emit q->currentIndexChanged(index.row());
const QString text = itemText(index); const QString text = itemText(index);
emit q->currentIndexChanged(index.row());
emit q->currentIndexChanged(text); emit q->currentIndexChanged(text);
// signal lineEdit.textChanged already connected to signal currentTextChanged, so don't emit double here // signal lineEdit.textChanged already connected to signal currentTextChanged, so don't emit double here
if (!lineEdit) if (!lineEdit)