-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpaintwidget.h
46 lines (43 loc) · 846 Bytes
/
paintwidget.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
#ifndef PAINTWIDGET_H
#define PAINTWIDGET_H
#include <QWidget>
#include <QPainter>
#include<iostream>
using namespace std;
class PaintWidget : public QWidget
{
Q_OBJECT
public:
explicit PaintWidget(QWidget *parent = nullptr);
protected:
void paintEvent(QPaintEvent *);
private:
QBrush brush;
qreal size;
bool FontFlag;
int FontKind;
int picture_kind;
signals:
public slots:
void setPenColor(QBrush brush1){
if(brush1 != brush){
brush = brush1;
}
update();
}
void setPenSize(qreal size1){
if(size1 != size){
size = size1;
}
update();
}
void setFont(int kind){
FontKind = kind;
update();
}
void setPicture(int kind){
picture_kind = kind;
update();
}
};
#endif // PAINTWIDGET_H