forked from FlyWM/ShadowWidget
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakePixmapWidget.h
66 lines (54 loc) · 1.29 KB
/
MakePixmapWidget.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
59
60
61
62
63
64
65
66
/**
* 去掉标题之后添加边框阴影
*
* MakePixmapWidget.h
* 构造出边框阴影QImage方法的头文件。
*
* FlyWM_
* GitHub: https://github.com/FlyWM
* CSDN: https://blog.csdn.net/a844651990
*
*/
#ifndef MAKEPIXMAPWIDGET_H
#define MAKEPIXMAPWIDGET_H
#include <QWidget>
class QPainter;
class QLineEdit;
class QLabel;
class Skin9GridImage
{
protected:
QImage m_img;
QRect m_arrayImageGrid[9];
//
bool clear();
public:
static bool splitRect(const QRect& rcSrc, QPoint ptTopLeft, QRect* parrayRect, int nArrayCount);
// bool setImage(const CString& strImageFileName, QPoint ptTopLeft);
bool setImage(const QImage& image, QPoint ptTopLeft);
// //
// void draw(QPainter* p, QRect rc, int nAlpha) const;
void drawBorder(QPainter* p, QRect rc) const;
// bool valid() const;
// //
// QSize actualSize() const { return m_img.size(); }
};
class ShadowWidget : public QWidget
{
Q_OBJECT
public:
explicit ShadowWidget(int shadowSize, QWidget *parent = nullptr);
virtual void paintEvent(QPaintEvent *e);
private:
Skin9GridImage* m_shadow;
int m_shadowSize;
};
class MakePixmapWidget : public QWidget
{
Q_OBJECT
public:
explicit MakePixmapWidget(QWidget *parent = nullptr);
signals:
public slots:
};
#endif // MAKEPIXMAPWIDGET_H