PDA

View Full Version : How can I make the children widget visible when the parent mainwindow transparent?



charlse
19th August 2008, 09:09
Hi all::)
I created a mainwindow(QMainWindow) and attached a listwidget(QListWidget) to it , I use QWidget::setMask() to make the mainwindow transparent , but the listwidget is transparent too . That isn't what I want .
So how can I make the listwidget visible when the mainwindow is transparent ?
I don't use QWidget::setWindowOpacity()because I develop this application on WIN_CE with a Qt-4.4.0 , this OS doesn't support this method !

here is my code:


ui.setupUi(this);

QSize Size = size();
QPixmap maskPix(Size);
maskPix.fill(Qt::transparent);
setMask(maskPix.mask());


Thanks for you suggestion.

aamer4yu
19th August 2008, 09:31
Does Win CE version of Qt support Style sheets ?
If yes, u may use the style sheet :)

charlse
19th August 2008, 09:46
Does Win CE version of Qt support Style sheets ?
If yes, u may use the style sheet :)

I used the setStyleSheet() but it can't make the mainwindow transparent , If I set the alpha's value 0 , the mainwindow's background-color changed black .