Qt Code:
QList<QVariant> list; QSet<QVariant> varSet; varSet = list.toSet();To copy to clipboard, switch view to plain text mode
Is this not possible? Am getting error If i do so saying this overload is not supported.
Qt Code:
QList<QVariant> list; QSet<QVariant> varSet; varSet = list.toSet();To copy to clipboard, switch view to plain text mode
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.
Horse sense is the thing that keeps horses from betting on people. --W.C. Fields
Ask Smart Questions
Bookmarks