Skip to content

Qt Quick example project for desktop applications that shows an image and lets you zoom and move.

License

Notifications You must be signed in to change notification settings

noxware/qt-quick-flickable-and-zoomable-by-mouse-image-example

Repository files navigation

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.

About

Qt Quick example project for desktop applications that shows an image and lets you zoom and move.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published