Qt5.1 Android: Embed QML in QWidget



  • Is it possible to embed QML(QQuickView) in QWidget on android?

    I am trying to do this.
    @MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);

    QQuickView *view = new QQuickView();
    QWidget *container = QWidget::createWindowContainer(view, this);
    container->setMinimumSize(200, 200);
    container->setMaximumSize(300, 300);
    container->setFocusPolicy(Qt::TabFocus);
    view->setSource(QUrl("qrc:/qml/qml/main.qml"));
    ui->verticalLayout->addWidget(container);
    

    }@

    I am getting the error,

    W/Qt (15593): opengl\qopenglshaderprogram.cpp:1748 (int QOpenGLShaderProgram::uniformLocation(const char*) const): QOpenGLShaderProgram::uniformLocation( alphaMax ): shader program is not linked
    E/libEGL (15593): eglMakeCurrent:534 error 3002 (EGL_BAD_ACCESS)
    W/Qt (15593): eglconvenience\qeglplatformcontext.cpp:111 (virtual bool QEGLPlatformContext::makeCurrent(QPlatformSurface*)): QEGLPlatformContext::makeCurrent: eglError: 3002, this: 0x5854c210
    W/Qt (15593):
    F/libc (15593): Fatal signal 11 (SIGSEGV) at 0x00000004 (code=1), thread 15616 (QSGRenderThread)
    'org.qtproject.example.test2' died.

    I am actually trying to find a pathway to embed my opengl based window into Qwidget on android.

    Is QWidget's createWindowContainer() supposed to work on android in Qt5.1?



  • Below is the screenshot of what I am trying to achieve on android. It works with no issues on windows

    !http://s15.postimg.org/jq4hh0qdn/QMLin_Widget.jpg(Screenshot)!



  • I have the same problem, there is no way to solve.

    I'm waiting Qt5.2 or preview 2





  • Ok, it seems that everybody has this problem...and I'm using Qt 5.3.2 (more than a year after your posts)...it becoms frustrating. Until this problem gets a solution, does anyone have another idea about how can we embed QML in QWidget on Android?


Log in to reply
 

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