logplus/logPlus/PropertyWidget.h

96 lines
2.6 KiB
C
Raw Normal View History

2025-10-29 17:23:30 +08:00
/**
* @file PropertyWidget.h
* @brief singleton模式
* @date 2025-10-10
* @author:
*/
#pragma once
#include <QDockWidget>
#include <QTableWidget>
2025-10-29 17:23:30 +08:00
#include "qtpropertybrowser.h"
#include "qtvariantproperty.h"
#include "qttreepropertybrowser.h"
//file
#include "variantmanager.h"
#include "variantfactory.h"
//
#include "forminfo.h"
#include "formhead.h"
2025-10-29 17:23:30 +08:00
//当前曲线类型
#define Widget_Property "Widget_Property"
#define Curve_Property "Curve_Property"
#define Head_Property "Head_Property"
2025-10-29 17:23:30 +08:00
#pragma execution_character_set("utf-8")
/**
* @class PropertyWidget
* @brief
* @date 2025-10-10
* @author:
*/
class PropertyWidget:public QDockWidget
{
Q_OBJECT
public:
PropertyWidget(const QString &title, QWidget *parent = 0, Qt::WindowFlags flags = 0);
~PropertyWidget();
private:
QtTreePropertyBrowser *m_pPropertyBrowser;
QtVariantPropertyManager *m_pVariantManager;
public:
2025-10-30 11:55:37 +08:00
QString m_strUuid;
2025-10-29 17:23:30 +08:00
QString m_strSlfName;
QString m_strWellName;
QString m_strTrackName;
QString m_strLineName;
QString m_strCurrentProperty;
QMap<QtProperty*, QString> m_propertyData; //属性页值
//静态属性
QMap<QString, QtProperty*> m_mapGroupItem;
//其他曲线
QStringList m_strListOtherLine;
QList<float> m_listMin;
QList<float> m_listMax;
2025-11-05 18:15:33 +08:00
QStringList m_strListOtherScaleType;
2025-10-29 17:23:30 +08:00
FormHead *m_formHead;
QTableWidget *m_tableWidget;
QTableWidgetItem* m_item;
int m_iRow;
int m_iCol;
double m_colWidth = 1;
double m_rowHeight = 1;
2025-10-29 17:23:30 +08:00
public:
QWidget* GetPropertyWidget();
void _CreateVariantPropertyItem(QString strGroup, QString strPropertyCaption, QVariant vtPropertyValue, int propertyType);
void _CreateVariantPropertyItem(QString strGroup, QString strPropertyCaption, QVariant vtPropertyValue, int propertyType, double dMin, double dMax);
void _CreateEnumPropertyItem(QString strGroup, QString strPropertyCaption, QVariant vtPropertyValue, QStringList listValue);
void InitCurrentViewInfo(); //初始化属性,清空
void initWidgetProperty(); //可视解释整体属性
//曲线
2025-11-05 18:15:33 +08:00
void initCurveProperty(FormInfo *formInfo, QStringList strListOtherLine, QList<float> listMin, QList<float> listMax, QStringList strListOtherScaleType);
//图头
void initHeadProperty(FormHead *formHead, QTableWidget *tableWidget, QTableWidgetItem* item, int row, int col);
2025-10-29 17:23:30 +08:00
void ChangFillProperty();//填充属性改变
void ChangHeadItemProperty();//图头项改变
2025-10-29 17:23:30 +08:00
public slots:
void SlotPropertyChanged( QtProperty *property, const QVariant &variant );
};
extern PropertyWidget* PropertyService();