Reputation: 11661
I am currently adding items to Qcombobox as such
ui.comboBox->addItem("SomeItemA");
ui.comboBox->addItem("SomeItemB");
I wanted to know if there was a way to disable items in Qcombobox such that they are not selectable. I am using Qt5
Upvotes: 2
Views: 1715
Reputation: 9014
Try
qobject_cast< QStandardItemModel * >( ui.comboBox->model() )->item( 0 )->setEnabled( false )
Upvotes: 5