Important: Please read the Qt Code of Conduct -

Qt HTML5 in a transparent frame

  • Hello everyone,

    I'm trying to create a translucent/transparent frame/window where I can render some HTML (without background). In Qt Quick it was fairly easy to achieve the transparent window, but because of the HTML requirement I started of with the HTML5 project template.

    I then modified htmlapplicationviewer.cpp, Html5ApplicationViewerPrivate() to do:

    This makes the frame transparent as expected, but as a lot of other posts mention the repainting of the frame if broken and I get something like this for the HTML5 template application (the stars you see is my desktop background, so the window is fully transparent as wanted):

    It seems that the repaint issue is known, but the solutions do not seem to work for me. Things I tried:

    • parent->setAutoFillBackground(false)
    • overwrite the repaintEvent() of the Html5ApplicationViewerPrivate as suggested "here":
    • messed with the palette and did setBrush(QPalette::Base, Qt::transparent); for parent and Html5ApplicationViewerPrivate.

    However, I did not find a solution. Anyone that can help me?

Log in to reply