PDA

View Full Version : Desktop wallpaper Fade In



Dan`
29th November 2010, 19:48
Hi everyone :)

I'm pretty much new to the QT world, so I'm trying to learn something by reading codes and stuff. My main problem now is that I need to set a wallpaper, showing it slowly from a black background.
I googled and tested some methods, but couldn't get it working.
So I'll just post my little code and ask if someone can explain me a way to make the effect I'm looking for :rolleyes:



void Desk::set_wall() {
setPixmap(wall_img);
setScaledContents(true);
setGeometry(0, 0, 1280, 1024);
}



Thanks!

high_flyer
29th November 2010, 19:59
ok, where is the code that deals with fading in?

Dan`
29th November 2010, 20:26
Actually I removed it and what I posted is the simple code that provides me the wallpaper.
After trying to get it working with a for and a setAlpha, I gave up and posted here to get some help on the whole thing, because some people draws a rectangle and make it fade out, and I don't know which is the right way to do it.
I also read on some KDE page online that the setOpacity method its not either a good way.
So I don't know, I'm stuck on this :(

javimoya
29th November 2010, 23:10
you need just:
http://doc.qt.nokia.com/4.7/qgraphicsopacityeffect.html
and this
http://doc.qt.nokia.com/4.7/qpropertyanimation.html

high_flyer
30th November 2010, 10:14
you need just:
Qt is just taking all the fun of coding things your self... bummer... :p