QComboBox: don't call model->index() with row = -1, during reset
This leads to an assert in QConcatenateTablesProxyModel::index() for instance. Change-Id: Icd0ae1497705484b021067034c0d8f39049c04ed Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit 1ba3277b4c79b80788e2d600840876856ec6933d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
7229cc75a4
commit
1925abe174
@ -1269,7 +1269,7 @@ void QComboBoxPrivate::updateLineEditGeometry()
|
||||
q->initStyleOption(&opt);
|
||||
QRect editRect = q->style()->subControlRect(QStyle::CC_ComboBox, &opt,
|
||||
QStyle::SC_ComboBoxEditField, q);
|
||||
if (!q->itemIcon(q->currentIndex()).isNull()) {
|
||||
if (currentIndex.isValid() && !q->itemIcon(q->currentIndex()).isNull()) {
|
||||
QRect comboRect(editRect);
|
||||
editRect.setWidth(editRect.width() - q->iconSize().width() - 4);
|
||||
editRect = QStyle::alignedRect(q->layoutDirection(), Qt::AlignRight,
|
||||
|
Loading…
x
Reference in New Issue
Block a user