logplus/logPlus/PropertyWidget.h

96 lines
2.6 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 <QTableWidget>
#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<QtProperty*, QString> m_propertyData; //属性页值
//静态属性
QMap<QString, QtProperty*> m_mapGroupItem;
//其他曲线
QStringList m_strListOtherLine;
QList<float> m_listMin;
QList<float> 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;
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<float> listMin, QList<float> 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();