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:
    @parent->setAttribute(Qt::WA_TranslucentBackground);@

    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):
    "http://i.imgur.com/IK5yfT1.png":http://i.imgur.com/IK5yfT1.png

    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":http://qt-project.org/forums/viewthread/24837.
    • 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
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.