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