logplus/logPlus/PropertyWidget.h

79 lines
2.3 KiB
C
Raw Permalink 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 "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_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();