Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-15157

ActiveQt code was not updated regarding QMetaType changes between 4.6.3 and 4.7.0

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.7.2
    • 4.7.0
    • ActiveX Support
    • 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;
      
      

      Attachments

        1. sources.zip
          1 kB
        2. tst_winactiveqt.zip
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            pullatti Prasanth Ullattil
            sanonymous Nokia Qt Support (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes