
I'm coming back home on Tuesday afternoon-ish so if you want to catch me for something be sure to make it before then :)
See you in Berlin!
A blog about random things and sometimes about my work translating and developing KDE and anything
void MyClass::myFunction(QVariant v)
{
// unbox the QVariant-QJSValue
if (v.userType() == qMetaTypeId<QJSValue>()) {
v = v.value<QJSValue>().toVariant();
}
// This is your old code that checks the type
// of the QVariant is a valid one
if (v.type() != QVariant::Map &&
v.type() != QVariant::List &&
v.type() != QVariant::StringList) {
qWarning() << "Bad param" << v;
return;
}
// From here your old code that does things
}