Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Missing functions in PySide6 (textureId())?
Forum Updated to NodeBB v4.3 + New Features

Missing functions in PySide6 (textureId())?

Scheduled Pinned Locked Moved Unsolved Qt for Python
8 Posts 3 Posters 683 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AName
    wrote on last edited by AName
    #1

    Hi everyone,

    I just started using PySide6 for my new application and so far the experience is pretty good. However, I try to start working on some bridging stuff for which I need to use OpenGL. According to the documentation, A QOpenGLTexture should have the method textureId(). This one does not seem to be present in PySide6 at the moment (I've installed the latest 6.1.2). Does anyone know what the cause of this could be? Or better yet, how to solve it?

    (Bonus question, does anyone know if there's some way to access the low-levels objects, so I can extract a raw pointer to the underlying GLContext? Something akin to QOpenGLContext::nativeHandle())

    Many thanks in advance!

    eyllanescE 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      This looks like a bug on the binding side. You should check the bug report system to see if this is something known.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A AName

        Hi everyone,

        I just started using PySide6 for my new application and so far the experience is pretty good. However, I try to start working on some bridging stuff for which I need to use OpenGL. According to the documentation, A QOpenGLTexture should have the method textureId(). This one does not seem to be present in PySide6 at the moment (I've installed the latest 6.1.2). Does anyone know what the cause of this could be? Or better yet, how to solve it?

        (Bonus question, does anyone know if there's some way to access the low-levels objects, so I can extract a raw pointer to the underlying GLContext? Something akin to QOpenGLContext::nativeHandle())

        Many thanks in advance!

        eyllanescE Offline
        eyllanescE Offline
        eyllanesc
        wrote on last edited by
        #3

        @AName I don't check what the OP points out, if that method can be accessed in PySide6:

        from OpenGL.GL import GLuint
        
        import PySide6
        from PySide6.QtCore import qVersion
        from PySide6.QtGui import QGuiApplication, QOffscreenSurface, QOpenGLContext
        from PySide6.QtOpenGL import QOpenGLTexture
        
        
        if __name__ == "__main__":
            print(f"PySide6 version: {PySide6.__version__}, Qt version:  {qVersion()}")
        
            app = QGuiApplication()
            off_screen = QOffscreenSurface()
            off_screen.create()
            if off_screen.isValid():
                context = QOpenGLContext()
                if context.create():
                    context.makeCurrent(off_screen)
                    text = QOpenGLTexture(QOpenGLTexture.Target2D)
                    text.setMinMagFilters(QOpenGLTexture.Linear, QOpenGLTexture.Linear)
                    text.create()
                    texture_id = text.textureId()
                    print(texture_id, GLuint(texture_id))
                    text.destroy()
        

        Output:

        PySide6 version: 6.1.2, Qt version:  6.1.2
        1 c_uint(1)
        

        If you want me to help you develop some work then you can write to my email: [email protected].

        A 1 Reply Last reply
        0
        • eyllanescE eyllanesc

          @AName I don't check what the OP points out, if that method can be accessed in PySide6:

          from OpenGL.GL import GLuint
          
          import PySide6
          from PySide6.QtCore import qVersion
          from PySide6.QtGui import QGuiApplication, QOffscreenSurface, QOpenGLContext
          from PySide6.QtOpenGL import QOpenGLTexture
          
          
          if __name__ == "__main__":
              print(f"PySide6 version: {PySide6.__version__}, Qt version:  {qVersion()}")
          
              app = QGuiApplication()
              off_screen = QOffscreenSurface()
              off_screen.create()
              if off_screen.isValid():
                  context = QOpenGLContext()
                  if context.create():
                      context.makeCurrent(off_screen)
                      text = QOpenGLTexture(QOpenGLTexture.Target2D)
                      text.setMinMagFilters(QOpenGLTexture.Linear, QOpenGLTexture.Linear)
                      text.create()
                      texture_id = text.textureId()
                      print(texture_id, GLuint(texture_id))
                      text.destroy()
          

          Output:

          PySide6 version: 6.1.2, Qt version:  6.1.2
          1 c_uint(1)
          
          A Offline
          A Offline
          AName
          wrote on last edited by
          #4

          @SGaist

          Yes this looked like such a simple feature that it seemed like a very unlikely bug, especially given that (most of?) the library code is auto-generated. So I wanted to double-check whether there was actually something wrong on my end.

          @eyllanesc
          Very strange, if I run your exact code I still get the same error message:

          Traceback (most recent call last):
          File ".../main.py", line 22, in <module>
          texture_id = text.textureId()
          AttributeError: 'PySide6.QtOpenGL.QOpenGLTexture' object has no attribute 'textureId'

          I'm running PySide6 version 6.1.2 and Qt version 6.1.2. Python is at 3.9.6. Any clue as to where the problem might be?

          eyllanescE 1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            How did you install PySide6 ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            A 1 Reply Last reply
            0
            • A AName

              @SGaist

              Yes this looked like such a simple feature that it seemed like a very unlikely bug, especially given that (most of?) the library code is auto-generated. So I wanted to double-check whether there was actually something wrong on my end.

              @eyllanesc
              Very strange, if I run your exact code I still get the same error message:

              Traceback (most recent call last):
              File ".../main.py", line 22, in <module>
              texture_id = text.textureId()
              AttributeError: 'PySide6.QtOpenGL.QOpenGLTexture' object has no attribute 'textureId'

              I'm running PySide6 version 6.1.2 and Qt version 6.1.2. Python is at 3.9.6. Any clue as to where the problem might be?

              eyllanescE Offline
              eyllanescE Offline
              eyllanesc
              wrote on last edited by
              #6

              @AName How have you installed the libraries? I have created a virtualenv and installed opengl and pyside6 using pip.

              If you want me to help you develop some work then you can write to my email: [email protected].

              1 Reply Last reply
              0
              • SGaistS SGaist

                How did you install PySide6 ?

                A Offline
                A Offline
                AName
                wrote on last edited by
                #7

                @SGaist

                I created a virtualenv and ran "pip3 install pyside6", also tried un- and reinstalling a couple times. I'm on macOS btw, if that could matter

                eyllanescE 1 Reply Last reply
                0
                • A AName

                  @SGaist

                  I created a virtualenv and ran "pip3 install pyside6", also tried un- and reinstalling a couple times. I'm on macOS btw, if that could matter

                  eyllanescE Offline
                  eyllanescE Offline
                  eyllanesc
                  wrote on last edited by
                  #8

                  @AName I just did a test using linux, windows and macos with python 3.7, 3.8 and 3.9 verifying that the textureId method is not available in macos, I recommend you report the bug.

                  If you want me to help you develop some work then you can write to my email: [email protected].

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved
                  OSZAR »