#include#include int main() { QVariantList list; list.append(1); list.append("hello"); list.append(3.14); qDebug() << list; return 0; }
(1, "hello", 3.14)
#include#include #include int main() { QVariantMap map1; map1.insert("name", "John"); map1.insert("age", 30); QVariantMap map2; map2.insert("name", "Mary"); map2.insert("age", 25); QVariantList list; list.append(map1); list.append(map2); qDebug() << list; return 0; }
({name="John", age=30}, {name="Mary", age=25})This example also uses the Qt framework, so the package library is most likely "Qt".