|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
#include "Defines.h"
|
|
|
|
|
|
#include "ZxTableHeaderView.h"
|
|
|
|
|
|
|
|
|
|
|
|
class iUnitGroup;
|
|
|
|
|
|
class iUnitItem;
|
|
|
|
|
|
|
|
|
|
|
|
// 此处是为了支持单位下拉筛选表格而额外定义的类
|
|
|
|
|
|
//
|
|
|
|
|
|
class I_PLUGIN_EXPORT ZxTableHeaderViewUnit : public ZxTableHeaderView
|
|
|
|
|
|
{
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
ZxTableHeaderViewUnit(QWidget* parent = nullptr);
|
|
|
|
|
|
~ZxTableHeaderViewUnit();
|
|
|
|
|
|
|
|
|
|
|
|
void setHeaderData(const QStringList& listTitles, \
|
|
|
|
|
|
const QStringList& listUnits);
|
|
|
|
|
|
|
|
|
|
|
|
virtual bool isColCbxVisible() const;
|
|
|
|
|
|
virtual void hideColCbxs();
|
|
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
|
|
|
|
void sigCbxValueChanged(int column, \
|
|
|
|
|
|
const iUnitItem* pSrcUnitItem, \
|
|
|
|
|
|
const iUnitItem* pDestUnitItem);
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
|
|
virtual void paintSection(QPainter *painter, \
|
|
|
|
|
|
const QRect &rect, \
|
|
|
|
|
|
int logicalIndex) const;
|
|
|
|
|
|
virtual void mousePressEvent(QMouseEvent *event);
|
|
|
|
|
|
virtual void mouseReleaseEvent(QMouseEvent *event);
|
|
|
|
|
|
virtual bool eventFilter(QObject *obj, QEvent *event);
|
|
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
|
|
|
|
void onComboBoxActivated(int index);
|
|
|
|
|
|
void onComboBoxLostFocus();
|
|
|
|
|
|
void onSectionClicked(int logicalIndex);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
|
|
QComboBox* m_pCbxColUnit;
|
|
|
|
|
|
|
|
|
|
|
|
QStringList m_listTitles;
|
|
|
|
|
|
QStringList m_listCurUnits;
|
|
|
|
|
|
QStringList m_listBaseUnits;
|
|
|
|
|
|
|
|
|
|
|
|
int m_nCurCol;
|
|
|
|
|
|
int m_nLastCol;
|
|
|
|
|
|
bool m_bCbxColUnitVisible;
|
|
|
|
|
|
|
|
|
|
|
|
QMap<QString, iUnitGroup*> m_mapUnitGroups;
|
|
|
|
|
|
|
|
|
|
|
|
bool m_bUnableSP;
|
|
|
|
|
|
};
|