Of course it is! Just set this flag (introduced in 4.5, it was trickier before):
topLevelWidget->setAttribute( Qt::WA_TranslucentBackground, true );
and if you can't see behind your window, just use some non-opaque color, like:
QPalette pal;
pal.setBrush( QPalette::Window, QColor(255, 0, 0, 64) );
topLevelWidget->setPalette(pal);
topLevelWidget->setAutoFillBackground(true); // maybe it's the default!
and if you still have troubles, *paint with a glass painting* on your paintEvent(...) ;-), like:
QPainter p( this );
p.fillRect( rect(), Qt::transparent /*QColor(0, 0, 0, 0)*/ );
Note that on X11 your window will be transparent only with compositing active (compiz, kwin4 with effects, ...etc).
Bookmarks