summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2020-02-25 15:41:54 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-02-26 23:09:20 +0100
commit469c3338407a5cf74c5e35c43ebb48c14e21ecac (patch)
tree8332962961595bf20202ea6be1d9acc4acc2437c /src
parentf15aa1fd84e46dfc4d9a78b3a7ba482e42abd9c1 (diff)
QComboBox: deprecate SizeAdjustPolicy::AdjustToMinimumContentLength
As per ### Qt 6 comment and pre-existing documentation, one of the other enum values should be used anyway. Only usage in QtWidgets is in QFileDialog, replace it there with appropriate alternative. [ChangeLog][QtWidgets][QComboBox] the SizeAdjustPolicy value AdjustToMinimumContentLength is deprecated, use AdjustToContents or AdjustToContentsOnFirstShow instead. Change-Id: I22deaa31fbb6c09e87c814e120eb7ee27c177ea9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp2
-rw-r--r--src/widgets/widgets/qcombobox.cpp2
-rw-r--r--src/widgets/widgets/qcombobox.h7
3 files changed, 7 insertions, 4 deletions
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index af2007a4d1..81f0cde407 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -3144,7 +3144,7 @@ void QFileDialogPrivate::createWidgets()
// filetype
qFileDialogUi->fileTypeCombo->setDuplicatesEnabled(false);
- qFileDialogUi->fileTypeCombo->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength);
+ qFileDialogUi->fileTypeCombo->setSizeAdjustPolicy(QComboBox::AdjustToContentsOnFirstShow);
qFileDialogUi->fileTypeCombo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
QObject::connect(qFileDialogUi->fileTypeCombo, SIGNAL(activated(int)),
q, SLOT(_q_useNameFilter(int)));
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index 8c05c6de7a..df8e7b4a3f 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -894,7 +894,7 @@ QStyleOptionComboBox QComboBoxPrivateContainer::comboStyleOption() const
\value AdjustToContents The combobox will always adjust to the contents
\value AdjustToContentsOnFirstShow The combobox will adjust to its contents the first time it is shown.
- \value AdjustToMinimumContentsLength Use AdjustToContents or AdjustToContentsOnFirstShow instead.
+ \omitvalue AdjustToMinimumContentsLength
\value AdjustToMinimumContentsLengthWithIcon The combobox will adjust to \l minimumContentsLength plus space for an icon. For performance reasons use this policy on large models.
*/
diff --git a/src/widgets/widgets/qcombobox.h b/src/widgets/widgets/qcombobox.h
index 1f6e2fcdb3..e0b213bc89 100644
--- a/src/widgets/widgets/qcombobox.h
+++ b/src/widgets/widgets/qcombobox.h
@@ -137,8 +137,11 @@ public:
enum SizeAdjustPolicy {
AdjustToContents,
AdjustToContentsOnFirstShow,
- AdjustToMinimumContentsLength, // ### Qt 6: remove
- AdjustToMinimumContentsLengthWithIcon
+#if QT_DEPRECATED_SINCE(5, 15)
+ AdjustToMinimumContentsLength Q_DECL_ENUMERATOR_DEPRECATED_X(
+ "Use AdjustToContents or AdjustToContentsOnFirstShow"), // ### Qt 6: remove
+#endif
+ AdjustToMinimumContentsLengthWithIcon = AdjustToContentsOnFirstShow + 2
};
Q_ENUM(SizeAdjustPolicy)