65 lines
1.2 KiB
C++
65 lines
1.2 KiB
C++
/**
|
|
* @file PaiSearchLineEdit.h
|
|
* @brief 定义一个具有搜索功能的LineEdit控件
|
|
*/
|
|
#ifndef PAI_FRAME_WIDGET_PAISEARCHLINEEDIT_H
|
|
#define PAI_FRAME_WIDGET_PAISEARCHLINEEDIT_H
|
|
|
|
#include "PaiLineEdit.h"
|
|
#include "Turtle.h"
|
|
|
|
class QPushButton;
|
|
|
|
namespace pai
|
|
{
|
|
namespace gui
|
|
{
|
|
/**
|
|
* @class PaiSearchLineEdit
|
|
* @brief 具有搜索功能的LineEdit
|
|
*/
|
|
class PAI_WIDGET_EXPORT PaiSearchLineEdit : public PaiLineEdit
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
/**
|
|
* @brief 构造函数、
|
|
* @param[in] pParent 父窗口句柄
|
|
*/
|
|
PaiSearchLineEdit(QWidget *pParent = NULL);
|
|
|
|
/**
|
|
* @brief 析构函数
|
|
*/
|
|
virtual ~PaiSearchLineEdit();
|
|
|
|
/**
|
|
* @brief 更新右侧按钮图标
|
|
* @param[in] icon 按钮图标
|
|
*/
|
|
void UpdateRightIcon(const QIcon & icon);
|
|
|
|
protected:
|
|
/**
|
|
* @brief 鼠标滑入事件
|
|
* @param[in] pEvent 鼠标滑入事件
|
|
*/
|
|
virtual void enterEvent(QEvent *pEvent);
|
|
|
|
private slots:
|
|
/**
|
|
* @brief 改变右侧按钮图标
|
|
*/
|
|
void SetCurrentIcon();
|
|
|
|
/**
|
|
* @brief 清空搜索框
|
|
*/
|
|
void CleanSearchBox();
|
|
};
|
|
|
|
}
|
|
}
|
|
|
|
#endif ///< PAI_FRAME_WIDGET_PAISEARCHLINEEDIT_H
|