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. Proper way to create an OpenGL Widget since Qt 5 ?

Proper way to create an OpenGL Widget since Qt 5 ?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.7k 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.
  • D Offline
    D Offline
    divide
    wrote on 17 Jan 2014, 08:23 last edited by
    #1

    Hi,

    The new proper way to create opengl context seems to be to derivate QWindow and QOpenGLFunctions, and use setSurfaceType(OpenGLSurface) and initializeOpenGLFunctions().
    (as described in qthelp://org.qt-project.qtgui.520/qtgui/qtgui-openglwindow-example.html )

    But that's for a window. My application use several opengl widgets inside a QSplitter container.
    What's the new proper way to do that ? I used to use QGLWidget, but "QGL" class seems to be deprecated in favor of the new "QOpenGL" class. And I can't setSurfaceType of a QWidget...

    Thanks

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 17 Jan 2014, 08:35 last edited by
      #2

      AFAIK, a proper "next-gen" QGLWidget is in the making, but not ready yet (maybe it will be available in Qt 5.3 or 5.4, depending on how much time does Sean have to work on this).

      (Z(:^

      1 Reply Last reply
      0
      • A Offline
        A Offline
        agocs
        wrote on 17 Jan 2014, 10:36 last edited by
        #3

        You could use QWidget::createWindowContainer(). See http://blog.qt.digia.com/blog/2013/02/19/introducing-qwidgetcreatewindowcontainer/

        Not sure how well it would work with QSplitter with regards to performance when resizing, but it's probably worth a try.

        1 Reply Last reply
        0

        1/3

        17 Jan 2014, 08:23

        • 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