O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Have a go hero – Rotating and scaling with a mouse

Of course, you don't have to use PinchArea to rotate or scale an item. Properties controlling those aspects are regular properties that you can read and write at any time. Try replacing PinchArea with MouseArea to obtain a result similar to what we just did by modifying the scale and rotation properties as a result of receiving mouse events—when the user drags the mouse while pressing the left button, the image is scaled and when the user does the same while pressing the right button, the image is rotated.

If you manage to do the task, try replacing MouseArea with PinchArea again, but then, instead of using the pinch property, handle events manually to obtain the same effect (the event object ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required