Just use this constructor:
QVariant::QVariant(const QList & val)
Constructs a new variant with a list value, val.
I.e. when storing a QList as a QVariant, the template type of the QList has to be a type that is OK for QVariant. There is no other constructor or conversion method for this.
You should be writing this:
QVariant variant(
QList<double>::fromVector(QVector<double>::fromStdVector(data->switch2))
);
setSwitchVariant(variant);