Qt5.1 Android : OpenGL in QWidget



  • Hi All,

    I am investigating if there is any pathway to temporarily work around the QGLWidget fullscreen issue on android.
    Currently , in Qt5.1 android, only one full screen opengl surface is provided. The application that I am currently porting to android is heavily dependent on QWidgets. So, rewriting it in QML is not feasible.

    I have been trying to render opengl content in QWidget directly and not use QGLWidget/QGraphicsView.

    I have tried the below options.

    • Create a QML window to render opengl and embed it in QWidget using createWindowContainer().
      -- Does not work on android in QT5.1
    • Use QWindow with QOpenGLContext to render opengl and embed it in QWidget using createWindowContainer(). -- Does not work on android in QT5.1
    • Use standard opengl calls in QWidget and create an opengl surface and render opengl content using it.
      I am currently stuck with getting native window handle of QWidget to pass to eglCreateWindowSurface(). On windows this could be done by getting QWidget::winId(). winId() does not return proper value on android. I have been looking at Qt's opengl and raster plugin source code. The opengl plugin stores nativewindow obtained with ANativeWindow_fromSurface(). There is no such code in raster plugin.
      Is there any way to get EGLNativeWindowType* handle of QWidget on android?

    I would appreciate any suggestion on rendering opengl directly in QWidget so that I could use it along with other GUI widgets.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.