summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qcombobox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/qcombobox.cpp')
-rw-r--r--src/gui/widgets/qcombobox.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp
index b606538..0e888d6 100644
--- a/src/gui/widgets/qcombobox.cpp
+++ b/src/gui/widgets/qcombobox.cpp
@@ -2174,11 +2174,14 @@ void QComboBox::insertSeparator(int index)
/*!
Removes the item at the given \a index from the combobox.
This will update the current index if the index is removed.
+
+ This function does nothing if \a index is out of range.
*/
void QComboBox::removeItem(int index)
{
- Q_ASSERT(index >= 0 && index < count());
Q_D(QComboBox);
+ if (index < 0 || index >= count())
+ return;
d->model->removeRows(index, 1, d->root);
}