c++ - How do you define a QHash with heterogeneous value types? -


i need have qhash container takes quint8 keys takes heterogeneous types values, of qt containers or classes. example might want insert qdate or qtime object or quint8 value.

how can define type can use in other classes , fill appropriately @ run time? want able access global type. possible?

n.b. question has been edited better reflect op's intent. answers written before edit appropriate original question.

qvariant type can store of wide range of value types, determined @ runtime, qhash<quint8, qvariant> want.

see https://en.wikipedia.org/wiki/tagged_union general pattern.


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -