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

Q_ENUM is not implemented

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.15.1
    • 5.14.0
    • PySide
    • None
    • All
    • 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

              ctismer Christian Tismer
              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