PDA

View Full Version : Making my QStackedWidget transperant



Charvi
31st July 2012, 08:10
Hi,

I want the pages in my QStackedWidget to be transparent. I tried using the method

ui->stackedWidget->setWindowOpacity(0.0);

but it doesn't work. Does anybody have any idea how to set my pages transparent ?

Thanks for the help in advance.
- Charvi

sonulohani
31st July 2012, 09:59
Ideally QStackedWidget (qt-project.org/doc/qt-4.8/qstackedwidget.html)is used to put mutiple widgets in it but only one widget visible at any time (which is on top of the stack). In your case you need a transparent layer (hence another widget which is transparent), hence I don’t see any difference if the underlying widget is QStackedWidget (qt-project.org/doc/qt-4.8/qstackedwidget.html)or something else. As mentioned before, go for QGraphicsView (qt-project.org/doc/qt-4.8/QGraphicsView.html) to create multiple layers.

StrikeByte
31st July 2012, 10:00
Hi,

The stacked widget is always transparent. why do you want to set it again? to show more pages that are stacked? (this is not possible only one page is shown at a time)

Charvi
31st July 2012, 12:33
Hi,

The stacked widget is always transparent. why do you want to set it again? to show more pages that are stacked? (this is not possible only one page is shown at a time)

Yes got it. Can't show all the pages with some pages transparent on the QStackedWidget. Only one page will be visible at a time.