Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QRenderCaptureReply returns a screenshot with a background and no model



  •  auto camSelector = this->defaultFrameGraph()->findChild<Qt3DRender::QCamera*>();
     m_cap = new Qt3DRender::QRenderCapture(camSelector);
     connect(this, &Q3DShowWindow::signalGetImage,[&](){
        QEventLoop loop;
        auto reply = m_cap->requestCapture();
        qDebug()<<"wait for m_returnimage finish";
        connect(reply, &Qt3DRender::QRenderCaptureReply::completed, [&] {
            m_returnImage = reply->image();
            qDebug()<<"ok in loop";
            reply->deleteLater();
            loop.quit();
            });
        loop.exec();
        });
    

    Above is a screenshot of a scene I used QRenderCaptureReply to get, but m_ReturnImage only gets the background of the scene.
    Why is that? Did I miss something?


  • Lifetime Qt Champion

    Hi,

    Please do not post the same question in multiple sub-forum. One is enough.

    Duplicate

    Closing this one.


Log in to reply