QVariant supports any type of data. You don't need to modify the class. You just need to register your type.
In some header register the type:Q_DECLARE_METATYPE(long double)
and then you can use it:long double foo = 42.0; QVariant bar = QVariant::fromValue(foo); //put value into variant long double bazz = bar.value<long double>(); //and get it back
If you also want to serialize/deserialize your variants you'll need to implement and register stream operators for it: qRegisterMetaTypeStreamOperators().