logplus/logPlus/PropertyWidget.h
2025-10-30 11:55:37 +08:00

80 lines
2.3 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* @file PropertyWidget.h
* @brief 统一属性服务采用了singleton模式
* @date 2025-10-10
* @author:
*/
#pragma once
#include <QDockWidget>
#include "qtpropertybrowser.h"
#include "qtvariantproperty.h"
#include "qttreepropertybrowser.h"
//file
#include "variantmanager.h"
#include "variantfactory.h"
//
#include "forminfo.h"
//当前曲线类型
#define Widget_Property "Widget_Property"
#define Curve_Property "Curve_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<QtProperty*, QString> m_propertyData; //属性页值
//静态属性
QMap<QString, QtProperty*> m_mapGroupItem;
//其他曲线
QStringList m_strListOtherLine;
QList<float> m_listMin;
QList<float> m_listMax;
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(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QColor lineColor, double dWidth, QStringList strListOtherLine); //曲线属性
void initCurveProperty(FormInfo *formInfo, QStringList strListOtherLine, QList<float> listMin, QList<float> listMax);
void ChangFillProperty();//填充属性改变
public slots:
void SlotPropertyChanged( QtProperty *property, const QVariant &variant );
};
extern PropertyWidget* PropertyService();