logplus/Workflow/WFEngine/Component/WorkflowWidget/include/PaiJobErrorInfoWidget.h
2026-01-16 17:18:41 +08:00

126 lines
2.7 KiB
C++

/**
* @file PaiJobErrorInfoWidget.h
* @brief 日志中错误信息显示框
* @date 2013-04-17
*/
#ifndef PAI_FRAME_WORKFLOWWIDGET_PAIJOBERRORINFOWIDGET_H
#define PAI_FRAME_WORKFLOWWIDGET_PAIJOBERRORINFOWIDGET_H
#include <QWidget>
#include <QList>
namespace pai
{
namespace gui
{
class PaiJobErrorInfoBar;
}
}
namespace pai
{
namespace gui
{
/**
* @struct ErrorBarPos
* @brief 存储 infoBar指针和infoBar相对高度
*/
struct ErrorBarPos
{
PaiJobErrorInfoBar *pJobErrorBar; ///< 错误信息提示条
int yPos; ///< 错误信息提示条y轴坐标
};
/**
* @class PaiJobErrorInofWidget
* @brief 错误信息条控件
*/
class PaiJobErrorInofWidget : public QWidget
{
Q_OBJECT
public:
/**
* @brief 构造函数
* @param[in] pParent 父亲
*/
PaiJobErrorInofWidget(QWidget *pParent = NULL);
/**
* @brief 析构函数
*/
virtual ~PaiJobErrorInofWidget();
/**
* @brief 添加错误信息到工具条中
* @param[in] error 错误信息
*/
void AddErrorInofToBar(const QString& error);
/**
* @brief 更新错误条目内容
* @param[in] error 错误信息
*/
void UpdateEroorBarInfo(const QString& error);
/**
* @brief 获取item中的所有infoBar信息
* @return 获取infoBar信息
*/
QList<ErrorBarPos> GetErrorBarList() const;
/**
* @brief 获取infoBar展开状态
* @return 展开状态
*/
bool GetEnableExpand() const;
/**
* @brief 设置被展开项
* @param[in] pExpandedError 被展开的infoBar
*/
void SetExpandedError(PaiJobErrorInfoBar *pExpandedError);
/**
* @brief 获取被展开项
* @return 展开项
*/
PaiJobErrorInfoBar* GetExpandedError() const;
public slots:
/**
* @brief 错误条的展开和隐藏操作
* @param[in] show 展开或者隐藏
*/
void ErrorInfo(bool show);
/**
* @brief 错误条的关闭和位置更新操作
*/
void UpdatePosition();
private:
/**
* @brief 重写基类的绘制函数,重绘外观
* @param[in] pEvent 绘制事件
*/
void paintEvent(QPaintEvent *pEvent);
private:
QList<ErrorBarPos> m_list ; ///< infoBar信息
int m_Value; ///< 错误对话框序号
int m_NumErrorBar; ///< 错误条的数量
bool m_EnableExpand; ///< 表示有展开的inforbar
PaiJobErrorInfoBar *m_pJobErrorInfoBar; ///< 当前被展开的项
signals:
/**
* @brief 所有infoBar被关闭时发送
*/
void HideItem();
};
}
}
#endif ///< PAI_FRAME_WORKFLOWWIDGET_PAIJOBERRORINFOWIDGET_H