Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/noxware/qt-quick-flickable-and-zoomable-by-mouse-image-example

Qt Quick example project for desktop applications that shows an image and lets you zoom and move.
https://github.com/noxware/qt-quick-flickable-and-zoomable-by-mouse-image-example

example image-viewer qml qt qt5 qtquick

Last synced: about 2 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# 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

https://github.com/noxware/qt-quick-flickable-and-zoomable-by-mouse-image-example/assets/7684329/1d05a9cc-7d6c-4e75-a414-d53d08767855

## More

- [@nocanstillbb](https://github.com/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`.