Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. OpenGL render inside a QGraphicScene
Qt 6.11 is out! See what's new in the release blog

OpenGL render inside a QGraphicScene

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 513 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.
  • S Offline
    S Offline
    Satomi
    wrote on last edited by
    #1

    Hello,
    i am working with a software which has a QGraphiScene, on which are added tons of QGraphicsItems, which are my widgets (even if they are NOT QWidget, but only QGraphicsItems).

    What i need to do, is to define a new my widget (which can live with others) which render a OpenGL scene.

    I have taken a look on the web, but this seems not possible... any clue please?

    This is my first topic on this forum, so please sorry if i am in wrong section.

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

      Hi and welcome to devnet,

      Not a direct answer but this stack overflow answer might give you a starting point.

      Hope it helps

      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
      • S Offline
        S Offline
        Satomi
        wrote on last edited by
        #3

        Hello and many thanks for answer. I am not fully sure to understand the discussion on overflow. He says that "he renders opengl triangle inside QGraphicItems". But how this is possible? I suppose he must define a new custom QGraphicGLItem, inheriting the QOpenGLFunctions at least?

        Another story is the problem he had, resolved by compiling shaders in setViewport function (which is a nice tip).

        Thanks,
        Mirco.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Satomi
          wrote on last edited by
          #4

          Sorry if i am stupid, but i am really confused. I have tried to call openGL functions inside QGraphicsItem, but i get a crash (QtOpenGLFunctions not inited).

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

            Without the code you are using, it's difficult to help you. From the error you get, you are using the QOpenGLFunctions class but you never initialized it.

            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

            • Login

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