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. Multiple (non-deprecated) OpenGL widgets in a predefined UI design - will it ever work in Qt5?
QtWS25 Last Chance

Multiple (non-deprecated) OpenGL widgets in a predefined UI design - will it ever work in Qt5?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 2.1k 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.
  • R Offline
    R Offline
    RasterBlaster
    wrote on last edited by
    #1

    Hi, some time ago I wrote an example of multiple OpenGL widgets for GTK: "GTK GL app with GStreamer":http://sourceforge.net/projects/gtkglapp/files/?source=navbar which had GStreamer render into a shared OpenGL context across two widgets.

    I then tried the same with QT and found that a) it's not currently possible with QT5 and b) hacks with deprecated functions behave miserably with all GPU's.

    All I am trying to do is this:

    Create a UI with the Qt UI designer that has a window with 2 drawable widgets and other buttons.

    Before the UI is displayed, promote the drawable widgets to OpenGL shared contexts.

    The UI is displayed and then the contexts update via a timer.

    I found that Qt5 just isn't capable of this simple thing (GTK, however, has been for years) - and I'm trying to use Qt because of the other nice things it has :)

    So I am wondering if Qt5 would be able do the above, or is it a dead end?

    Regards.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      seiko
      wrote on last edited by
      #2

      well Its just the qt event loop .. well I can tell even qt5 with QPA under xcb
      still has many bugs .. You can try to use QWindow Its really nice tool to using native window without implement qt accessories and Its give you high ability to render any painting you want

      1 Reply Last reply
      0
      • R Offline
        R Offline
        RasterBlaster
        wrote on last edited by
        #3

        [quote author="seiko" date="1391722275"]well Its just the qt event loop .. well I can tell even qt5 with QPA under xcb
        still has many bugs .. You can try to use QWindow Its really nice tool to using native window without implement qt accessories and Its give you high ability to render any painting you want [/quote]

        Thanks, but I haven't seen any working references to QWindow based off a .ui file and the ability to use multiple OpenGL widgets.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          seiko
          wrote on last edited by
          #4

          since qt 5 QWindow became a window handler for QWidget
          Also qt Widgets became a separate module.
          QWindow its just minimal window only support native events and rendering so its gonna perfect with opengl .. right now I'm planing to using it instead of SDL .
          check this link below its contains example from QT docs
          "https://qt-project.org/doc/qt-5.0/qtgui/openglwindow.html
          ":https://qt-project.org/doc/qt-5.0/qtgui/openglwindow.html

          But if u still wanna use widgets the only way you have is QOpenGLContext and QGLWidget’s QGLContext

          Any way if you decided to convert your project from GTK to QT and needs help , I volunteer , Mail me on "seicoo@gmail.com"

          1 Reply Last reply
          0
          • R Offline
            R Offline
            RasterBlaster
            wrote on last edited by
            #5

            Thanks, but that does not resolve the issue: the example you linked (which I already had a look at before posting here) is for a single OpenGL instance, not multiple OpenGL views within a window - it also doesn't involve a predefined UI.

            [quote author="seiko" date="1391730957"]since qt 5 QWindow became a window handler for QWidget
            Also qt Widgets became a separate module.
            QWindow its just minimal window only support native events and rendering so its gonna perfect with opengl .. right now I'm planing to using it instead of SDL .
            check this link below its contains example from QT docs
            "https://qt-project.org/doc/qt-5.0/qtgui/openglwindow.html
            ":https://qt-project.org/doc/qt-5.0/qtgui/openglwindow.html

            But if u still wanna use widgets the only way you have is QOpenGLContext and QGLWidget’s QGLContext

            Any way if you decided to convert your project from GTK to QT and needs help , I volunteer , Mail me on "seicoo@gmail.com"[/quote]

            1 Reply Last reply
            0
            • S Offline
              S Offline
              seiko
              wrote on last edited by
              #6

              Well that example show you way to use QWindow nothing more .

              but if you wanna to save a time qt has QOpenGLContext.

              QOpenGLContext class give you the ability to share context

              void QOpenGLContext::setShareContext(QOpenGLContext * shareContext)

              check below link I found some one face same request
              "http://stackoverflow.com/questions/19329888/sharing-between-qopenglcontext-and-qglwidget/19330014?noredirect=1":http://stackoverflow.com/questions/19329888/sharing-between-qopenglcontext-and-qglwidget/19330014?noredirect=1

              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