Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt5.1 Android: Embed QML in QWidget
Forum Updated to NodeBB v4.3 + New Features

Qt5.1 Android: Embed QML in QWidget

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 3 Posters 3.8k Views 1 Watching
  • 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.
  • U Offline
    U Offline
    user28
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • U Offline
      U Offline
      user28
      wrote on last edited by
      #2

      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)!

      1 Reply Last reply
      0
      • F Offline
        F Offline
        flaviomarcio
        wrote on last edited by
        #3

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

        I'm waiting Qt5.2 or preview 2

        Flavio Portela

        1 Reply Last reply
        0
        • F Offline
          F Offline
          flaviomarcio
          wrote on last edited by
          #4

          You can follow here
          http://qt-project.org/forums/viewthread/29978/

          Flavio Portela

          1 Reply Last reply
          0
          • F Offline
            F Offline
            Flavia
            wrote on last edited by
            #5

            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?

            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