forked from asok00000/qzues
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qzueslabel.h
55 lines (50 loc) · 1.19 KB
/
qzueslabel.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
#ifndef QZUESLABEL_H
#define QZUESLABEL_H
#include <QLabel>
#include <QWidget>
#include <QTimerEvent>
#include <QPainter>
#include "QZuesGlobal.h"
/*!
*\class QZuesLabel
*\brief An extended Label Widget inherited from QLabel
*\details Provide more powerful functions
*\author Hu chunhua
*\version 1.0
*\date 2015-11-27 17:36:51
*\note modification:
*\date
*/
class QZuesLabel : public QLabel
{
Q_OBJECT
Q_ENUMS(LabelType)
public:
QString getPlaceholdText() const;
void setPlaceholdText(QString val);
public:
QZuesLabel(QWidget *parent);
~QZuesLabel();
QString text();
LabelType getType() const;
void setType(LabelType val);
int getStepLength() const;
void setStepLength(int val);
public slots:
void setText(const QString & content);
protected:
virtual void paintEvent(QPaintEvent *event) override;
virtual void resizeEvent(QResizeEvent *event) override;
virtual void enterEvent(QEvent *event) override;
virtual void leaveEvent(QEvent *event) override;
virtual void timerEvent(QTimerEvent *event) override;
private:
QString m_contetnt;
QString m_placeholdText;
LabelType m_type;
int m_maqueeTimerId;
int m_maqueeSpeed;
int m_stepLength;
QRect m_contentsRect;
};
#endif // QZUESLABEL_H