#pragma once #include "QListViewEx.h" // 自定义Combobox 失去焦点是能够自动隐藏 class I_PLUGIN_EXPORT QHeaderComboBoxEx :public QComboBox { Q_OBJECT public: explicit QHeaderComboBoxEx(QWidget *parent = 0); ~QHeaderComboBoxEx(); public: // hidePopup 重写隐藏下拉列表 void hidePopup(); // 所在列索引 void setColumnIndex(int nIndex); protected: //重写失去焦点事件 void focusOutEvent(QFocusEvent *e); signals: // 选择改变 void sigSelChanged(const int, const QStringList); private: // 列索引 int m_nCurIndex; };