[Interest] QMultiMap as QVariant

Thomas Sevaldrud thomas at silentwings.no
Fri Apr 14 23:11:14 CEST 2023


Hi, in my code I have a hierarchical QMultiMap of QVariants, where a map value can be a new multimap of variants. This does not compile anymore in Qt 6. I.e. something like this:

   	QMultiMap<QString, QVariant> varMap;
    	QMultiMap<QString, QVariant> subMap;
    	varMap.insert("key", subMap); // Compile error here, since there is no conversion to QVariant

This worked in 5.15, but not in 6.5

If I change it to QMap it works, but I need multimap for this. Is this change by design, or is it an omission? Any ideas for a workaround?

Cheers,
Thomas


More information about the Interest mailing list