Important: Please read the Qt Code of Conduct -

Unable to take screenshot of Qt3D window with transparent background on Mac

  • Hi,

    I have an application that renders 3d (dae) files.
    I also have a feature on my application - to take screenshots of the current scene.

    I am using Qt 5.12 on a Mac 10.14.6

    I implemented functionality so that the screenshot could be taken with a transparent
    background. This is working fine on Windows, but for some unknown reason it does not make the background transparent on Mac.

    This is the code,

    Qt3DRender::QRenderCaptureReply m_renderCaptureReply;
    QColor color = QColor(255, 255, 255, 0);
    if (color.isValid())
    m_renderCaptureReply = m_renderCapture->requestCapture();
    connect(m_renderCaptureReply, SIGNAL(completed()), this, SLOT(saveImageToFile()));
    void My3DQtViewer::saveImageToFile()
        QImage image(m_renderCaptureReply->image().size(), QImage::Format_ARGB32);, "PNG");

    The image is being saved as png but with a white background.

    Any ideas what's missing?


  • Lifetime Qt Champion


    I can't answer to that directly.

    Can you provide a minimal compilable example that shows that behaviour ?