forked from ic005k/OCAuxiliaryTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtooltip.h
41 lines (33 loc) · 829 Bytes
/
tooltip.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
#ifndef TOOLTIP_H
#define TOOLTIP_H
#include <QBitmap>
#include <QDialog>
#include <QPainterPath>
#include <QPropertyAnimation>
#include <QTextBrowser>
#include <QTextEdit>
class QLabel;
class Tooltip : public QDialog {
public:
Tooltip(QWidget* parent = nullptr);
~Tooltip();
void setMyText(QString strHead, const QString& text);
void popup(QPoint pos, QString strHead, const QString& text);
protected:
bool eventFilter(QObject* obj, QEvent* e) override;
void closeEvent(QCloseEvent* event) override;
void paintEvent(QPaintEvent* event) override;
private:
QTextEdit* edit;
int thisWidth = 0;
int thisHeight = 0;
int currentHeight = 0;
QLabel* lblTitle;
int delay = 0;
bool end = false;
bool popClose = false;
private slots:
void endClose();
void thisShow();
};
#endif // TOOLTIP_H