Thanks for your help and I found words from an article talking about the opacity of Qt. http://doc.trolltech.com/qq/qq16-background.html ...... Qt 3.3 introduced a new widget called windowOpacity property for making top-level widgets (windows) transparent. This property can not be used to make child widgets semi-transparent, and it only works on window systems that support this feature (Mac OS X and Windows 2000 or later). In addition, the windowOpacity property applies to the widget as a whole, not to individual shapes or pixels. In addition, the property windowOpacity Applies to the widget as a whole, not to individual shapes or pixels. ....... So may be simply becuase it is not a top-level widget so that I can not change it opacity? Is there any other method for me to change the opacity of a child widget?
On Mon, Oct 18, 2010 at 12:21 AM, Zhongmiao Li <[email protected]> wrote: > Sorry that the code is really a little complicated, so I just attach 3 > classes concering with my problem and already deleted most some > irrelevant functions. > MainWindow is the class I mentioned as A. B are LogoScreen, > LoginScreen and so on which all inherit from the FadeDisplayWidget. So > now the problem is that I can not change the opacity of LogoScreen, > FadeDisplayWidget independently--If I set the opacity of MainWindow, > the opacity of MainWindow will change and its child widget also looks > transparent. > Their setWindowOpacity just doesn't work---- > after LogoScreen.setWindowOpacity(0), the opacity of LogoScreen is still 1. > Thanks a lot!!! > > On 10/16/10, [email protected] > <[email protected]> wrote: > > Send Qt-jambi-interest mailing list submissions to > > [email protected] > > > > To subscribe or unsubscribe via the World Wide Web, visit > > http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest > > or, via email, send a message with subject or body 'help' to > > [email protected] > > > > You can reach the person managing the list at > > [email protected] > > > > When replying, please edit your Subject line so it is more specific > > than "Re: Contents of Qt-jambi-interest digest..." > > > > > > Today's Topics: > > > > 1. SetWindowOpacity (Zhongmiao Li) > > 2. Re: SetWindowOpacity (Samu Voutilainen) > > > > > > ---------------------------------------------------------------------- > > > > Message: 1 > > Date: Fri, 15 Oct 2010 09:37:24 -0700 > > From: Zhongmiao Li <[email protected]> > > Subject: [Qt-jambi-interest] SetWindowOpacity > > To: [email protected] > > Message-ID: > > <[email protected]> > > Content-Type: text/plain; charset=ISO-8859-1 > > > > Hi dear QtJambi Technician, > > > > I'm using SetWindowOpacity() of QtJambi to do a fade-in and fade-out > > effect. But I'm now stuck in a very strange problem. > > > > I have two components, one inherits from QMainWindow( calls it A), the > > other inherits from QWidget( we can call this B), A is the parent of B > > and all of them is set as Frameless and Transulence. > > I have confirmed that using SetWindowOpacity() to modify the opacity > > of A can work, > > however when I began to change the opacity of B in a timerEvent, it's > > strange that no matter what value I assigned as an variable to the > > SetWindowOpacity(), the opacity of B is never changed, that is, the > > return value of B.windowOpacity() is always 1! > > That's really strange, can you help me to solve this problem? Thank > you!!! > > > > -- > > Best regards > > Li Zhongmiao > > Digital Media, College of Computer Science, Zhejiang University > > > > > > ------------------------------ > > > > Message: 2 > > Date: Sat, 16 Oct 2010 00:26:13 +0300 > > From: Samu Voutilainen <[email protected]> > > Subject: Re: [Qt-jambi-interest] SetWindowOpacity > > To: [email protected] > > Message-ID: <[email protected]> > > Content-Type: Text/Plain; charset="iso-8859-1" > > > > Please attach an example code we can test and look at the behaviour. of > that > > system. > > > > On Friday 15 October 2010 19:37:24 Zhongmiao Li wrote: > >> Hi dear QtJambi Technician, > >> > >> I'm using SetWindowOpacity() of QtJambi to do a fade-in and fade-out > >> effect. But I'm now stuck in a very strange problem. > >> > >> I have two components, one inherits from QMainWindow( calls it A), the > >> other inherits from QWidget( we can call this B), A is the parent of B > >> and all of them is set as Frameless and Transulence. > >> I have confirmed that using SetWindowOpacity() to modify the opacity > >> of A can work, > >> however when I began to change the opacity of B in a timerEvent, it's > >> strange that no matter what value I assigned as an variable to the > >> SetWindowOpacity(), the opacity of B is never changed, that is, the > >> return value of B.windowOpacity() is always 1! > >> That's really strange, can you help me to solve this problem? Thank > you!!! > >> > >> > > > > -- > > Terveisin, > > Samu Voutilainen > > http://smar.fi > > > > > > ------------------------------ > > > > _______________________________________________ > > Qt-jambi-interest mailing list > > [email protected] > > http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest > > > > > > End of Qt-jambi-interest Digest, Vol 33, Issue 14 > > ************************************************* > > > > > -- > Best regards > Li Zhongmiao > Digital Media, College of Computer Science, Zhejiang University > -- Best regards Li Zhongmiao Digital Media, College of Computer Science, Zhejiang University
_______________________________________________ Qt-jambi-interest mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest
