summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorStian Sandvik Thomassen <stian.thomassen@nokia.com>2009-10-15 13:31:39 +1000
committerStian Sandvik Thomassen <stian.thomassen@nokia.com>2009-10-15 13:31:39 +1000
commit03c587f510f2a5f9126b53a0c3913ac06bb86c79 (patch)
treeb7d97af9f7a90fcb9466e0a4698ff344d43de47a /src/gui
parente49d92f620313c0921ece291548a8a9c6a809586 (diff)
Removed assertion from QComboBox::removeItem()
Made QComboBox::removeItem() do nothing instead of asserting if index is out of range. Reviewed-by: Andy Shaw
Diffstat (limited to 'src/gui')
-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 b60653812c..0e888d6c2b 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);
}