Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.0
-
None
-
4836d809f5dc3fc9e978ef630c0e5c8847c171a7
Description
Problem:
We should not rely on QVariant::Invalid now that QMetaType::QVariant has been introduced.
Commits:
03daf059647c0a0222e8774b0a083f58c8e64934
24cf789b68f21b2d1ea31580e55c91a2cae25a12
The part of the code where QVariant::Invalid is defined will never be called from 4.7.0. The result is that typedef types are returned with the wrong type in active Qt.
Included in "sources.zip" a sample code to reproduce the problem:
Type QVariant is now returned instead of QVariantList
Suggested patch:
diff --git a/src/activeqt/container/qaxbase.cpp b/src/activeqt/container/qaxbase.cpp index 7692749..f268414 100644 --- a/src/activeqt/container/qaxbase.cpp +++ b/src/activeqt/container/qaxbase.cpp @@ -1670,13 +1670,11 @@ private: prop.typeId |= flags; QVariant::Type vartype = QVariant::nameToType(prop.type); switch(vartype) { - case QVariant::Invalid: + case QVariant::UserType: if (prop.type == "QVariant") { prop.typeId |= 0xff << 24; break; } - // fall through - case QVariant::UserType: if (QMetaType::type(prop.type) == -1) qWarning("QAxBase: Unsupported property type: %s", prop.type.data()); break;