logplus/qtpropertybrowser/qtComboBox.h
DESKTOP-450PEFP\mainc 506cecf05c 添加 左侧属性色板属性的实现,显示色板列表
修改波列显示效果,显示颜色对应旧版logplus
添加波形部分属性修改,左刻度,右刻度,显示名称,显示单位字体属性,色板,变密度颜色级数等属性
修改波形属性修改完后保存文件,读取保存的属性显示效果
2026-02-04 12:16:25 +08:00

116 lines
2.9 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* @file QtComboBox.h
* @brief ComboBox控件
* @date 2011-10-17
*/
#ifndef PAI_FRAME_WIDGET_QtComboBox_H
#define PAI_FRAME_WIDGET_QtComboBox_H
#include <QComboBox>
#include <QToolButton>
#include <QMargins>
#include "qtpropertybrowser.h"
/**
* @class QtComboBox
* @brief QtComboBox是P.A.I系统定制发布的组合框
*/
class QTPROPERTYBROWSER_EXPORT QtComboBox : public QComboBox
{
Q_OBJECT
public:
/**
* @brief 构造函数
* @param[in] pParent 父窗口句柄
*/
QtComboBox(QWidget *pParent = NULL);
/**
* @brief 构造函数
* @param[in] showAddButton 是否显示右侧按钮
* @param[in] pParent 父窗口句柄
*/
QtComboBox(bool showAddButton, QWidget *pParent = NULL);
/**
* @brief 析构函数
*/
virtual ~QtComboBox();
/**
* @brief 设置是否使用实时过滤默认为false不使用。
* @param[in] flag true 使用实时过滤,反之关闭实时过滤
*/
void SetRealTimeValidate(bool flag);
/**
* @brief 设置是否添加Editbutton。
* @param[in] show true 添加Editbutton反之则不添加
*/
void SetShowAddButton(bool show);
/**
* @brief 重写函数,实现对显示数量的设定
*/
virtual void showPopup ();
/**
* @brief 获取选择列表一次显示的项目最大条数
* @return 最大条数
*/
int GetMaxVisibleItems() const;
/**
* @brief 设置选择列表一次显示的项目最大条数
* @param[in] count 最大显示条数
*/
void SetMaxVisibleItems(const int count);
/**
* @brief 重写系统函数使得在对ComboBox设置styleSheet的时候
* 它的下拉列表能够作出一些对应的调整,以使外观更加合适。
* @param[in] styleSheet sytleSheet字符串
*/
void setStyleSheet(const QString & styleSheet);
protected:
/**
* @brief 重写keyPressEvent用来处理输入限制的问题
* @param[in] pEvent 键盘按压事件
*/
virtual void keyPressEvent(QKeyEvent *pEvent);
/**
* @brief 重写resizeEvent用来处理变换大小的问题
* @param[in] pEvent 重置大小事件
*/
virtual void resizeEvent (QResizeEvent *pEvent);
/**
* @brief 重绘
* @param[in] pEvent 重画事件
*/
virtual void paintEvent(QPaintEvent *pEvent);
private:
/**
* @brief 初始化组件
*/
void InitComboBox();
private:
QToolButton *m_pEditButton; ///< 编辑按钮
bool m_RealTimeValidate; ///< 实时校验标志
bool m_AddButton; ///< 添加按钮
int m_MaxVisibleItems; ///< 最大可视条数
QMargins m_margin; ///< 间隔区域
signals:
/**
* @brief EditButton的点击事件
*/
void EditButtonClicked();
};
#endif ///< PAI_FRAME_WIDGET_QtComboBox_H