Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Unable to take screenshot of Qt3D window with transparent background on Mac
Forum Update on Monday, May 27th 2025

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt3dqt3dwindowqforwardrenderdefaultframegraqt3drender
2 Posts 2 Posters 752 Views
  • 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.
  • P Offline
    P Offline
    poortipant
    wrote on 10 Apr 2020, 18:13 last edited by
    #1

    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())
    	view->defaultFrameGraph()->setClearColor(color);
    
    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);
        image.save(m_screenshotfilename, "PNG");
    }
    
    

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

    Any ideas what's missing?

    Thanks

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 10 Apr 2020, 18:28 last edited by
      #2

      Hi,

      I can't answer to that directly.

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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      2/2

      10 Apr 2020, 18:28

      • Login

      • Login or register to search.
      2 out of 2
      • First post
        2/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved