-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimagelayout.h
executable file
·47 lines (36 loc) · 1.07 KB
/
imagelayout.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
#ifndef IMAGELAYOUT_H
#define IMAGELAYOUT_H
#include <QObject>
#include <QPushButton>
typedef struct ST_IMAGE
{
QRectF rect;
int flags;
} TImage;
class QImageLayoutButton : public QPushButton
{
Q_OBJECT
public:
enum Flags
{
CROP_IMAGE = 0x01
};
QImageLayoutButton (QWidget *parent = 0);
QImageLayoutButton (const QString & text, QWidget *parent = 0);
QImageLayoutButton (const QIcon & icon, const QString & text, QWidget *parent = 0);
~QImageLayoutButton();
int getImageCnt() {return imageList->length();};
QRectF getImageRect(int i) {return imageList->at(i).rect;};
int getImageFlags(int i) {return imageList->at(i).flags;};
QRectF rect;
void setRect(QRectF rect);
void setRect(qreal x, qreal y, qreal w, qreal h);
void addImage(QRectF rect, int flags = 0);
void addImage(qreal x, qreal y, qreal w, qreal h, int flags = 0);
signals:
public slots:
private:
QList<TImage> *imageList;
void initLayout();
};
#endif // IMAGELAYOUT_H