I can\'t find a standard way to disable an individual item in a Qt combo box. Is there a facility to do this in Qt that I am missing?
You can use the model of a QListWidget
as a proxy.
QComboBox *combo = new QComboBox(this);
QListWidget *contents = new QListWidget(combo);
contents->hide();
combo->setModel(contents->model());
/* Populate contents */
contents->addItem("..."); // Etcetera
Then, this method will disable an item:
void disableItem(int index)
{
QListWidgetItem *item = contents->item(index);
item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
}