Code:
QList<QVariant> list; QSet<QVariant> varSet; varSet = list.toSet();
Is this not possible? Am getting error If i do so saying this overload is not supported.
Printable View
Code:
QList<QVariant> list; QSet<QVariant> varSet; varSet = list.toSet();
Is this not possible? Am getting error If i do so saying this overload is not supported.
QSet is based on QHash. QHash doesn't know how to hash a QVariant. You'll have to find a different solution for what you want, or if the variants are all of the same type, convert them to the type and make a set out of that.
Aside from that you could tell QHash how to hash a QVariant, by providing a qHash() function for QVariants.