sure, I have following code for this purpose:
void Global
::applyAttributes(QWidget *widget
) {
if(widget==NULL)
return;
widget->setAttribute(Qt::WA_NoMousePropagation);
widget->setAutoFillBackground(true);
//widget->setAttribute(Qt::WA_OpaquePaintEvent);
widget->setAttribute(Qt::WA_PaintOnScreen);
foreach
(QObject *child,widget
->children
()) {
if(child->isWidgetType())
}
}
void Global::applyAttributes(QWidget *widget)
{
if(widget==NULL)
return;
widget->setAttribute(Qt::WA_NoMousePropagation);
widget->setAutoFillBackground(true);
//widget->setAttribute(Qt::WA_OpaquePaintEvent);
widget->setAttribute(Qt::WA_PaintOnScreen);
foreach(QObject *child,widget->children())
{
if(child->isWidgetType())
applyAttributes((QWidget*)child);
}
}
To copy to clipboard, switch view to plain text mode
I call applyAttributes method on parentMost widget in my application and thus every widget is set with WA_PaintOnScreen and autoFillBackground attributes.
void lobal
::createHole(QWidget *widget
) {
if(widget==NULL)
return;
widget
->setBackgroundRole
(QPalette::Window);
widget->setPalette(transparentPal);
}
void lobal::createHole(QWidget *widget)
{
if(widget==NULL)
return;
widget->setBackgroundRole(QPalette::Window);
QPalette transparentPal;
transparentPal.setColor(QPalette::Window, QColor(128,64,128));
widget->setPalette(transparentPal);
}
To copy to clipboard, switch view to plain text mode
I call createHole() on the widget which needs to be transparent to show video. Above mentioned color key (128,64,128) can be any color which is our internal fbset color to make a transparent layer.
Bookmarks