#pragma once #include "Defines.h" #include "ZxBaseUtil.h" #include "ZxUiBase.h" #include "iPlugin_global.h" class ZxSerializer; class ZxTableModel; class ZxTableView; // Table格式选项 class I_PLUGIN_EXPORT ZxComboBoxCbxRadioWx : public ZxUiBase { Q_OBJECT public: explicit ZxComboBoxCbxRadioWx(QWidget *parent = 0); ~ZxComboBoxCbxRadioWx(); public: void setInfos(QStringList& listAllItems, VecInt vecIndexCbxs, int indexRadio); virtual void initUI(); virtual void initSheets(); //Sheet // 序列化 virtual void onSerialize(ZxSerializer* ser); virtual void onDeserialize(ZxSerializer* ser); signals: // 选择改变 void sigSelChanged(const VecInt, const int); public slots: void slotCbxItemClicked(); void slotRadioItemClicked(); void slotBtnOK(); void slotBtnCancel(); private: void initUI_Main(); void initUI_Grids(); void fillUI_Grids(); void initUI_Btns(); void getCheckedCounts(VecInt& vec, int& n); bool apply(); public: QStringList m_listAllItems; //所有项 VecInt m_vecIndexCbxs; //多选的项 int m_nIndexRadio; //单选项 private: QVBoxLayout* m_pMainLayout; QGridLayout* m_pGridLayout; QButtonGroup* m_pRadioGroup; QMap m_mapBtnPairs; };