Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/noxware/qt-quick-flickable-and-zoomable-by-mouse-image-example
- Owner: noxware
- License: unlicense
- Created: 2020-03-05T23:29:20.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-03T01:46:44.000Z (7 months ago)
- Last Synced: 2024-06-04T02:04:17.418Z (7 months ago)
- Topics: example, image-viewer, qml, qt, qt5, qtquick
- Language: QML
- Homepage:
- Size: 4.97 MB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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`.