logplus/Workflow/WFWidget/include/PaiLabel.h
2026-01-17 12:55:45 +08:00

77 lines
1.6 KiB
C++

/*
* PaiLabel.h
*
* Created on: 2011-10-17
* Author: dev
*/
#ifndef PAI_FRAME_WIDGET_PAILABEL_H
#define PAI_FRAME_WIDGET_PAILABEL_H
#include <QLabel>
#include "Turtle.h"
namespace pai
{
namespace gui
{
/**
* @class PaiLabel
* @brief 文本显示控件
*/
class PAI_WIDGET_EXPORT PaiLabel : public QLabel
{
Q_OBJECT
public:
/**
* @enum PromptType
* @brief 不同模式下文字显示的颜色和图标不同
*/
enum PromptType
{
PT_Information, ///< 普通信息
PT_Question, ///< 疑问信息
PT_Warning, ///< 警告信息
PT_Error, ///< 错误信息
PT_NO_STYLE_Text, ///< 不设置任何风格的纯文本信息
PT_NO_STYLE ///< 无风格
};
/**
* @brief 构造函数
* @param[in] pParent 父窗口句柄
*/
PaiLabel(QWidget *pParent = NULL);
/**
* @brief 构造函数
* @param[in] text 显示文本
* @param[in] pParent 父窗口句柄
*/
PaiLabel(const QString & text, QWidget *pParent = NULL);
/**
* @brief 析构函数
*/
virtual ~PaiLabel();
/**
* @brief 显示提示信息
* @param[in] type 输入需显示的错误表示
*/
void ShowPromptMessge(PromptType type = PT_Information);
protected:
/**
* @brief 重新实现该函数来添加额外的元素
* @param[in] pEvent 绘制事件
*/
virtual void paintEvent(QPaintEvent *pEvent);
private:
PromptType m_PromptType; ///< 显示信息类型
};
}
}
#endif ///< PAI_FRAME_WIDGET_PAILABEL_H