-
Notifications
You must be signed in to change notification settings - Fork 5
/
textureselector.h
48 lines (38 loc) · 1019 Bytes
/
textureselector.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
#ifndef TEXTURESELECTOR_H
#define TEXTURESELECTOR_H
#include <QWidget>
#include <QString>
#include <QMouseEvent>
#include <QPixmap>
#include <QPainter>
#include <QDebug>
class TextureSelector : public QWidget
{
Q_OBJECT
public:
explicit TextureSelector(QWidget *parent = 0);
~TextureSelector();
void LoadImage(QString FileName);
void paintEvent(QPaintEvent *);
void mouseMoveEvent(QMouseEvent * ev);
void mousePressEvent(QMouseEvent * ev);
void leaveEvent(QEvent *);
void mouseReleaseEvent(QMouseEvent *S);
int getTileSizeX() const;
int getTileSizeY() const;
void setTileSize(int x, int y);
QPixmap *getSelectedPixmap();
QList<QList<int> > getSelectedTiles();
signals:
void TextureSelected();
public slots:
private:
QPixmap *TextureImg;
QList<QPixmap*> TileImages;
int TileSizeX, TileSizeY;
QRect HiglightRect;
QRect GrabbedAreaRect;
bool isMouseHovering;
bool isMouseDown;
};
#endif // TEXTURESELECTOR_H