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

Add QML_PROTOTYPE macro to explicitly override metatype base class detection

    XMLWordPrintable

Details

    Description

      When generating metatypes, only the direct base classes are picked, which is a problem for Language Server if we wrap around a templated class, as following

      class Base : public QObject {
      Q_OBJECT
      ...
      };
      
      template<typename T>
      class TBase : public Base {
      ...
      };
      
      class Derived : public TBase<Item> {
      Q_OBJECT
      ...
      };
      

      At the moment, Qt would detect `TBase<Item>` as a base class. It doesn't give Language Server enough information to provide useful diagnostics. Instead, we could directly specify indirect base class.

      class Derived : public TBase<Item> {
      Q_OBJECT
      QML_PROTOTYPE(Base)
      ...
      };
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qtqmlteam Qt Qml Team User
              minimonium Alexandr Timofeev
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes