-
Notifications
You must be signed in to change notification settings - Fork 3
/
testView.h
56 lines (47 loc) · 1.34 KB
/
testView.h
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef _testView_H
#define _testView_H
/***************************************************************
* testView.h
* @Author: Jonathan Verner ([email protected])
* @License: GPL v2.0 or later
* @Created: 2008-10-12.
* @Last Change: 2008-10-12.
* @Revision: 0.0
* Description:
* Usage:
* TODO:
*CHANGES:
***************************************************************/
#include <QtGui/QGraphicsView>
#include <QtCore/QPoint>
class QGraphicsScene;
class QMouseEvent;
class testView : public QGraphicsView {
Q_OBJECT
private:
qreal zoom;
int currentPage;
bool moving, moved;
public:
testView( QGraphicsScene *scene, QWidget *parent = 0 ) : QGraphicsView(scene, parent), zoom(1), currentPage(1), moving(false), moved(false) { setDragMode( QGraphicsView::ScrollHandDrag ); };
int getCurrentPage();
signals:
void mouseNearBorder( const QPoint &pos );
void onPage( int num );
void newAnnotationAction( const QPointF &scenePos );
public slots:
void zoomIN();
void zoomOUT();
void up();
void down();
void left();
void right();
void nextPage();
void prevPage();
void gotoPage( int num );
protected:
virtual void mouseMoveEvent( QMouseEvent *e );
virtual void mouseReleaseEvent( QMouseEvent *e );
virtual void mousePressEvent( QMouseEvent *e );
};
#endif /* _testView_H */