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

WebEngine - How to draw an animated SVG above a transparent web view?



  • On a Qt Quick interface, I need to show a complex animated SVG image. As the standard SVG module didn't support the SVG I want to show, I tried to use a WebEngineView as a component to achieve my drawing.

    All works fine except that I cannot change the background color. I need my image to be shown above a colored background, however the image background is always white.

    I tried the following code:

    WebEngineView
    {
        id: wvWebEngineView
        anchors.fill: parent
        backgroundColor: "transparent"
        url: "qrc:/Resources/Images/tbackupextractor/im-loading-animation.svg"
    }
    

    This resolve the transparency issue, however the background is no longer cleared, and this result to a completely insane drawing:
    WebEngineSVG.png

    So how can I both turn my page background transparent AND show an animated SVG on it?