Android QQuickWidget QCamera UI Freeze



  • I'm trying to implement a QR Code Scanner for Android in a Qt Widget project.

    The following code shows how I load the QML code. "camView" is the QQuickWidget. It should display a live stream of the camera video.

    Instead it shows nothing but freezes the whole application, until I do minimize it via the Android home button. Once I resume the application from background, it shows the video feed perfectly.

    @void MainWindow::openScanner()
    {
    returnToCamview();

    QGridLayout *layout = new QGridLayout;
    layout->addWidget(camView);
    camView->setSource(QUrl("qrc:/cameraView.qml"));
    camView->setResizeMode(QQuickWidget::SizeRootObjectToView);
    ui->camBox->setLayout(layout);
    camView->show();
    

    }@

    The second problem is that I need to convert a QVideoFrame in a decent format for QXZing. Currently I do the following when a new frame is probed:

    @QImage::Format imgFormat = QVideoFrame::imageFormatFromPixelFormat(m_currentFrame.pixelFormat());

        QImage lastImage(m_currentFrame.bits(),
            m_currentFrame.width(),
            m_currentFrame.height(),
            m_currentFrame.bytesPerLine(),
            imgFormat);
    
    QString ret = decoder.decodeImage(lastImage);@
    

    "decoder" is the QXZing object. It always returns -1 as the "lastImage" is not valid.

    Thanks in advance!



  • bug confirmed for the first part of the post:

    https://bugreports.qt-project.org/browse/QTBUG-41467


Log in to reply
 

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