102 lines
2.4 KiB
C++
102 lines
2.4 KiB
C++
#ifndef FORMHEAD_H
|
||
#define FORMHEAD_H
|
||
|
||
#include <QWidget>
|
||
#include <QTableWidgetItem>
|
||
#include "formmultiheads.h"
|
||
#include "formtableitem.h"
|
||
|
||
#pragma execution_character_set("utf-8")
|
||
|
||
namespace Ui {
|
||
class FormHead;
|
||
}
|
||
|
||
class FormHead : public QWidget
|
||
{
|
||
Q_OBJECT
|
||
|
||
public:
|
||
explicit FormHead(QWidget *parent = nullptr, QString indexID="");
|
||
~FormHead();
|
||
|
||
private:
|
||
Ui::FormHead *ui;
|
||
|
||
protected:
|
||
//支持复制粘贴,暂时还未实现
|
||
void keyPressEvent(QKeyEvent * e);
|
||
|
||
public:
|
||
//图头
|
||
bool eventFilter(QObject* obj, QEvent* event);
|
||
void onPasteExcelData();
|
||
|
||
public:
|
||
QString m_indexID;
|
||
int m_iRows;
|
||
int m_iCols;
|
||
|
||
bool m_bRefresh=true;
|
||
FormMultiHeads *m_parent;
|
||
QString m_strHeadOrTail = ""; //Head代表图头, Tail代表成果表
|
||
|
||
public:
|
||
void loadStyle(const QString &qssFile);
|
||
void Init(int iRows, int iCols);
|
||
//更新
|
||
void updateJsonInfo(QJsonObject headObjInfo, bool bMultiProject);
|
||
//展示所有单元格
|
||
void DisplayItems(QJsonArray tracksArray, bool bMultiProject);
|
||
//图例
|
||
void ChangHeadItemProperty(int iRow, int iCol, QString imagePath, int colWidth, int rowHeight);
|
||
|
||
void resizeEvent(QResizeEvent *event);
|
||
QJsonObject makeJson();
|
||
|
||
//获取表格的实际大小
|
||
void getTableSize_Biggest(int &iWidth, int &iHight);
|
||
//设置列宽
|
||
void setColumnWidth_Property(int column, double width);
|
||
//设置行高
|
||
void setRowHeight_Property(int row, double height);
|
||
|
||
public slots:
|
||
void resizeWindow(bool bDelete=false);
|
||
//
|
||
//cell
|
||
void slotCellChanged(int row, int column);
|
||
void slotCurrentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn);
|
||
//鼠标点击表格
|
||
void slotCellClicked(int row, int column);
|
||
|
||
//图头、成果表
|
||
//取消其他表格的选中状态
|
||
void s_UnSelectTableItem(QString strUuid);
|
||
|
||
//图头右键菜单响应函数
|
||
void slotContextMenu(QPoint pos);
|
||
|
||
void slotSaveJsonModel();//保存图头模板
|
||
//
|
||
void slotMerge();//合并
|
||
void slotSplit();//拆分
|
||
void slotCellBorder();//拆分
|
||
//
|
||
void slotAddRow();//前插入行
|
||
void slotAddAfterRow();//后插入行
|
||
//
|
||
void slotAddCol();//前插入列
|
||
void slotAddAfterCol();//后插入列
|
||
//
|
||
void slotDeleteRow();//删除行
|
||
void slotDeleteCol();//删除列
|
||
void slotDeleteTable();//删除表
|
||
|
||
//图头
|
||
void copy();
|
||
void Paste();
|
||
};
|
||
|
||
#endif // FORMHEAD_H
|