Is it possible to integrate QML code to QtWidgets-based app on Android???



  • I want to insert QML-view into MainWindow. For desktop build it works fine, but under Android I got error.
    Code:
    [code]
    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(350, 500);
    container->setMaximumSize(350, 500);
    container->setFocusPolicy(Qt::TabFocus);
    QUrl qmlUrl("qrc:/main.qml");
    view->setSource(qmlUrl);
    container->move(10,20);
    

    }
    [/code]

    Error:
    [code]
    02-10 05:53:43.345: A/libc(1722): Fatal signal 11 (SIGSEGV) at 0x00000408 (code=1), thread 1749 (QSGRenderThread)
    02-10 05:53:43.475: I/DEBUG(48): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    02-10 05:53:43.475: I/DEBUG(48): Build fingerprint: 'generic/sdk/generic:4.4/KRT16L/892118:eng/test-keys'
    02-10 05:53:43.475: I/DEBUG(48): Revision: '0'
    02-10 05:53:43.475: I/DEBUG(48): pid: 1722, tid: 1749, name: QSGRenderThread >>> org.qtproject.example.QmlViewToQtWidgetProject <<<
    02-10 05:53:43.485: I/DEBUG(48): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000408
    02-10 05:53:43.865: I/DEBUG(48): backtrace:
    02-10 05:53:43.865: I/DEBUG(48): #00 pc 00005d54 /system/lib/libGLESv2.so (glGetString+32)
    02-10 05:53:43.865: I/DEBUG(48): #01 pc 000163ff /data/data/org.qtproject.example.QmlViewToQtWidgetProject/plugins/platforms/android/libqtforandroidGL.so
    02-10 05:53:43.865: I/DEBUG(48): #02 pc 000a348d /data/app-lib/org.qtproject.example.QmlViewToQtWidgetProject-1/libQt5Gui.so (QOpenGLContext::makeCurrent(QSurface*)+224)
    02-10 05:53:43.865: I/DEBUG(48): #03 pc 000b29db /data/app-lib/org.qtproject.example.QmlViewToQtWidgetProject-1/libQt5Quick.so
    02-10 05:53:43.865: I/DEBUG(48): #04 pc 0006a9c1 /data/app-lib/org.qtproject.example.QmlViewToQtWidgetProject-1/libQt5Core.so
    [/code]


Log in to reply
 

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