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. How best to integrate OpenGL into a Window with Widgets
Forum Updated to NodeBB v4.3 + New Features

How best to integrate OpenGL into a Window with Widgets

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 794 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
    Adrian5
    wrote on 6 Mar 2018, 23:18 last edited by
    #1

    Hello, returning to Qt after a long hiatus.

    I want write a small application consisting of a Main window with menubar, toolbar, statusbar, and an OpenGL surface inside it.

    I'm somewhat confused about the options. I appears that QOpenGLWindow is for a pure window without any of the aforementioned "bars". Would QOpenGLWidget be the right choice for me? And if so, could you give me rough idea on how to integrate it into my application's window/widget hierarchy? I don't need any details about OpenGL or the event-loop itself.

    I'm using QT 5.10.

    Thanks!

    1 Reply Last reply
    0
    • W Offline
      W Offline
      wrosecrans
      wrote on 7 Mar 2018, 05:02 last edited by
      #2

      Just subclass QopenGLWidget the way it describes in the documentation, and use it teh way you would any other QWidget by adding it to your layout. You only need to use QOpenGLWindow if you are making something that doesn't involve Widgets.

      1 Reply Last reply
      1
      • A Offline
        A Offline
        Adrian5
        wrote on 8 Mar 2018, 22:55 last edited by
        #3

        Ok, thanks. I was able to subclass QOpenGLWidget and use QMainWindow::setCentralWidget(new MyGLWidget()); to integrate it.

        1 Reply Last reply
        0

        1/3

        6 Mar 2018, 23:18

        • Login

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