QComboBox: don't call index(-1, 0) on the underlying model
This is invalid and might assert in the model (e.g. in QConcatenateTablesProxyModel) Pick-to: 6.5 6.2 Change-Id: I6602d8b9eca83ef6cae760944a999d55244bb181 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>bb10
parent
25530c7020
commit
b06ae63e8f
|
|
@ -2098,7 +2098,7 @@ int QComboBox::currentIndex() const
|
|||
void QComboBox::setCurrentIndex(int index)
|
||||
{
|
||||
Q_D(QComboBox);
|
||||
QModelIndex mi = d->model->index(index, d->modelColumn, d->root);
|
||||
QModelIndex mi = index >= 0 ? d->model->index(index, d->modelColumn, d->root) : QModelIndex();
|
||||
d->setCurrentIndex(mi);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue