views:

40

answers:

0

I have a Qt app which embeds a Flash Player ActiveX control. I put a button over the flashplayer and I need to set some parts of it transparent. Since the AX control is not part of the Qt rendering pipe, it's needed to fake the transparency. For this purpose I grab the contents of the AX control from under the button, and use it when rendering the button:

QRect wrect = btn.geometry();
QPixmap bgpart = QPixmap::grabWidget(player, wrect);
btn.setBackground(bgpart);

btn is an instance of a custom QPushButton class which uses the background pixmap.

The problem is that it only grabs the screenshot for the very first time after running the app. If the contents of the player change and I call grabWidget again, bgpart will have hold the same pixmap it obtained before.

What should I do to get this correctly?