QVariant::setValue is supposed to be able to set a QVariant to a custom class, thus
|
Source code
|
1
2
3
4
5
|
QVariant qv;
MyCustomClass mcc;
qv.setValue(mcc);
|
However, this generates an error:
error: 'qt_metatype_id' is not a member of 'QMetaTypeId<BinModel>'
The docs specifically say "struct" and not "class". While in my little c-brain structs are just classes with fields being default public instead of default private, this may in fact be the issue. Perhaps it literally needs to be a struct (which would be VERY inconvenient).
(The ultimate goal here is to reimplement the data() function for QAbstractTableModel, so my custom QItemDelegate can be rendered as a cell in my custom table.)
I am developing in XCode on a Mac, OS 10.5, if that matters.