Fix warning about deprecated QComboBox::AdjustToMinimumContentsLength
Change-Id: Ibdc95e9af7bd456a94ecfffd1603f5c25dabf78e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
cf4a8b12fa
commit
9de8313b0b
@ -385,6 +385,16 @@ int QComboBoxPrivate::computeWidthHint() const
|
||||
return tmp.width();
|
||||
}
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 15)
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_DEPRECATED
|
||||
static constexpr QComboBox::SizeAdjustPolicy deprecatedAdjustToMinimumContentsLength()
|
||||
{
|
||||
return QComboBox::AdjustToMinimumContentsLength;
|
||||
}
|
||||
QT_WARNING_POP
|
||||
#endif
|
||||
|
||||
QSize QComboBoxPrivate::recomputeSizeHint(QSize &sh) const
|
||||
{
|
||||
Q_Q(const QComboBox);
|
||||
@ -412,10 +422,11 @@ QSize QComboBoxPrivate::recomputeSizeHint(QSize &sh) const
|
||||
}
|
||||
}
|
||||
break;
|
||||
case QComboBox::AdjustToMinimumContentsLength:
|
||||
case deprecatedAdjustToMinimumContentsLength():
|
||||
for (int i = 0; i < count && !hasIcon; ++i)
|
||||
hasIcon = !q->itemIcon(i).isNull();
|
||||
default:
|
||||
break;
|
||||
case QComboBox::AdjustToMinimumContentsLengthWithIcon:
|
||||
;
|
||||
}
|
||||
} else {
|
||||
@ -1792,7 +1803,7 @@ void QComboBox::setMinimumContentsLength(int characters)
|
||||
d->minimumContentsLength = characters;
|
||||
|
||||
if (d->sizeAdjustPolicy == AdjustToContents
|
||||
|| d->sizeAdjustPolicy == AdjustToMinimumContentsLength
|
||||
|| d->sizeAdjustPolicy == deprecatedAdjustToMinimumContentsLength()
|
||||
|| d->sizeAdjustPolicy == AdjustToMinimumContentsLengthWithIcon) {
|
||||
d->sizeHint = QSize();
|
||||
d->adjustComboBoxSize();
|
||||
|
Loading…
Reference in New Issue
Block a user