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

Behavior of deriving from extended type inconsistent

    XMLWordPrintable

Details

    Description

      Say a C++ type is registered to the QML engine with an extended type:

       

      qmlRegisterExtendedType<Type, ExtendedType>(uri, 1, 0, "Type"); 

       

      Furthermore, another C++ type public derives from Type, and is registered to the QML engine too:

      qmlRegisterType<DerivedType>(uri, 1, 0, "DerivedType");

       

      should the DerivedType in QML 'inherit' the additional properties of ExtendedType, or not?

       

      Currently the behavior is inconsistent. That is, by default it inherits - unless there's another registration for another major import afterwards:

      // this breaks DerivedType.data
      qmlRegisterType<Type>("XXX", 3, 0, "TypeXXX");

       

      Attachments

        For Gerrit Dashboard: QTBUG-70782
        # Subject Branch Project Status CR V

        Activity

          People

            kkohne Kai Köhne
            kkohne Kai Köhne
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes