128 lines
2.8 KiB
C++
128 lines
2.8 KiB
C++
/**
|
|
* @file PaiJobErrorInfoBar.h
|
|
* @brief 日志中错误信息显示条
|
|
* @date 2013-4-17
|
|
*/
|
|
#ifndef PAI_FRAME_WORKFLOWWIDGET_PAIJOBERRORINFOBAR_H
|
|
#define PAI_FRAME_WORKFLOWWIDGET_PAIJOBERRORINFOBAR_H
|
|
|
|
#include <QWidget>
|
|
#include <QList>
|
|
#include <QTextEdit>
|
|
#include <QPushButton>
|
|
#include <QLabel>
|
|
#include <QMouseEvent>
|
|
|
|
namespace pai
|
|
{
|
|
namespace gui
|
|
{
|
|
/**
|
|
* @class PaiJobErrorInfoBar
|
|
* @brief 日志错误信息显示条
|
|
*/
|
|
class PaiJobErrorInfoBar : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
/**
|
|
* @brief 构造函数
|
|
* @param[in] pParent 父亲
|
|
*/
|
|
PaiJobErrorInfoBar(QWidget *pParent = NULL);
|
|
|
|
/**
|
|
* @brief 析构函数
|
|
*/
|
|
virtual ~PaiJobErrorInfoBar();
|
|
|
|
/**
|
|
* @brief 设置错误信息
|
|
* @param[in] error 错误信息
|
|
*/
|
|
void ErrorBarInfo(const QString& error);
|
|
|
|
/**
|
|
* @brief 获取向下Widget
|
|
* @return 向下的widget
|
|
*/
|
|
QWidget* GetDownWidget() const;
|
|
|
|
/**
|
|
* @brief 获取错误条标题控件
|
|
* @return label控件
|
|
*/
|
|
QLabel* GetLabel() const;
|
|
|
|
/**
|
|
* @brief 获取错误消息显示框
|
|
* @return TextEdit控件
|
|
*/
|
|
QTextEdit* GetTextEdit() const;
|
|
|
|
public slots:
|
|
/**
|
|
* @brief 控制信息条中详细信息的展开和关闭
|
|
* @param[in] show 显示标志
|
|
*/
|
|
void SetShow(bool show);
|
|
|
|
/**
|
|
* @brief 关闭InfoBar时调用
|
|
* @param[in] close 关闭标志
|
|
*/
|
|
void CloseDialog(bool close);
|
|
|
|
protected:
|
|
/**
|
|
* @brief 重新实现进入事件
|
|
* @param[in] pEvent 进入事件
|
|
*/
|
|
virtual void enterEvent(QEvent *pEvent);
|
|
|
|
/**
|
|
* @brief 重新实现离开事件
|
|
* @param[in] pEvent 离开事件
|
|
*/
|
|
virtual void leaveEvent(QEvent *pEvent);
|
|
|
|
/**
|
|
* @brief 重写父类鼠标按压事件
|
|
* @param pEvent 鼠标按压事件
|
|
*/
|
|
virtual void mousePressEvent(QMouseEvent *pEvent);
|
|
|
|
private:
|
|
/**
|
|
* @brief 绘制函数
|
|
* @param[in] pEvent 绘制事件
|
|
*/
|
|
virtual void paintEvent(QPaintEvent *pEvent);
|
|
|
|
private:
|
|
QWidget *m_pDownWidget; ///< 向下对话框
|
|
QLabel *m_pLabel; ///< 错误条标题栏
|
|
QTextEdit *m_pTextEdit; ///< 错误信息展示控件
|
|
QPushButton *m_pbtn; ///< 按钮
|
|
QPushButton *m_pIconBtn; ///< 按钮图标
|
|
int m_x; ///< x轴坐标
|
|
int m_y; ///< y轴坐标
|
|
|
|
signals:
|
|
/**
|
|
* @brief 对话框展开信号
|
|
* @param[in] expended 对话框是否展开
|
|
*/
|
|
void ExpendDialog(bool expended);
|
|
|
|
/**
|
|
* @brief 关闭InfoBar时发射
|
|
*/
|
|
void CloseDialog();
|
|
};
|
|
|
|
}
|
|
}
|
|
|
|
#endif ///< PAI_FRAME_WORKFLOWWIDGET_PAIJOBERRORINFOBAR_H
|