Qt6: create QVariant with specific QMetaType
Unsolved
General and Desktop
-
I'm porting an app from Qt5 to Qt6. This app heavily uses QVariants and one of the use-cases is creating invalid QVariant with the specific QVariant::Type, for example
return QVariant( QVariant::Double );
In Qt6 QVariant::Type was replaced with QMetaType::Type, but when I make corresponding changes in the code
return QVariant( QMetaType::Double );
I get following error
error: use of deleted function ‘QVariant::QVariant(QMetaType::Type)’
According to the docs such constructor still exists, so I'm a bit lost what is wrong and how to fix this error.