Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Embedding OpenGL graphics drawn through the OpenGL C++ API with a QML GUI
QtWS25 Last Chance

Embedding OpenGL graphics drawn through the OpenGL C++ API with a QML GUI

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 2 Posters 501 Views
  • 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.
  • Tom assoT Offline
    Tom assoT Offline
    Tom asso
    wrote on last edited by Tom asso
    #1

    I would like to embed my "custom" graphics generated through the OpenGL C++ API with a QML-defined GUI. The “underlay” approach described by Guiseppe D’Angelo looks to do almost exactly what I want. But that approach relies on subclassing QQuickView, and my QML GUI needs to contain a menu bar, which apparently isn’t supported by QQuickView. Can D’Angelo’s approach somehow display a menu bar, or can someone recommend an alternate approach?
    Thanks!

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jkimmy
      wrote on last edited by Jkimmy
      #4

      What about the new QtQuick3D? You don't even need to touch any c++ to get started. There is also https://doc.qt.io/qt-5/qtquick-scenegraph-openglunderqml-example.html if you depend on OpenGL.

      Tom assoT 1 Reply Last reply
      1
      • J Offline
        J Offline
        Jkimmy
        wrote on last edited by
        #2

        See https://doc.qt.io/qt-5/qquickframebufferobject.html. You'll have to inherit this, register it with the application engine, and then add it to your window.

        Tom assoT 1 Reply Last reply
        0
        • J Jkimmy

          See https://doc.qt.io/qt-5/qquickframebufferobject.html. You'll have to inherit this, register it with the application engine, and then add it to your window.

          Tom assoT Offline
          Tom assoT Offline
          Tom asso
          wrote on last edited by
          #3

          @Jkimmy - thanks for that suggestion. Looking at that documentation and others I wonder if using a non-default frame buffer is over-kill for my application. This page from khronos.org says "Framebuffer objects are very complicated", and I want to keep my code as simple as possible, but no simpler (haha). My app does not require lots of high-performance animation (I want to display a three-dimensional object that the user can examine using the mouse to change the viewpoint). Is there a simpler approach? Thanks!

          1 Reply Last reply
          0
          • J Offline
            J Offline
            Jkimmy
            wrote on last edited by Jkimmy
            #4

            What about the new QtQuick3D? You don't even need to touch any c++ to get started. There is also https://doc.qt.io/qt-5/qtquick-scenegraph-openglunderqml-example.html if you depend on OpenGL.

            Tom assoT 1 Reply Last reply
            1
            • J Jkimmy

              What about the new QtQuick3D? You don't even need to touch any c++ to get started. There is also https://doc.qt.io/qt-5/qtquick-scenegraph-openglunderqml-example.html if you depend on OpenGL.

              Tom assoT Offline
              Tom assoT Offline
              Tom asso
              wrote on last edited by
              #5

              @Jkimmy - map application definitely requires C++ to read large data files, so I'll try the approach "opengl under QML" example you cited, which uses QQuickItem instead of QQuickView to hold the custom OpenGL drawing. Thanks!

              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