diff options
Diffstat (limited to 'src-qt5/desktop-utils/lumina-photo/PhotoView.h')
-rw-r--r-- | src-qt5/desktop-utils/lumina-photo/PhotoView.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src-qt5/desktop-utils/lumina-photo/PhotoView.h b/src-qt5/desktop-utils/lumina-photo/PhotoView.h new file mode 100644 index 00000000..a04a70d0 --- /dev/null +++ b/src-qt5/desktop-utils/lumina-photo/PhotoView.h @@ -0,0 +1,26 @@ +#pragma once + +#include <QGraphicsView> +#include <QEvent> + +class PhotoView : public QGraphicsView +{ + Q_OBJECT + public: + PhotoView (QWidget *parent = nullptr); + void zoomNormal (); + void zoomFit (); + void zoomIn (); + void zoomOut (); + + private: + const double scaleFactor = 1.25; + const double invScaleFactor = 1 / 1.25; + bool eventFilter(QObject *, QEvent *event); + void mouseDoubleClickEvent(QMouseEvent *event); + bool isFit = true; + + signals: + void nextImage(); + void prevImage(); +}; |