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 799 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.
  • Adrian5A Offline
    Adrian5A Offline
    Adrian5
    wrote on 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 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
      • Adrian5A Offline
        Adrian5A Offline
        Adrian5
        wrote on 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

        • Login

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