I have a QAction that I wish to use setData() on so I can reference a QWidget at a later date rather then using a QHash for a lookup table.
Code:
act->setData(randomWidget);
Problem is when I want to get that QWidget back and use it. If I try to cast it
I get "error: no matching function for call to ‘qobject_cast(QVariant)’"
If I try to set it directly
I get "error: cannot convert ‘QVariant’ to ‘QWidget*’ in initialization".
In QVariant docs I am allowed to set my own user type data; so am I just misunderstanding the use of a QVariant?
Bob