QML not showing in Qt Widgets app on Android
-
I included some QML inside my Qt app like this:-
@QQuickView *mixtureinfoview = new QQuickView;
mixtureinfoview->rootContext()->setContextProperty("m", m);
mixtureinfoview->setSource(QUrl("qrc:/qml/mixtureinfo.qml"));QWidget *mixtureinfowidget = QWidget::createWindowContainer(mixtureinfoview); ui->verticalLayout_mixtureinfo->addWidget(mixtureinfowidget);@
On my desktop it works fine. But the QML doesn't display on my android. Whenever i Qt tries to load the QMLs, the following messages appear in the debug window
@E/libEGL (29636): eglMakeCurrent:540 error 3002 (EGL_BAD_ACCESS)
W/Qt (29636): eglconvenience/qeglplatformcontext.cpp:119 (virtual bool QEGLPlatformContext::makeCurrent(QPlatformSurface*)): QEGLPlatformContext::makeCurrent: eglError: 3002, this: 0x67441850
W/Qt (29636):
E/libEGL (29636): eglMakeCurrent:540 error 3002 (EGL_BAD_ACCESS)
W/Qt (29636): eglconvenience/qeglplatformcontext.cpp:119 (virtual bool QEGLPlatformContext::makeCurrent(QPlatformSurface*)): QEGLPlatformContext::makeCurrent: eglError: 3002, this: 0x67441850 @Any idea? All the other Qt Creator examples work in the tablet tho.
-
I'm getting something similar when I use a regular QWindow as the parent of the QuickView on Android 4.3 using Qt 5.2.1
@
QWindow window;
window.show();QQuickView view; view.setSource(QUrl("qrc:/fps.qml")); view.setParent(&window); view.show();
@
And here is what I got:
@
E/libEGL (28532): eglMakeCurrent:671 error 3009 (EGL_BAD_MATCH)
W/Qt (28532): eglconvenience/qeglplatformcontext.cpp:128 (virtual bool QEGLPlatformContext::makeCurrent(QPlatformSurface*)): QEGLPlatformContext::makeCurrent: eglError: 3009, this: 0x5964dbc0
W/Qt (28532):
E/libEGL (28532): eglMakeCurrent:671 error 3009 (EGL_BAD_MATCH)
W/Qt (28532): eglconvenience/qeglplatformcontext.cpp:128 (virtual bool QEGLPlatformContext::makeCurrent(QPlatformSurface*)): QEGLPlatformContext::makeCurrent: eglError: 3009, this: 0x5964dbc0
W/Qt (28532):
E/libEGL (28532): eglMakeCurrent:671 error 3009 (EGL_BAD_MATCH)
W/Qt (28532): eglconvenience/qeglplatformcontext.cpp:128 (virtual bool QEGLPlatformContext::makeCurrent(QPlatformSurface*)): QEGLPlatformContext::makeCurrent: eglError: 3009, this: 0x5964dbc0
W/Qt (28532):
E/libEGL (28532): eglMakeCurrent:671 error 3009 (EGL_BAD_MATCH)
W/Qt (28532): eglconvenience/qeglplatformcontext.cpp:128 (virtual bool QEGLPlatformContext::makeCurrent(QPlatformSurface*)): QEGLPlatformContext::makeCurrent: eglError: 3009, this: 0x5964dbc0
W/Qt (28532):
@This is really inconvenient because I did all my openGL rendering work in a QWindow subclass and I was hoping to be able to draw some QML on top of it.
The same code works fine on Ubuntu 14.04, minus a transparency issue with QML.
Here is my conclusion: If you want to make a 3D game and use QML to make your HUD, you are out of luck.