[Solved] QAction setData with two data types
-
@QAction *act = new QAction("TEST");
act.setData(QVariant(int, bool));@But I can't set QVariant with two data types. I try with struct & class Object but still errors.
How can I do that?
Thanks -
Try @act.setData(QVariant(QMap<int, bool>))@
Or QList, since the first T is int.
-
@QMap<String,int>@
So, can't make.But, int is unique, so I use QList...
Thanks
-
QVariant holds one value, so you can not stuff two things into it.
You might try a QPair to group two separate things into one entity.