Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2365

@QmlElement decorator doesn't return original type

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Not Evaluated
    • None
    • 6.5.2
    • PySide
    • None

    Description

      The QmlElement decorator returns an object type instead of returning the original type. Because of that, the IDE's can't handle a type decorated with @QmlElement correctly:

      • creating a decorated object is shown as an error
      • object's methods or properties are not shown by auto-complete

      Here is a small code sample:

      @QmlElement
      @QmlUncreatable("Can only be created in python.")  # type: ignore
      class Project(QObject):
         pass
      
      proj = Project()
      

      Attachments

        1. image-2023-06-20-13-42-36-546.png
          14 kB
          Ionutz Borcoman
        2. pyside2365.py
          0.4 kB
          Friedemann Kleint

        Issue Links

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

          Activity

            People

              crmaurei Cristian Maureira-Fredes
              iborco Ionutz Borcoman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes