-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImageItem.h
More file actions
38 lines (29 loc) · 709 Bytes
/
Copy pathImageItem.h
File metadata and controls
38 lines (29 loc) · 709 Bytes
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
#ifndef IMAGEITEM_H
#define IMAGEITEM_H
#include <QObject>
#include <QWidget>
#include <QLabel>
#include <QMouseEvent>
#include "Utils.h"
class ImageItem : public QLabel
{
Q_OBJECT
public:
explicit ImageItem(const ImageFile& imageFile, QWidget *parent = nullptr);
void setChecked(bool isChecked);
void setSelected(bool isSelected);
std::string getFilepath() const {
return m_filepath;
}
signals:
protected:
void paintEvent(QPaintEvent* event) override;
void mousePressEvent(QMouseEvent* event) override;
private:
std::string m_filepath;
FileType m_fileType;
QPixmap m_image;
bool m_isChecked;
bool m_isSelected;
};
#endif // IMAGEITEM_H