I have interfaces obtained from plugins and these interface pointers are stuffed in a QList container. Then this container is shown in a combobox with smth. like:

MyInterface* ptrInterface; // pointer to interface
foreach(ptrInterface, m_container.List() )
ui.combobox->insertItem(0,ptrInterface->Description(), QVariant(ptrInterface));

Next, I am trying to retrieve the data associated with the combobox item:


MyInterface* ptrInterface= qvariant_cast<MyInterface*>(ui.cmbModels->itemData(0));

moc compiler complains that 'qt_metatype_id' : is not a member of 'QMetaTypeId<T>'.

Indeed there is no place to define metatype for interface since interface methods are abstract.

My question is: how to put interface into a combobox item data and then retrieve it? (I understand that currentIndex of combobox also points to a container, but I would rather retrieve the data from combobox item).