QList in QVariant, QVariant::type() returns weird type
问题 I'm trying to store QList<int> in QVariant and then do a typecheck to determine exact type of value stored in QVariant (for serialization). QVariant::type() works fine with scalar types like int or QString , but this is what I got with QList<int> : QList<int> list{1,2,3}; QVariant v = QVariant::fromValue<QList<int>>(list); qDebug() << v.type() << "|" << v.typeName() << "|" << v.userType() << "|" << QVariant::typeToName(v.type()); Produces: QVariant::QWidget* | QList<int> | 1030 | QWidget*