blob: 3e0bf8763abe7e6d4198beeb685d970b3ec829f1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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 = false;
signals:
void nextImage();
void prevImage();
};
|