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

Q_ENUM is not implemented

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.14.0
    • Fix Version/s: 5.15.1
    • Component/s: PySide
    • Labels:
      None
    • Platform/s:
      All
    • Commits:
      d7c52752eaa1f6017a4a8fc0218a0bdd8ea7ea0a (pyside/pyside-setup/5.15)

      Description

      class PrimitiveType(QObject): #for Q_ENUMS: derive from QObject
          POINTS = gl.GL_POINTS
          LINES =  gl.GL_LINES
          LINE_STRIP = gl.GL_LINE_STRIP
          LINE_LOOP = gl.GL_LINE_LOOP
          TRIANGLES = gl.GL_TRIANGLES
          TRIANGLE_STRIP = gl.GL_TRIANGLE_STRIP
          TRIANGLE_FAN = gl.GL_TRIANGLE_FAN
      
      class MyClass(QObject):
      
          PrimitiveType = PrimitiveType    
          Q_ENUM(PrimitiveType)
          ... add property "primitiveType" of type int
      
      

      and use the syntax "primitiveType: MyClass.POINTS" from qml

       

       

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              ctismer Christian Tismer
              Reporter:
              maxlem Maxime Lemonnier
              Votes:
              4 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes