PDA

View Full Version : Dynamic wallpaper



UrATowelie
4th October 2017, 14:25
Hey Guys, so here's the thing: i want to make a "bouncy" wallpaper (those classical that when reach the end of screen bounce to another direction) but with that, i also would like to make the option of mouse drag and drop the png and after the button release, the image keeps bouncing... is it better to use QLable or QGraphics? Thanks for the attention, appreciate the help.

d_stranz
4th October 2017, 16:23
QLabel or QGraphics?

It probably doesn't matter which one you use. With QLabel you do not have the overhead of creating a QGraphicsScene and QGraphicsView, but then you also do not have as much control over the shape and other properties of the label. With the graphics framework, your label can be any size or shape. Personally, I would probably choose the graphics framework.

You should look into the Qt Animation framework (https://doc.qt.io/qt-5/animation-overview.html) for implementing the motion part. It would be very cool if you could make your image "squishy" - when it hits the wall, it squishes a little before it bounces off, just like a regular foam ball would. You could even throw in an occasional rotten tomato that squishes a little bit too much.