-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathFrame.h
58 lines (42 loc) · 1.17 KB
/
Frame.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
#ifndef FRAME_H
#define FRAME_H
#include <QGraphicsScene>
#include <QGraphicsRectItem>
#include <QImage>
#include <QColor>
#include <QPainter>
#include "BalancePos.h"
#define FRAME_SELECT_THICKNESS 2
class Frame
{
//Empty private default constructor
Frame(){}
QGraphicsScene* scene;
QGraphicsPixmapItem* item;
QGraphicsRectItem* bg;
QGraphicsRectItem* fg;
QImage img;
bool selected;
int x, y;
bool bgTransparent;
bool bVisible;
QColor frameBgCol;
QImage transparentBg;
public:
Frame(QGraphicsScene* s, QImage i, QColor bgCol, QImage tBg, bool frameBgTransparent);
~Frame();
void setPosition(int xPos, int yPos);
int getWidth() {return img.width();}
int getHeight() {return img.height();}
void setFrameBgCol(QColor c);
void resize(int w, int h, BalancePos::Pos vert, BalancePos::Pos horiz);
QImage getImage() {return img;}
void setFrameBgVisible(bool b);
void setFrameBgTransparent(bool b);
void selectToggle();
bool isThis(QGraphicsItem* it) {return it==item;}
bool isSelected() {return selected;}
void render(QPainter& painter);
Frame* copy();
};
#endif // FRAME_H