-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtopbarimg.h
35 lines (29 loc) · 856 Bytes
/
topbarimg.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
#ifndef TOPBARIMG_H
#define TOPBARIMG_H
#include <QLabel>
#include <QObject>
#include <QImage>
class TopBarImg : public QLabel
{
Q_OBJECT
public:
explicit TopBarImg(QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
~TopBarImg() override;
TopBarImg();
protected:
void enterEvent(QEnterEvent* event) override; // Mouse enters the widget
void leaveEvent(QEvent* event) override; // Mouse leaves the widget
void mousePressEvent(QMouseEvent* event) override; // Add this line
public:
size_t VecIndex;
QImage OriginalImg;
QString FilePath;
void SetHoveringBorder(bool IsHovering);
void SetSelectedBorder(bool IsSelected);
signals:
void HoverChange(size_t LblIndex, bool Hovering);
void MouseClicked(size_t LblIndex);
private:
bool IsCurrentlySelected;
};
#endif // TOPBARIMG_H