/** * @file PropertyWidget.h * @brief 统一属性服务,采用了singleton模式 * @date 2025-10-10 * @author: */ #pragma once #include #include #include "qtpropertybrowser.h" #include "qtvariantproperty.h" #include "qttreepropertybrowser.h" //file #include "variantmanager.h" #include "variantfactory.h" // #include "forminfo.h" #include "formhead.h" //当前曲线类型 #define Widget_Property "Widget_Property" #define Curve_Property "Curve_Property" #define Head_Property "Head_Property" #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: QString m_strUuid; QString m_strSlfName; QString m_strWellName; QString m_strTrackName; QString m_strLineName; QString m_strCurrentProperty; QMap m_propertyData; //属性页值 //静态属性 QMap m_mapGroupItem; //其他曲线 QStringList m_strListOtherLine; QList m_listMin; QList m_listMax; QStringList m_strListOtherScaleType; FormHead *m_formHead; QTableWidget *m_tableWidget; QTableWidgetItem* m_item; int m_iRow; int m_iCol; double m_colWidth = 1; double m_rowHeight = 1; bool m_bSelfChange=false; 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(); //可视解释整体属性 //曲线 void initCurveProperty(FormInfo *formInfo, QStringList strListOtherLine, QList listMin, QList listMax, QStringList strListOtherScaleType); //图头 void initHeadProperty(FormHead *formHead, QTableWidget *tableWidget, QTableWidgetItem* item, int row, int col); void ChangFillProperty();//填充属性改变 void ChangHeadItemProperty();//图头项改变 public slots: void SlotPropertyChanged( QtProperty *property, const QVariant &variant ); }; extern PropertyWidget* PropertyService();