spootnx spootnx - 5 months ago 88
Python Question

How to hide QComboBox items instead of clearing them out

I can't find a way to hide

items. So far the only way to filter its items out is to delete the existing ones (with
method). And then to rebuild the entire
again using its

I would rather temporary hide the items. And when they are needed to unhide them back.
Is hide/unhide on QCombobox items could be accomplished?


You can use the removeItem() method to remove an item from the QComboBox.

void QComboBox::removeItem ( int index )

Removes the item at the given index from the combobox. This will update the current index if the index is removed.

This function does nothing if index is out of range.

If you don't know the index, use the findText() method.

There are no hide/unhide methods for QComboBox items.