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. Android QQuickWidget QCamera UI Freeze
Forum Updated to NodeBB v4.3 + New Features

Android QQuickWidget QCamera UI Freeze

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 1 Posters 1.4k 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.
  • metaDomM Offline
    metaDomM Offline
    metaDom
    wrote on last edited by
    #1

    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!

    1 Reply Last reply
    0
    • metaDomM Offline
      metaDomM Offline
      metaDom
      wrote on last edited by
      #2

      bug confirmed for the first part of the post:

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

      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