logplus/logPlus/formtableitem.h
2026-06-24 15:33:12 +08:00

109 lines
2.5 KiB
C++

#ifndef FORMTABLEITEM_H
#define FORMTABLEITEM_H
#include <QWidget>
//#include "PropertyWidget.h"
#pragma execution_character_set("utf-8")
namespace Ui {
class FormTableItem;
}
class FormTableItem : public QWidget
{
Q_OBJECT
public:
explicit FormTableItem(QWidget *parent = nullptr);
~FormTableItem();
private:
Ui::FormTableItem *ui;
protected:
void paintEvent(QPaintEvent *event);
public:
QPixmap m_pixmap;
QFont m_txtFont; // 字体
QColor m_txtColor; //文字颜色
QColor m_backColor = QColor(255, 255, 255, 255); //背景颜色
bool m_bVerticaDrawing = false; // 垂向绘制
QString m_strShowTxt = "";
QString m_strImg = "";
//图头, 图例宽高
double m_colWidth_Img = 1;
double m_rowHeight_Img = 1;
//公式
QString m_strFormulaText = "";
// 公式操作符类型
int m_iFormulaType = 0;
//图头, 行高、列宽
double m_colWidth = 1;
double m_rowHeight = 1;
QString m_strSlfName = "";
QString m_strWellName = "";
//单元格边线
typedef enum _MetaBorder
{
// 全部显示
All=1,
// 不显示
None,
// 显示上边
Top,
// 显示右边
Right,
// 显示下边
Bottom,
// 显示左边
Left,
// 显示上边和右边
TopRight,
// 显示右边和下边
RightBottom,
// 显示下边和左边
BottomLeft,
// 显示左边和上边
LeftTop,
// 显示上边和下边
TopBottom,
// 显示左边和右边
LeftRight,
// 显示上边右边下边
TopRightBottom,
// 显示右边下边左边
RightBottomLeft,
// 显示下边左边上边
BottomLeftTop,
// 显示左边上边右边
LeftTopRight
} MetaBorder;
// 单元格边框
MetaBorder m_drawBorder=MetaBorder::All;
// borderWidth 边框宽度
int TopBorderWidth=1;
int RightBorderWidth=1;
int BottomBorderWidth=1;
int LeftBorderWidth=1;
//边框样式
int TopBorderStyle=(int)Qt::SolidLine;
int RightBorderStyle=(int)Qt::SolidLine;
int BottomBorderStyle=(int)Qt::SolidLine;
int LeftBorderStyle=(int)Qt::SolidLine;
//
QLineF m_LeftLine,m_TopLine,m_RightLine,m_BottomLine;
bool m_TopState=true,m_RightState=true,m_BottomState=true,m_LeftState=true;
void BuildBorderLines();
void DrawBorderLines(QPainter *paint);
};
#endif // FORMTABLEITEM_H