-
Notifications
You must be signed in to change notification settings - Fork 1
/
layer_image.h
49 lines (37 loc) · 964 Bytes
/
layer_image.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
#pragma once
#include <QString>
#include <QWidget>
#include <QPixmap>
#include <QPoint>
namespace psv
{
class layer_image : public QWidget
{
Q_OBJECT
public:
layer_image(QWidget* parent = nullptr);
~layer_image();
void set_layer_name(const QString& layer_name);
QString layer_name() const { return layer_name_; }
QString filesystem_layer_name() const;
void set_file_name(const QString& file_name);
QString file_name() const;
void set_pixmap(const QPixmap& pixmap);
const QPixmap& pixmap() const { return pixmap_; }
const QPixmap& icon() const { return icon_; }
void set_selected(bool selected);
bool selected() const { return selected_; }
virtual QSize sizeHint() const;
static const int icon_size = 128;
private:
virtual void mouseDoubleClickEvent(QMouseEvent* e);
virtual void paintEvent(QPaintEvent* e);
private:
bool selected_;
QString layer_name_;
QString file_name_;
QPixmap pixmap_;
QPixmap icon_;
QPoint start_drag_;
};
}