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
Forum Updated to NodeBB v4.3 + New Features

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 525 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.
  • T Offline
    T Offline
    Tom asso
    wrote on 5 May 2020, 23:32 last edited by Tom asso 5 May 2020, 23:33
    #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 6 May 2020, 14:52 last edited by Jkimmy 5 Jun 2020, 15:15
      #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.

      T 1 Reply Last reply 7 May 2020, 16:41
      1
      • J Offline
        J Offline
        Jkimmy
        wrote on 6 May 2020, 00:59 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.

        T 1 Reply Last reply 6 May 2020, 14:50
        0
        • J Jkimmy
          6 May 2020, 00:59

          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.

          T Offline
          T Offline
          Tom asso
          wrote on 6 May 2020, 14:50 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 6 May 2020, 14:52 last edited by Jkimmy 5 Jun 2020, 15:15
            #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.

            T 1 Reply Last reply 7 May 2020, 16:41
            1
            • J Jkimmy
              6 May 2020, 14:52

              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.

              T Offline
              T Offline
              Tom asso
              wrote on 7 May 2020, 16:41 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

              5/5

              7 May 2020, 16:41

              • Login

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