You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nmWATI/Include/iGui/iGuiConfig/iWxConfigBtnCmds.h

71 lines
1.5 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#pragma once
#include "iWxConfigBase.h"
#include "iGuiConfig_global.h"
class iXmlBtn;
class X_GUI_CONFIG_EXPORT iWxConfigBtnCmds : public iWxConfigBase
{
Q_OBJECT
public:
explicit iWxConfigBtnCmds(QWidget *parent = 0);
~iWxConfigBtnCmds();
// 初始化
virtual void initUI();
QHBoxLayout* initUI_Desc();
// 序列化
virtual void onSerialize(ZxSerializer* ser);
virtual void onDeserialize(ZxSerializer* ser);
// 执行
virtual bool runActionBy(QString sName);
private slots:
// Radio Changed
void slotRadioChanged();
// 右键菜单
void slotTableWxShowContextMenu(const QPoint &pos);
void slotTableWxCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn);
#ifdef QT_DEBUG
// 难以置信的是用了setCellWidget后QTableWidget的signal无法使用 TODO
void slotTableCellClicked(int r, int c);
void slotGbxClicked();
void slotTableWxItemPressed(QTableWidgetItem*);
#endif
// 菜单响应
void slotRefresh();
private:
QString getCurType();
void initAndAllocBtns();
QString getTypeByID(QString sID);
void allocOneBtn(QString sType, iXmlBtn* pBtn);
void fillItemGrids(QString sSeries);
QWidget* getCellWx(iXmlBtn *pBtn);
QString getTooltip(int r, int c);
private:
// 内部变量Table
QTableWidget* m_pTableWx;
QLabel* m_pLblDesc;
QMenu* m_pMenu;
//
int m_nColMax;
// Radio
QVector<QRadioButton*> m_vecRadios;
// Btn载体
QMap<QString, QVector<iXmlBtn*> > m_mapBtns;
};