Sonntag, 17. Februar 2008

Running transparent widgets in Qt 4.x on linux systems

After you have set up your xserver with the composite extensions, you are ready for transparent widgets.

Just call the QWidgets setWindowOpacity method and enter a value between 1.0 and 0.0.
The valid range of opacity is from 1.0 (completely opaque) to 0.0 (completely transparent).


QWidget *pTestWidget = new QWidget;
pTestWidget->setWindowOpacity(0.5);
pTestWidget->setGeometry(100,100,200,200);
pTestWidget->show();

And now test it and have fun ;)

Keine Kommentare: