-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtipwidget.h
40 lines (32 loc) · 859 Bytes
/
tipwidget.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
#ifndef TIPWIDGET_H
#define TIPWIDGET_H
#include <QWidget>
namespace Ui {
class TipWidget;
}
class TipWidget : public QWidget
{
Q_OBJECT
public:
explicit TipWidget(QWidget *parent = nullptr);
~TipWidget();
void setColor(const QColor& brushColor, const QColor& penColor);
void setNormalStyle(void);
void setFailedStyle(void);
void showNormalStyle(void);
void showFailedStyle(void);
private:
void moveCenter(const QPoint& pos);
void traceCursor();
private:
Ui::TipWidget *ui;
QTimer* timer_cursor = nullptr;
QColor brushColor = Qt::red;
QColor penColor = Qt::black;
// QWidget interface
protected:
virtual void paintEvent(QPaintEvent* event) override;
virtual void showEvent(QShowEvent* event) override;
virtual void hideEvent(QHideEvent* event) override;
};
#endif // TIPWIDGET_H