Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 1.12 KB

File metadata and controls

30 lines (19 loc) · 1.12 KB

Qt-Quick-Flickable-And-Zoomable-By-Mouse-Image-Example

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...

What it does

  • 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.

Code notes

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

Recordings

Recording.mp4

More

  • @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.