Issue
I can't find a way to hide QComboBox
items. So far the only way to filter its items out is to delete the existing ones (with .clear()
method). And then to rebuild the entire QComboBox
again using its .addItem()
method.
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?
Solution
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.
Answered By - esorton
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.