-
Notifications
You must be signed in to change notification settings - Fork 1
/
imageviewer.h
64 lines (50 loc) · 1.29 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
63
64
#ifndef IMAGEVIEWER_H
#define IMAGEVIEWER_H
#include <QGraphicsScene>
#include <QLabel>
#include "viewerbase.h"
class QString;
class QBrush;
class QPixmap;
class QByteArray;
class QMovie;
class QBuffer;
class QGraphicsProxyWidget;
namespace Ui {
class ImageViewer;
}
namespace Farman
{
class ImageViewer : public ViewerBase
{
Q_OBJECT
public:
explicit ImageViewer(const QString& filePath, QWidget *parent = Q_NULLPTR);
~ImageViewer() Q_DECL_OVERRIDE;
private Q_SLOTS:
void on_fitInViewCheckBox_stateChanged(int arg1);
void on_scaleComboBox_editTextChanged(const QString &arg1);
void on_scaleComboBox_activated(const QString &arg1);
private:
void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;
void makeScaleComboBox(const QString& scaleStr);
int setData() Q_DECL_OVERRIDE;
void autoScale();
void setScale(qreal scale);
QBrush createTransparentBGBrush();
Ui::ImageViewer *ui;
QGraphicsScene m_scene;
QGraphicsRectItem* m_transparentBgRectItem; // PNG等透過部分がある画像の背景
QGraphicsItem* m_item;
class ItemWidget : public QLabel
{
public:
ItemWidget(QByteArray& buffer);
~ItemWidget();
private:
QBuffer* m_buffer;
QMovie* m_movie;
};
};
}
#endif // IMAGEVIEWER_H