标题:QLabel无法透明显示?
作者:青春岁月
日期:2014-03-04 17:08
内容:
操作系统:Ubuntu13.10
QT版本:QT5.2
问题:我利用mplayer将摄像头的图像显示到QLabel当中。然后再添加一个QLabel,让其显示在图像上面。但是总是无法做到透明。我希望只显示字体,不显示白色背景。请问哪位大神,可以赐个高招!
#include "widget.h"
#include "ui_widget.h"
Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
{
ui->setupUi(this);
//ui->lcdNumber->raise();
process = new QProcess(this);
QString str;
str = tr("mplayer tv:// -slave -quiet -vf screenshot -tv device=/dev/video0 -wid ");
str.append(QString::number(ui->viewLabel->winId()));
process->setProcessChannelMode(QProcess::MergedChannels);
process->start(str,QIODevice::ReadWrite);
this->update();
}
Widget::~Widget()
{
process->close();
delete ui;
}
#1 [彩阳 03-04 21:21]
setAutoFillBackground( false );
#2 回 彩阳 的帖子 [青春岁月 03-05 08:58]
彩阳:setAutoFillBackground( false ); (2014-03-04 21:21)
这个方法不行,效果是一样的!
#3 [jndingxin 03-03 14:20]
同求
#4 [XChinux 03-03 19:28]
setStyleSheet("background:transparent;");
试试设置qt style sheet?