NOTE: This was made a long time ago with Qt 5. It may need some adjustments to work with newer versions of Qt.
This is a simple example of how to do... what the title says... maybe...
- It shows an image of your choice
- The image is easily adjusted to the window size
- You can zoom the image
- You can move using your mouse through the zoomed image
NOTE: This example only works using a mouse, it is not for touch devices.
The code...
- Is very short and readable
- Is a good QML example
- Only uses a signal handler for handling the mouse wheel event (everything else is done automatically by property bindings)
- Shows you how powerful property bindings are
Recording.mp4
- @nocanstillbb contributed an alternative solution that works differently but preserves mouse position when you zoom. You can try it by uncommenting their QML file in
main.cpp
.