40 lines
819 B
C
40 lines
819 B
C
|
|
/**
|
|||
|
|
* @file WelllogLabel.h
|
|||
|
|
* @brief 定制QLabel,为了显示QLineEdit校验结果信息,为了同时在QLabel上同时显示图标和文字。
|
|||
|
|
* @date 2015-4-17
|
|||
|
|
* @author hudfang
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#ifndef CWELLLOGLABEL_H
|
|||
|
|
#define CWELLLOGLABEL_H
|
|||
|
|
|
|||
|
|
#pragma warning(push,0)
|
|||
|
|
#include "qlabel.h"
|
|||
|
|
#pragma warning(pop)
|
|||
|
|
|
|||
|
|
#pragma execution_character_set("utf-8")
|
|||
|
|
|
|||
|
|
enum PromptType
|
|||
|
|
{
|
|||
|
|
PT_Right, // 正确信息
|
|||
|
|
PT_Warning, // 警告信息(不能为空)
|
|||
|
|
PT_Error // 错误信息
|
|||
|
|
};
|
|||
|
|
class CWellLogLabel :
|
|||
|
|
public QLabel
|
|||
|
|
{
|
|||
|
|
public:
|
|||
|
|
CWellLogLabel(void);
|
|||
|
|
~CWellLogLabel(void);
|
|||
|
|
protected:
|
|||
|
|
/**
|
|||
|
|
* @brief 重新实现该函数来添加额外的元素
|
|||
|
|
*/
|
|||
|
|
void paintEvent(QPaintEvent *pEvent);
|
|||
|
|
public:
|
|||
|
|
void ShowPromtMessage(PromptType type);
|
|||
|
|
private:
|
|||
|
|
PromptType m_PromptType;
|
|||
|
|
};
|
|||
|
|
#endif
|