You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Friday, January 25th 2013, 9:09pm

Hide item in QComboBox

How is possible to hide and show an item in QCombBox?

I found this:

ui->ComboBox->setItemData(i,"DISABLE",Qt::UserRole-1);
to hide,
but i can't find the code to reshow..

2

Friday, February 22nd 2013, 5:05pm

Use

Source code

1
Qt::SizeHintRole
for this purpose. Read more here

3

Friday, September 30th 2016, 12:03pm

Hi, i have the same problem, but this did not work for me

Source code

1
ui->comboBox->setItemData(i, QSize(0,0), Qt::SizeHintRole);


Any suggestion??

Used tags

QCombobox