Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Windshield wiper effect



  • I want to draw random raindrops over an Image and then have a windshield wiper erase them as it moves over the image.

    One approach is to use a ParticleSystem to emit the raindrops as ImageParticle(s) or ItemParticle(s) with a delegate Component of Image. I can use a Rectangle with a rotation and suitable transformOrigin and a rotation to simulate the windshield wiper. But how do I get the rectangle to do a collision detection with the raindrops during the animation and use the collision to hide or z order the raindrop away? (wiper.contains(mapToItem(wiper, x, y)) would allow each particle to figure out if it is under the wiper rectangle)

    Is there some sort of event handler that fires for each step of the wiper animation?

    Or is this a use case for doing the animation and emitting in C++ instead of QML?


Log in to reply