-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathimageviewer.h
62 lines (49 loc) · 1.44 KB
/
imageviewer.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
57
58
59
60
61
62
#ifndef IMAGEVIEWER_H
#define IMAGEVIEWER_H
#include "displayformat.h"
#include "graphicsscene.h"
#include "viewerinterface.h"
#include <QTime>
#include <QWidget>
#include <array>
class ImageWidget;
class QGridLayout;
class QGraphicsScene;
class Controller;
class ImageViewer : public QWidget, public ViewerInterface {
Q_OBJECT
std::array< ImageWidget*, 4 > views;
QGridLayout *layout;
Controller *m_controller;
bool dragging;
QTime timer;
void getNewLayout( );
public:
explicit ImageViewer( QWidget *parent = 0 );
~ImageViewer( );
void setViewBgColor( const QColor &color );
bool eventFilter( QObject *obj, QEvent *evt );
GraphicsScene* getScene( size_t axis );
void setController( Controller *value );
Controller* controller( ) const;
signals:
void mouseReleased( QPointF pt, Qt::MouseButtons buttons, size_t axis );
void mouseClicked( QPointF pt, Qt::MouseButtons buttons, size_t axis );
void mouseDragged( QPointF pt, Qt::MouseButtons buttons, size_t axis );
void mouseMoved( QPointF pt, size_t axis );
private slots:
void updateViews( );
void changeImage( );
void setLayoutType( Layout layout );
void setViewMode( Views view );
void setGridLayout( );
void setHorizontalLayout( );
void setVerticalLayout( );
void hideViews( );
void showViews( );
void sliceChanged( size_t axis, size_t slice );
/* QWidget interface */
protected:
void resizeEvent( QResizeEvent* );
};
#endif /* IMAGEVIEWER_H */