Details
-
Bug
-
Resolution: Duplicate
-
P3: Somewhat important
-
None
-
5.12.2
-
None
Description
When using QVariant as a type for a property. The generated code looks like this:
QVariant varValue() const { const QVariant variant = propAsVariant(2); if (!variant.canConvert<QVariant>()) { qWarning() << "QtRO cannot convert the property varValue to type QVariant"; } return variant.value<QVariant >(); }
As the property is already available as a QVariant internally, there is no need to convert this again.
Trying to convert it is also a problem as a default constructed QVariant() results in a invalid QVariant and cannot be converted, which means the following error message is shown when no "valid" QVariant is send:
QtRO cannot convert the property varValue to type QVariant