logplus/Workflow/WFEngine/Component/WorkflowWidget/include/PaiJobParameterItemWidget.h

168 lines
3.8 KiB
C
Raw Normal View History

2026-01-16 17:18:41 +08:00
/**
* @file PaiJobParameterItemWidget.h
* @brief
* @date 2013-04-18
*/
#ifndef PAI_FRAME_WORKFLOWWIDGET_PAIJOBPARAMETERITEMWIDGET_H
#define PAI_FRAME_WORKFLOWWIDGET_PAIJOBPARAMETERITEMWIDGET_H
#include <QWidget>
#include <QTextEdit>
class QMouseEvent;
class QPushButton;
class QLabel;
namespace pai
{
namespace gui
{
/**
* @enum Direction
* @brief
*/
enum Direction
{
NONE = 0x00, ///< 默认
RIGHT= 0x01, ///< 向右
DOWN = 0x02, ///< 向下
RIGHTBOTTOM = 0x03 ///< 右下
};
/**
* @class PaiParameTextEdit
* @brief
*/
class PaiParameTextEdit : public QTextEdit
{
public:
/**
* @brief
* @param[in] pParent
*/
PaiParameTextEdit(QWidget *pParent = NULL);
/**
* @brief
*/
virtual ~PaiParameTextEdit();
protected:
/**
* @brief eventFilter用于拦截滑动条鼠标滑动事件,(32192)
* @param[in] pObj
* @param[in] pEvent
*/
virtual bool eventFilter(QObject *pObj, QEvent *pEvent);
};
/**
* class PaiJobParameterItemWidget
* @brief
*/
class PaiJobParameterItemWidget : public QWidget
{
Q_OBJECT
public:
/**
* @brief
* @param[in] pParent
*/
PaiJobParameterItemWidget(QWidget *pParent = NULL);
/**
* @brief
*/
virtual ~PaiJobParameterItemWidget();
/**
* @brief
* @param[in] text
*/
void SetParamEditInfo(const QString& text);
/**
* @brief widget
* @return
*/
bool GetMouseEnterWidgetFlag() const;
/**
* @brief widget
* @return
*/
bool GetFixWidgetPosFlag() const;
protected:
/**
* @brief
* @param[in] pEvent
*/
virtual void enterEvent(QEvent *pEvent);
/**
* @brief
* @param[in] pEvent
*/
virtual void leaveEvent(QEvent *pEvent);
/**
* @brief
* @param[in] pEvent
*/
virtual void mouseMoveEvent(QMouseEvent *pEvent);
/**
* @brief
* @param[in] pEvent
*/
virtual void mousePressEvent(QMouseEvent *pEvent);
/**
* @brief
* @param[in] pEvent
*/
virtual void mouseReleaseEvent(QMouseEvent *pEvent);
/**
* @brief
* @param[in] pEvent
*/
virtual void paintEvent(QPaintEvent *pEvent) ;
private:
/**
* @brief
*/
void SetWidgetLayout();
/**
* @brief
* @param[in] cursorGlobalPoint
*/
void SetRegionCursorShape(const QPoint &cursorGlobalPoint);
private slots:
/**
* @brief
* @param[in] fixed
*/
void FixTheWidget(bool fixed);
private:
QLabel *m_pLable; ///< 标题
PaiParameTextEdit *m_pParamInfoTextEdit; ///< 信息显示控件
QPushButton *m_pBtn; ///< 按钮
bool m_press; ///< 按压标志
bool m_EnterFlag; ///< 进入标志
bool m_fixed; ///< 固定标志
QPoint m_DragPosition; ///< 抓取位置
Direction m_direction; ///< 方向
};
}
}
#endif ///< PAI_FRAME_WORKFLOWWIDGET_PAIJOBPARAMETERITEMWIDGET_H