PDA

View Full Version : I can't get a transparent window



xiangxw
10th December 2010, 15:00
#include<QApplication>
#include<QWidget>
#include<QPalette>
#include<QColor>

int main ( int argc, char *argv[] )
{
QApplication app(argc,argv);
QWidget * widget=new QWidget;
QPalette pal=widget->palette();
pal.setColor(QPalette::Background,Qt::transparent) ;
widget->setPalette(pal);
widget->show();
return app.exec();
}