优化公式赋值

This commit is contained in:
jiayulong 2026-06-18 13:47:06 +08:00
parent d4b3466c88
commit ca8aa6b544
12 changed files with 144 additions and 79 deletions

View File

@ -34,7 +34,7 @@ public:
QColor m_Color; //颜色 QColor m_Color; //颜色
bool m_press;//判断鼠标是否按下 bool m_press;//判断鼠标是否按下
BorderFlags m_BorderFlags; BorderFlags m_BorderFlags;
FormWell* m_pFormWell = NULL; FormWell* m_pFormWell = nullptr;
int m_nbleft = 0; int m_nbleft = 0;
int m_nbright = 0; int m_nbright = 0;
}; };

View File

@ -11,6 +11,7 @@
extern double g_dPixelPerCm;//每厘米像素数 extern double g_dPixelPerCm;//每厘米像素数
extern QtProjectWidgets *g_projectWidgets; //左侧工程区 extern QtProjectWidgets *g_projectWidgets; //左侧工程区
extern int g_iLoadingJson;
PropertyWidget::PropertyWidget(const QString &title, QWidget *parent , Qt::WindowFlags flags ) PropertyWidget::PropertyWidget(const QString &title, QWidget *parent , Qt::WindowFlags flags )
:QDockWidget(title,parent,flags) :QDockWidget(title,parent,flags)
@ -82,21 +83,22 @@ void PropertyWidget::InitCurrentViewInfo(bool bAll)
if (bAll) if (bAll)
{ {
m_fromTop = NULL; m_fromTop = nullptr;
m_formInfo = NULL; m_formInfo = nullptr;
m_formHead = NULL; m_formHead = nullptr;
m_tableWidget = NULL; m_tableWidget = nullptr;
m_item = NULL; m_item = nullptr;
m_strFormulaText = "";
// //
m_tdGujing = NULL; m_tdGujing = nullptr;
m_tdImage = NULL; m_tdImage = nullptr;
m_tdSwallCore = NULL; m_tdSwallCore = nullptr;
m_tdGeoLith = NULL; m_tdGeoLith = nullptr;
m_tdText = NULL; m_tdText = nullptr;
m_tdLayer = NULL; m_tdLayer = nullptr;
m_tdJiegutext = NULL; m_tdJiegutext = nullptr;
m_tdGuan = NULL; m_tdGuan = nullptr;
m_tdCorePhysics = NULL; m_tdCorePhysics = nullptr;
// //
m_strUuid = ""; m_strUuid = "";
m_strTrackUuid = ""; m_strTrackUuid = "";
@ -537,6 +539,11 @@ void PropertyWidget::changedCorePhysicsProperty(QtProperty *qtProperty, const QV
void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant &variant ) void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant &variant )
{ {
if(g_iLoadingJson==1)//针对模板加载,不处理属性改变,避免多次冲突
{
return;
}
if(m_strCurrentProperty == "") if(m_strCurrentProperty == "")
return; return;
if(m_strCurrentProperty == Tvd_Property) if(m_strCurrentProperty == Tvd_Property)
@ -580,7 +587,7 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
} }
else if(m_strCurrentProperty == Track_Property) else if(m_strCurrentProperty == Track_Property)
{ {
if(m_fromTop == NULL) if(m_fromTop == nullptr)
return; return;
if("道名称" == m_propertyData[pProperty]) if("道名称" == m_propertyData[pProperty])
@ -2361,8 +2368,8 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
} }
else if("内容" == m_propertyData[pProperty]) else if("内容" == m_propertyData[pProperty])
{ {
//qDebug() << "内容->改变";
QString newText = variant.value<QString>(); QString newText = variant.value<QString>();
//qDebug() << "内容->改变" << newText;
m_formHead->m_bRefresh=false; m_formHead->m_bRefresh=false;
m_item->setText(newText); m_item->setText(newText);
} }
@ -2397,6 +2404,37 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
m_formHead->m_bRefresh=false; m_formHead->m_bRefresh=false;
m_item->setFont(newFont); m_item->setFont(newFont);
} }
else if("公式" == m_propertyData[pProperty])
{
QString newFormulaText = variant.value<QString>();
m_item->setData(Qt::UserRole+4, newFormulaText); // 公式
m_strFormulaText = newFormulaText;
//slf名、井次名
QString strSlfName = "";
QString strWellName = "";
if(newFormulaText != "")
{
QString strLeft = g_projectWidgets->getLeftTreeString_Import();
if(strLeft.length() > 0)
{
QStringList list = strLeft.split("#@@#");//QString字符串分割函数
if (list.size() > 3)
{
strSlfName = list[0];
strWellName = list[1];
}
}
}
m_item->setData(Qt::UserRole+5, strSlfName);
m_item->setData(Qt::UserRole+6, strWellName);
//qDebug() << "公式->改变 " << newFormulaText <<" "<<strSlfName <<" "<<strWellName;
// QString newText = "";
// m_formHead->m_bRefresh=false;
// m_item->setText(newText);
}
} }
else if(m_strCurrentProperty == PL_OBJECT_PROPERTY) // 频率统计图 else if(m_strCurrentProperty == PL_OBJECT_PROPERTY) // 频率统计图
{ {
@ -2689,7 +2727,7 @@ void PropertyWidget::ChangFillProperty()
QtVariantProperty* PropertyWidget::_CreateVariantPropertyItem(QString strGroup, QString strPropertyCaption, QVariant vtPropertyValue, int propertyType) QtVariantProperty* PropertyWidget::_CreateVariantPropertyItem(QString strGroup, QString strPropertyCaption, QVariant vtPropertyValue, int propertyType)
{ {
QtProperty *pGroupItem =NULL; QtProperty *pGroupItem =nullptr;
{ {
QMap<QString,QtProperty *>::Iterator it = m_mapGroupItem.find( strGroup ); QMap<QString,QtProperty *>::Iterator it = m_mapGroupItem.find( strGroup );
if( it != m_mapGroupItem.end() ) if( it != m_mapGroupItem.end() )
@ -2720,7 +2758,7 @@ QtVariantProperty* PropertyWidget::_CreateVariantPropertyItem(QString strGroup,
void PropertyWidget::_CreateVariantPropertyItem(QString strGroup, QString strPropertyCaption, QVariant vtPropertyValue, int propertyType, double dMin, double dMax) void PropertyWidget::_CreateVariantPropertyItem(QString strGroup, QString strPropertyCaption, QVariant vtPropertyValue, int propertyType, double dMin, double dMax)
{ {
QtProperty *pGroupItem =NULL; QtProperty *pGroupItem =nullptr;
{ {
QMap<QString,QtProperty *>::Iterator it = m_mapGroupItem.find( strGroup ); QMap<QString,QtProperty *>::Iterator it = m_mapGroupItem.find( strGroup );
if( it != m_mapGroupItem.end() ) if( it != m_mapGroupItem.end() )
@ -2744,7 +2782,7 @@ void PropertyWidget::_CreateVariantPropertyItem(QString strGroup, QString strPro
void PropertyWidget::_CreateEnumPropertyItem(QString strGroup, QString strPropertyCaption, QVariant vtPropertyValue, QStringList listValue) void PropertyWidget::_CreateEnumPropertyItem(QString strGroup, QString strPropertyCaption, QVariant vtPropertyValue, QStringList listValue)
{ {
QtProperty *pGroupItem =NULL; QtProperty *pGroupItem =nullptr;
{ {
QMap<QString,QtProperty *>::Iterator it = m_mapGroupItem.find( strGroup ); QMap<QString,QtProperty *>::Iterator it = m_mapGroupItem.find( strGroup );
if( it != m_mapGroupItem.end() ) if( it != m_mapGroupItem.end() )
@ -2768,7 +2806,7 @@ void PropertyWidget::_CreateEnumPropertyItem(QString strGroup, QString strProper
QtProperty* PropertyWidget::_CreateColorSchemePropertyItem(QString strGroup, QString strPropertyCaption, QVariant vtPropertyValue, int nclr) QtProperty* PropertyWidget::_CreateColorSchemePropertyItem(QString strGroup, QString strPropertyCaption, QVariant vtPropertyValue, int nclr)
{ {
QtProperty *pGroupItem = NULL; QtProperty *pGroupItem = nullptr;
{ {
QMap<QString, QtProperty *>::Iterator it = m_mapGroupItem.find(strGroup); QMap<QString, QtProperty *>::Iterator it = m_mapGroupItem.find(strGroup);
if (it != m_mapGroupItem.end()) if (it != m_mapGroupItem.end())
@ -2827,7 +2865,7 @@ QtProperty* PropertyWidget::_CreateColorSchemePropertyItem(QString strGroup, QSt
QtProperty* PropertyWidget::_CreateFormulaPropertyItem(QString strGroup, QString strPropertyCaption, QVariant vtPropertyValue) QtProperty* PropertyWidget::_CreateFormulaPropertyItem(QString strGroup, QString strPropertyCaption, QVariant vtPropertyValue)
{ {
QtProperty *pGroupItem = NULL; QtProperty *pGroupItem = nullptr;
{ {
QMap<QString, QtProperty *>::Iterator it = m_mapGroupItem.find(strGroup); QMap<QString, QtProperty *>::Iterator it = m_mapGroupItem.find(strGroup);
if (it != m_mapGroupItem.end()) if (it != m_mapGroupItem.end())
@ -3164,6 +3202,11 @@ QColor intToQColor(int intColor) {
void PropertyWidget::initHeadProperty(FormHead *formHead, QTableWidget *tableWidget, QTableWidgetItem* item, int row, int col) void PropertyWidget::initHeadProperty(FormHead *formHead, QTableWidget *tableWidget, QTableWidgetItem* item, int row, int col)
{ {
if(g_iLoadingJson==1)//针对模板加载,不处理属性改变,避免多次冲突
{
return;
}
//初始化,清空 //初始化,清空
InitCurrentViewInfo(); InitCurrentViewInfo();
@ -3198,15 +3241,20 @@ void PropertyWidget::initHeadProperty(FormHead *formHead, QTableWidget *tableWid
//行高、列宽 //行高、列宽
m_colWidth = tableWidget->columnWidth(col)/g_dPixelPerCm; m_colWidth = tableWidget->columnWidth(col)/g_dPixelPerCm;
m_rowHeight = tableWidget->rowHeight(row)/g_dPixelPerCm; m_rowHeight = tableWidget->rowHeight(row)/g_dPixelPerCm;
//公式
QVariant vtFormula = m_item->data(Qt::UserRole+4);
if (vtFormula.isValid()) {
m_strFormulaText = vtFormula.toString();
}
else
{
m_strFormulaText = "";
}
_CreateVariantPropertyItem("单元格", "图例", imagePath, VariantManager::filePathTypeId()); //"./image/胜利符号库/岩性符号/砂岩.png" _CreateVariantPropertyItem("单元格", "图例", imagePath, VariantManager::filePathTypeId()); //"./image/胜利符号库/岩性符号/砂岩.png"
_CreateVariantPropertyItem("单元格", "图例宽(cm)", m_colWidth_Img, QVariant::Double, 0, 100); _CreateVariantPropertyItem("单元格", "图例宽(cm)", m_colWidth_Img, QVariant::Double, 0, 100);
_CreateVariantPropertyItem("单元格", "图例高(cm)", m_rowHeight_Img, QVariant::Double, 0, 100); _CreateVariantPropertyItem("单元格", "图例高(cm)", m_rowHeight_Img, QVariant::Double, 0, 100);
//读取图头公式
ReadWellRoundDataToFormula();
_CreateFormulaPropertyItem("单元格", "公式", "");
_CreateVariantPropertyItem("单元格", "背景颜色", m_item->background().color(), QVariant::Color); _CreateVariantPropertyItem("单元格", "背景颜色", m_item->background().color(), QVariant::Color);
_CreateVariantPropertyItem("文本", "内容", item->text(), QVariant::String); _CreateVariantPropertyItem("文本", "内容", item->text(), QVariant::String);
@ -3217,6 +3265,9 @@ void PropertyWidget::initHeadProperty(FormHead *formHead, QTableWidget *tableWid
_CreateVariantPropertyItem("表格", "行高(cm)", m_rowHeight, QVariant::Double, 0, 100); _CreateVariantPropertyItem("表格", "行高(cm)", m_rowHeight, QVariant::Double, 0, 100);
_CreateVariantPropertyItem("表格", "列宽(cm)", m_colWidth, QVariant::Double, 0, 100); _CreateVariantPropertyItem("表格", "列宽(cm)", m_colWidth, QVariant::Double, 0, 100);
//读取图头公式
ReadWellRoundDataToFormula();
_CreateFormulaPropertyItem("单元格", "公式", m_strFormulaText);
} }
void PropertyWidget::initTableProperty(FormInfo *formInfo) void PropertyWidget::initTableProperty(FormInfo *formInfo)
@ -3300,7 +3351,7 @@ void PropertyWidget::initDepthProperty(FormInfo *formInfo)
void PropertyWidget::initProperty(FormInfo *formInfo) void PropertyWidget::initProperty(FormInfo *formInfo)
{ {
if (formInfo == NULL) if (formInfo == nullptr)
return; return;
//初始化,清空 //初始化,清空
@ -3437,7 +3488,7 @@ void PropertyWidget::initProperty(FormInfo *formInfo)
void PropertyWidget::initWaveProperty(FormInfo *formInfo, int nType) void PropertyWidget::initWaveProperty(FormInfo *formInfo, int nType)
{ {
if (formInfo == NULL) if (formInfo == nullptr)
return; return;
_CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String); _CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String);
@ -3575,7 +3626,7 @@ void PropertyWidget::initSwallCoreItemProperty(TransparentDraggableSwallCore* td
InitCurrentViewInfo(); InitCurrentViewInfo();
FormInfo* formInfo = tdSwallCore->mPlot->m_formTrack->getFormInfoByParameters(tdSwallCore->mPlot->m_strUuid, tdSwallCore->mPlot->m_strWellName, FormInfo* formInfo = tdSwallCore->mPlot->m_formTrack->getFormInfoByParameters(tdSwallCore->mPlot->m_strUuid, tdSwallCore->mPlot->m_strWellName,
tdSwallCore->mPlot->m_strTrackName, tdSwallCore->mPlot->m_strLineName); tdSwallCore->mPlot->m_strTrackName, tdSwallCore->mPlot->m_strLineName);
if (formInfo != NULL) if (formInfo != nullptr)
{ {
m_formInfo = formInfo; m_formInfo = formInfo;
@ -3673,7 +3724,7 @@ void PropertyWidget::initTextItemProperty(TransparentDraggableRect* tdText, doub
FormInfo* formInfo = tdText->mPlot->m_formTrack->getFormInfoByParameters(tdText->mPlot->m_strUuid, tdText->mPlot->m_strWellName, FormInfo* formInfo = tdText->mPlot->m_formTrack->getFormInfoByParameters(tdText->mPlot->m_strUuid, tdText->mPlot->m_strWellName,
tdText->mPlot->m_strTrackName, tdText->mPlot->m_strLineName); tdText->mPlot->m_strTrackName, tdText->mPlot->m_strLineName);
if (formInfo != NULL) if (formInfo != nullptr)
{ {
m_formInfo = formInfo; m_formInfo = formInfo;
@ -3732,7 +3783,7 @@ void PropertyWidget::initLayerItemProperty(TransparentDraggableLayer* tdLayer, d
InitCurrentViewInfo(); InitCurrentViewInfo();
FormInfo* formInfo = tdLayer->mPlot->m_formTrack->getFormInfoByParameters(tdLayer->mPlot->m_strUuid, tdLayer->mPlot->m_strWellName, FormInfo* formInfo = tdLayer->mPlot->m_formTrack->getFormInfoByParameters(tdLayer->mPlot->m_strUuid, tdLayer->mPlot->m_strWellName,
tdLayer->mPlot->m_strTrackName, tdLayer->mPlot->m_strLineName); tdLayer->mPlot->m_strTrackName, tdLayer->mPlot->m_strLineName);
if (formInfo != NULL) if (formInfo != nullptr)
{ {
m_formInfo = formInfo; m_formInfo = formInfo;
@ -3799,7 +3850,7 @@ void PropertyWidget::initGujingItemProperty(TransparentDraggableGujing* tdGujing
InitCurrentViewInfo(); InitCurrentViewInfo();
FormInfo* formInfo = tdGujing->mPlot->m_formTrack->getFormInfoByParameters(tdGujing->mPlot->m_strUuid, tdGujing->mPlot->m_strWellName, FormInfo* formInfo = tdGujing->mPlot->m_formTrack->getFormInfoByParameters(tdGujing->mPlot->m_strUuid, tdGujing->mPlot->m_strWellName,
tdGujing->mPlot->m_strTrackName, tdGujing->mPlot->m_strLineName); tdGujing->mPlot->m_strTrackName, tdGujing->mPlot->m_strLineName);
if (formInfo != NULL) if (formInfo != nullptr)
{ {
m_formInfo = formInfo; m_formInfo = formInfo;
@ -3876,7 +3927,7 @@ void PropertyWidget::initImageItemProperty(TransparentDraggableImage* tdImage, d
InitCurrentViewInfo(); InitCurrentViewInfo();
FormInfo* formInfo = tdImage->mPlot->m_formTrack->getFormInfoByParameters(tdImage->mPlot->m_strUuid, tdImage->mPlot->m_strWellName, FormInfo* formInfo = tdImage->mPlot->m_formTrack->getFormInfoByParameters(tdImage->mPlot->m_strUuid, tdImage->mPlot->m_strWellName,
tdImage->mPlot->m_strTrackName, tdImage->mPlot->m_strLineName); tdImage->mPlot->m_strTrackName, tdImage->mPlot->m_strLineName);
if (formInfo != NULL) if (formInfo != nullptr)
{ {
m_formInfo = formInfo; m_formInfo = formInfo;
@ -4024,7 +4075,7 @@ void PropertyWidget::initCorePhysicsItemProperty(TransparentDraggableCorePhysics
FormInfo* formInfo = tdImage->mPlot->m_formTrack->getFormInfoByParameters(tdImage->mPlot->m_strUuid, tdImage->mPlot->m_strWellName, FormInfo* formInfo = tdImage->mPlot->m_formTrack->getFormInfoByParameters(tdImage->mPlot->m_strUuid, tdImage->mPlot->m_strWellName,
tdImage->mPlot->m_strTrackName, tdImage->mPlot->m_strLineName); tdImage->mPlot->m_strTrackName, tdImage->mPlot->m_strLineName);
if (formInfo != NULL) if (formInfo != nullptr)
{ {
m_formInfo = formInfo; m_formInfo = formInfo;
@ -4177,7 +4228,7 @@ void PropertyWidget::initGeoLithItemProperty(TransparentDraggableGeoLith* tdGeoL
FormInfo* formInfo = tdGeoLith->mPlot->m_formTrack->getFormInfoByParameters(tdGeoLith->mPlot->m_strUuid, tdGeoLith->mPlot->m_strWellName, FormInfo* formInfo = tdGeoLith->mPlot->m_formTrack->getFormInfoByParameters(tdGeoLith->mPlot->m_strUuid, tdGeoLith->mPlot->m_strWellName,
tdGeoLith->mPlot->m_strTrackName, tdGeoLith->mPlot->m_strLineName); tdGeoLith->mPlot->m_strTrackName, tdGeoLith->mPlot->m_strLineName);
if (formInfo != NULL) if (formInfo != nullptr)
{ {
m_formInfo = formInfo; m_formInfo = formInfo;
@ -4296,7 +4347,7 @@ void PropertyWidget::initJiegutextItemProperty(TransparentDraggableJiegutext* td
InitCurrentViewInfo(); InitCurrentViewInfo();
FormInfo* formInfo = tdJiegutext->mPlot->m_formTrack->getFormInfoByParameters(tdJiegutext->mPlot->m_strUuid, tdJiegutext->mPlot->m_strWellName, FormInfo* formInfo = tdJiegutext->mPlot->m_formTrack->getFormInfoByParameters(tdJiegutext->mPlot->m_strUuid, tdJiegutext->mPlot->m_strWellName,
tdJiegutext->mPlot->m_strTrackName, tdJiegutext->mPlot->m_strLineName); tdJiegutext->mPlot->m_strTrackName, tdJiegutext->mPlot->m_strLineName);
if (formInfo != NULL) if (formInfo != nullptr)
{ {
m_formInfo = formInfo; m_formInfo = formInfo;
@ -4394,7 +4445,7 @@ void PropertyWidget::initTubingItemProperty(TransparentDraggableGuan* tdGuan, do
InitCurrentViewInfo(); InitCurrentViewInfo();
FormInfo* formInfo = tdGuan->mPlot->m_formTrack->getFormInfoByParameters(tdGuan->mPlot->m_strUuid, tdGuan->mPlot->m_strWellName, FormInfo* formInfo = tdGuan->mPlot->m_formTrack->getFormInfoByParameters(tdGuan->mPlot->m_strUuid, tdGuan->mPlot->m_strWellName,
tdGuan->mPlot->m_strTrackName, tdGuan->mPlot->m_strLineName); tdGuan->mPlot->m_strTrackName, tdGuan->mPlot->m_strLineName);
if (formInfo != NULL) if (formInfo != nullptr)
{ {
m_formInfo = formInfo; m_formInfo = formInfo;
@ -6480,7 +6531,7 @@ void PropertyWidget::onTableChanged(const QString &tableName)
QVector<QString> rowData; QVector<QString> rowData;
for(int i=0;i<count;i++) { for(int i=0;i<count;i++) {
if(logio->GetObjectStatus(i)!=OBJECT_NORMAL) continue; if(logio->GetObjectStatus(i)!=OBJECT_NORMAL) continue;
logio->GetObjectName(i,curvename,NULL,aliasname); logio->GetObjectName(i,curvename,nullptr,aliasname);
short objectType=logio->GetObjectType(i); short objectType=logio->GetObjectType(i);
//表格 //表格
if(objectType==CARD_OBJECT) if(objectType==CARD_OBJECT)
@ -6642,7 +6693,7 @@ void PropertyWidget::ReadWellRoundDataToFormula()
aliasname[64]='\0'; aliasname[64]='\0';
for(int i=0;i<count;i++) { for(int i=0;i<count;i++) {
if(logio->GetObjectStatus(i)!=OBJECT_NORMAL) continue; if(logio->GetObjectStatus(i)!=OBJECT_NORMAL) continue;
logio->GetObjectName(i,curvename,NULL,aliasname); logio->GetObjectName(i,curvename,nullptr,aliasname);
short objectType=logio->GetObjectType(i); short objectType=logio->GetObjectType(i);
//表格 //表格
if(objectType >CARD_OBJECT||objectType==0) if(objectType >CARD_OBJECT||objectType==0)

View File

@ -134,18 +134,20 @@ public:
QList<float> m_listMax; QList<float> m_listMax;
QStringList m_strListOtherScaleType; QStringList m_strListOtherScaleType;
FormTrackTop* m_fromTop = NULL; FormTrackTop* m_fromTop = nullptr;
FormInfo * m_formInfo = NULL; FormInfo * m_formInfo = nullptr;
//图头 //图头
FormHead *m_formHead; FormHead *m_formHead = nullptr;
QTableWidget *m_tableWidget; QTableWidget *m_tableWidget = nullptr;
QTableWidgetItem* m_item; QTableWidgetItem* m_item = nullptr;
int m_iRow; int m_iRow;
int m_iCol; int m_iCol;
//图头, 图例宽高 //图头, 图例宽高
double m_colWidth_Img = 1; double m_colWidth_Img = 1;
double m_rowHeight_Img = 1; double m_rowHeight_Img = 1;
//公式
QString m_strFormulaText = "";
//图头, 行高、列宽 //图头, 行高、列宽
double m_colWidth = 1; double m_colWidth = 1;
double m_rowHeight = 1; double m_rowHeight = 1;

View File

@ -12,7 +12,7 @@ double FIXED_LOGHead_MARGIN_CM = 0;
double FIXED_LOGBottom_MARGIN_CM = 0; double FIXED_LOGBottom_MARGIN_CM = 0;
CSetPageMegDlg::CSetPageMegDlg() CSetPageMegDlg::CSetPageMegDlg()
:m_pDialog( NULL ) :m_pDialog( nullptr )
{ {
m_pDialog=new Ui_PageMeg; m_pDialog=new Ui_PageMeg;
m_pDialog->setupUi(this); m_pDialog->setupUi(this);

View File

@ -668,7 +668,7 @@ void TransparentDraggableGeoLith::onDelRect()
void TransparentDraggableGeoLith::setItemDepthOffset() void TransparentDraggableGeoLith::setItemDepthOffset()
{ {
bool ok=0; bool ok=0;
double depthshift=QInputDialog::getDouble(NULL,"深度移动","请输入移动的深度量(上移-,下移+)",0.0,-2147483647, 2147483647,4,&ok); double depthshift=QInputDialog::getDouble(nullptr,"深度移动","请输入移动的深度量(上移-,下移+)",0.0,-2147483647, 2147483647,4,&ok);
if(!ok) return; if(!ok) return;
QCPRange currentRange = getRange(); QCPRange currentRange = getRange();
@ -1009,7 +1009,7 @@ double TransparentDraggableGeoLith::getMyLower()
double dLower = mPlot->xAxis->range().lower; double dLower = mPlot->xAxis->range().lower;
double proposedLeft = mDragStartRange.lower; double proposedLeft = mDragStartRange.lower;
TransparentDraggableGeoLith *pDraggableRect =NULL; TransparentDraggableGeoLith *pDraggableRect =nullptr;
{ {
QMap<QString,QObject *>::Iterator it = mPlot->m_mapDraggable_GeoLith.begin(); QMap<QString,QObject *>::Iterator it = mPlot->m_mapDraggable_GeoLith.begin();
while( it != mPlot->m_mapDraggable_GeoLith.end() ) while( it != mPlot->m_mapDraggable_GeoLith.end() )
@ -1038,7 +1038,7 @@ double TransparentDraggableGeoLith::getMyUpper()
double dUpper = mPlot->xAxis->range().upper; double dUpper = mPlot->xAxis->range().upper;
double proposedRight = mDragStartRange.upper; double proposedRight = mDragStartRange.upper;
TransparentDraggableGeoLith *pDraggableRect =NULL; TransparentDraggableGeoLith *pDraggableRect =nullptr;
{ {
QMap<QString,QObject *>::Iterator it = mPlot->m_mapDraggable_GeoLith.begin(); QMap<QString,QObject *>::Iterator it = mPlot->m_mapDraggable_GeoLith.begin();
while( it != mPlot->m_mapDraggable_GeoLith.end() ) while( it != mPlot->m_mapDraggable_GeoLith.end() )

View File

@ -351,7 +351,7 @@ void TransparentDraggableGujing::onDelRect()
void TransparentDraggableGujing::setItemDepthOffset() void TransparentDraggableGujing::setItemDepthOffset()
{ {
bool ok=0; bool ok=0;
double depthshift=QInputDialog::getDouble(NULL,"深度移动","请输入移动的深度量(上移-,下移+)",0.0,-2147483647, 2147483647,4,&ok); double depthshift=QInputDialog::getDouble(nullptr,"深度移动","请输入移动的深度量(上移-,下移+)",0.0,-2147483647, 2147483647,4,&ok);
if(!ok) return; if(!ok) return;
QCPRange currentRange = getRange(); QCPRange currentRange = getRange();
@ -692,7 +692,7 @@ double TransparentDraggableGujing::getMyLower()
double dLower = mPlot->xAxis->range().lower; double dLower = mPlot->xAxis->range().lower;
double proposedLeft = mDragStartRange.lower; double proposedLeft = mDragStartRange.lower;
TransparentDraggableGujing *pDraggableRect =NULL; TransparentDraggableGujing *pDraggableRect =nullptr;
{ {
QMap<QString,QObject *>::Iterator it = mPlot->m_mapDraggable_Gujing.begin(); QMap<QString,QObject *>::Iterator it = mPlot->m_mapDraggable_Gujing.begin();
while( it != mPlot->m_mapDraggable_Gujing.end() ) while( it != mPlot->m_mapDraggable_Gujing.end() )
@ -721,7 +721,7 @@ double TransparentDraggableGujing::getMyUpper()
double dUpper = mPlot->xAxis->range().upper; double dUpper = mPlot->xAxis->range().upper;
double proposedRight = mDragStartRange.upper; double proposedRight = mDragStartRange.upper;
TransparentDraggableGujing *pDraggableRect =NULL; TransparentDraggableGujing *pDraggableRect =nullptr;
{ {
QMap<QString,QObject *>::Iterator it = mPlot->m_mapDraggable_Gujing.begin(); QMap<QString,QObject *>::Iterator it = mPlot->m_mapDraggable_Gujing.begin();
while( it != mPlot->m_mapDraggable_Gujing.end() ) while( it != mPlot->m_mapDraggable_Gujing.end() )

View File

@ -242,7 +242,7 @@ void TransparentDraggableJiegutext::onDelRect()
void TransparentDraggableJiegutext::setItemDepthOffset() void TransparentDraggableJiegutext::setItemDepthOffset()
{ {
bool ok=0; bool ok=0;
double depthshift=QInputDialog::getDouble(NULL,"深度移动","请输入移动的深度量(上移-,下移+)",0.0,-2147483647, 2147483647,4,&ok); double depthshift=QInputDialog::getDouble(nullptr,"深度移动","请输入移动的深度量(上移-,下移+)",0.0,-2147483647, 2147483647,4,&ok);
if(!ok) return; if(!ok) return;
QCPRange currentRange = getRange(); QCPRange currentRange = getRange();
@ -534,7 +534,7 @@ void TransparentDraggableJiegutext::ReLoadValues()
{ {
// //
FormInfo* pInfo = mPlot->m_formTrack->getFormInfoByParameters(mPlot->m_strUuid, mPlot->m_strWellName, mPlot->m_strTrackName, mPlot->m_strLineName); FormInfo* pInfo = mPlot->m_formTrack->getFormInfoByParameters(mPlot->m_strUuid, mPlot->m_strWellName, mPlot->m_strTrackName, mPlot->m_strLineName);
if (pInfo == NULL) if (pInfo == nullptr)
{ {
return; return;
} }
@ -603,7 +603,7 @@ double TransparentDraggableJiegutext::getMyLower()
double dLower = mPlot->xAxis->range().lower; double dLower = mPlot->xAxis->range().lower;
double proposedLeft = mDragStartRange.lower; double proposedLeft = mDragStartRange.lower;
TransparentDraggableJiegutext *pDraggableRect =NULL; TransparentDraggableJiegutext *pDraggableRect =nullptr;
{ {
QMap<QString,QObject *>::Iterator it = mPlot->m_mapDraggable_Jiegutext.begin(); QMap<QString,QObject *>::Iterator it = mPlot->m_mapDraggable_Jiegutext.begin();
while( it != mPlot->m_mapDraggable_Jiegutext.end() ) while( it != mPlot->m_mapDraggable_Jiegutext.end() )
@ -632,7 +632,7 @@ double TransparentDraggableJiegutext::getMyUpper()
double dUpper = mPlot->xAxis->range().upper; double dUpper = mPlot->xAxis->range().upper;
double proposedRight = mDragStartRange.upper; double proposedRight = mDragStartRange.upper;
TransparentDraggableJiegutext *pDraggableRect =NULL; TransparentDraggableJiegutext *pDraggableRect =nullptr;
{ {
QMap<QString,QObject *>::Iterator it = mPlot->m_mapDraggable_Jiegutext.begin(); QMap<QString,QObject *>::Iterator it = mPlot->m_mapDraggable_Jiegutext.begin();
while( it != mPlot->m_mapDraggable_Jiegutext.end() ) while( it != mPlot->m_mapDraggable_Jiegutext.end() )

View File

@ -228,7 +228,7 @@ void FormHead::updateJsonInfo(QJsonObject headObjInfo)
QJsonValue value = headObjInfo.value("iCols"); QJsonValue value = headObjInfo.value("iCols");
if (value.isDouble()) { if (value.isDouble()) {
iCols = value.toInt(); iCols = value.toInt();
qDebug() << "iCols:" << QString::number(iCols); //qDebug() << "iCols:" << QString::number(iCols);
} }
} }
// //
@ -237,7 +237,7 @@ void FormHead::updateJsonInfo(QJsonObject headObjInfo)
QJsonValue value = headObjInfo.value("iRows"); QJsonValue value = headObjInfo.value("iRows");
if (value.isDouble()) { if (value.isDouble()) {
iRows = value.toInt(); iRows = value.toInt();
qDebug() << "iRows:" << QString::number(iRows); //qDebug() << "iRows:" << QString::number(iRows);
} }
} }
@ -248,7 +248,7 @@ void FormHead::updateJsonInfo(QJsonObject headObjInfo)
QJsonValue value = headObjInfo.value("items"); QJsonValue value = headObjInfo.value("items");
if (value.isArray()) { if (value.isArray()) {
itemsArray = value.toArray(); itemsArray = value.toArray();
qDebug() << "tracksArray number:" << QString::number(itemsArray.size()); //qDebug() << "tracksArray number:" << QString::number(itemsArray.size());
//展示所有单元格 //展示所有单元格
DisplayItems(itemsArray); DisplayItems(itemsArray);
} }
@ -276,7 +276,7 @@ void FormHead::DisplayItems(QJsonArray itemsArray)
QJsonValue value = itemObj.value("id"); QJsonValue value = itemObj.value("id");
if (value.isDouble()) { if (value.isDouble()) {
id = value.toInt(); id = value.toInt();
qDebug() << "id:" << QString::number(id); //qDebug() << "id:" << QString::number(id);
// //
mapItems.insert(id, i); mapItems.insert(id, i);
} }
@ -299,7 +299,7 @@ void FormHead::DisplayItems(QJsonArray itemsArray)
QJsonValue value = itemObj.value("col"); QJsonValue value = itemObj.value("col");
if (value.isDouble()) { if (value.isDouble()) {
col = value.toInt(); col = value.toInt();
qDebug() << "col:" << QString::number(col); //qDebug() << "col:" << QString::number(col);
} }
} }
// //
@ -308,7 +308,7 @@ void FormHead::DisplayItems(QJsonArray itemsArray)
QJsonValue value = itemObj.value("row"); QJsonValue value = itemObj.value("row");
if (value.isDouble()) { if (value.isDouble()) {
row = value.toInt(); row = value.toInt();
qDebug() << "row:" << QString::number(row); //qDebug() << "row:" << QString::number(row);
} }
} }
@ -321,7 +321,7 @@ void FormHead::DisplayItems(QJsonArray itemsArray)
QJsonValue value = itemObj.value("text"); QJsonValue value = itemObj.value("text");
if (value.isString()) { if (value.isString()) {
QString newText = value.toString(); QString newText = value.toString();
qDebug() << "text:" << newText; //qDebug() << "text:" << newText;
item->setText(newText); item->setText(newText);
} }
} }
@ -361,7 +361,7 @@ void FormHead::DisplayItems(QJsonArray itemsArray)
QJsonValue value = itemObj.value("colWidth"); QJsonValue value = itemObj.value("colWidth");
if (value.isDouble()) { if (value.isDouble()) {
colWidth = value.toDouble(); colWidth = value.toDouble();
qDebug() << "colWidth:" << QString::number(colWidth); //qDebug() << "colWidth:" << QString::number(colWidth);
ui->tableWidget->setColumnWidth(col, colWidth*g_dPixelPerCm); ui->tableWidget->setColumnWidth(col, colWidth*g_dPixelPerCm);
} }
} }
@ -371,7 +371,7 @@ void FormHead::DisplayItems(QJsonArray itemsArray)
QJsonValue value = itemObj.value("rowHeight"); QJsonValue value = itemObj.value("rowHeight");
if (value.isDouble()) { if (value.isDouble()) {
rowHeight = value.toDouble(); rowHeight = value.toDouble();
qDebug() << "rowHeight:" << QString::number(rowHeight); //qDebug() << "rowHeight:" << QString::number(rowHeight);
ui->tableWidget->setRowHeight(row, rowHeight*g_dPixelPerCm); ui->tableWidget->setRowHeight(row, rowHeight*g_dPixelPerCm);
} }
} }
@ -385,7 +385,7 @@ void FormHead::DisplayItems(QJsonArray itemsArray)
QJsonValue value = itemObj.value("imagePath"); QJsonValue value = itemObj.value("imagePath");
if (value.isString()) { if (value.isString()) {
imagePath = value.toString(); imagePath = value.toString();
qDebug() << "imagePath:" << imagePath; //qDebug() << "imagePath:" << imagePath;
item->setData(Qt::UserRole+1, imagePath); // 图片路径 item->setData(Qt::UserRole+1, imagePath); // 图片路径
} }
} }
@ -395,7 +395,7 @@ void FormHead::DisplayItems(QJsonArray itemsArray)
QJsonValue value = itemObj.value("colWidth_Img"); QJsonValue value = itemObj.value("colWidth_Img");
if (value.isDouble()) { if (value.isDouble()) {
colWidth_Img = value.toDouble(); colWidth_Img = value.toDouble();
qDebug() << "colWidth_Img:" << QString::number(colWidth_Img); //qDebug() << "colWidth_Img:" << QString::number(colWidth_Img);
item->setData(Qt::UserRole+2, colWidth_Img); item->setData(Qt::UserRole+2, colWidth_Img);
} }
} }
@ -405,7 +405,7 @@ void FormHead::DisplayItems(QJsonArray itemsArray)
QJsonValue value = itemObj.value("rowHeight_Img"); QJsonValue value = itemObj.value("rowHeight_Img");
if (value.isDouble()) { if (value.isDouble()) {
rowHeight_Img = value.toDouble(); rowHeight_Img = value.toDouble();
qDebug() << "rowHeight_Img:" << QString::number(rowHeight_Img); //qDebug() << "rowHeight_Img:" << QString::number(rowHeight_Img);
item->setData(Qt::UserRole+3, rowHeight_Img); item->setData(Qt::UserRole+3, rowHeight_Img);
} }
} }
@ -423,7 +423,7 @@ void FormHead::DisplayItems(QJsonArray itemsArray)
QJsonValue value = itemObj.value("rowSpan"); QJsonValue value = itemObj.value("rowSpan");
if (value.isDouble()) { if (value.isDouble()) {
rowSpan = value.toInt(); rowSpan = value.toInt();
qDebug() << "rowSpan:" << QString::number(rowSpan); //qDebug() << "rowSpan:" << QString::number(rowSpan);
} }
} }
if (itemObj.contains("columnSpan")) if (itemObj.contains("columnSpan"))
@ -431,7 +431,7 @@ void FormHead::DisplayItems(QJsonArray itemsArray)
QJsonValue value = itemObj.value("columnSpan"); QJsonValue value = itemObj.value("columnSpan");
if (value.isDouble()) { if (value.isDouble()) {
colSpan = value.toInt(); colSpan = value.toInt();
qDebug() << "colSpan:" << QString::number(colSpan); //qDebug() << "colSpan:" << QString::number(colSpan);
} }
} }
if(rowSpan > 1 || colSpan > 1) if(rowSpan > 1 || colSpan > 1)

View File

@ -262,7 +262,7 @@ void FormMultiHeads::DisplayHeads(QJsonArray headsArray, QString strHeadOrTail)
QJsonValue value = headObj.value("id"); QJsonValue value = headObj.value("id");
if (value.isDouble()) { if (value.isDouble()) {
id = value.toInt(); id = value.toInt();
qDebug() << "id:" << QString::number(id); //qDebug() << "id:" << QString::number(id);
// //
mapHeads.insert(id, i); mapHeads.insert(id, i);
} }
@ -285,7 +285,7 @@ void FormMultiHeads::DisplayHeads(QJsonArray headsArray, QString strHeadOrTail)
QJsonValue value = headObj.value("colWidth"); QJsonValue value = headObj.value("colWidth");
if (value.isDouble()) { if (value.isDouble()) {
colWidth = value.toDouble(); colWidth = value.toDouble();
qDebug() << "colWidth:" << QString::number(colWidth); //qDebug() << "colWidth:" << QString::number(colWidth);
//设置列宽 //设置列宽
ui->tableWidget->setColumnWidth(0, colWidth); ui->tableWidget->setColumnWidth(0, colWidth);
} }
@ -297,7 +297,7 @@ void FormMultiHeads::DisplayHeads(QJsonArray headsArray, QString strHeadOrTail)
QJsonValue value = headObj.value("rowHeight"); QJsonValue value = headObj.value("rowHeight");
if (value.isDouble()) { if (value.isDouble()) {
rowHeight = value.toDouble(); rowHeight = value.toDouble();
qDebug() << "rowHeight:" << QString::number(rowHeight); //qDebug() << "rowHeight:" << QString::number(rowHeight);
//设置行高度 //设置行高度
ui->tableWidget->setRowHeight(id, rowHeight); ui->tableWidget->setRowHeight(id, rowHeight);
} }
@ -324,7 +324,7 @@ void FormMultiHeads::DisplayHeads(QJsonArray headsArray, QString strHeadOrTail)
QJsonValue value = headObjInfo.value("iCols"); QJsonValue value = headObjInfo.value("iCols");
if (value.isDouble()) { if (value.isDouble()) {
iCols = value.toInt(); iCols = value.toInt();
qDebug() << "iCols:" << QString::number(iCols); //qDebug() << "iCols:" << QString::number(iCols);
} }
} }
// //
@ -333,7 +333,7 @@ void FormMultiHeads::DisplayHeads(QJsonArray headsArray, QString strHeadOrTail)
QJsonValue value = headObjInfo.value("iRows"); QJsonValue value = headObjInfo.value("iRows");
if (value.isDouble()) { if (value.isDouble()) {
iRows = value.toInt(); iRows = value.toInt();
qDebug() << "iRows:" << QString::number(iRows); //qDebug() << "iRows:" << QString::number(iRows);
} }
} }

View File

@ -4437,6 +4437,9 @@ void MainWindowCurve::_slotExport(QPrinter &printer, int IsBmp, QString pngName,
{ {
m_bHeadLoadJson = false; m_bHeadLoadJson = false;
//是否正在加载json
g_iLoadingJson = 1;
QString strHeadOrTail = ""; //Head代表图头 Tail代表成果表 QString strHeadOrTail = ""; //Head代表图头 Tail代表成果表
//展示所有图头 //展示所有图头
strHeadOrTail = "Head"; //Head代表图头 Tail代表成果表 strHeadOrTail = "Head"; //Head代表图头 Tail代表成果表
@ -4444,6 +4447,9 @@ void MainWindowCurve::_slotExport(QPrinter &printer, int IsBmp, QString pngName,
//展示所有成果表 //展示所有成果表
strHeadOrTail = "Tail"; //Head代表图头 Tail代表成果表 strHeadOrTail = "Tail"; //Head代表图头 Tail代表成果表
m_formMultiTails->DisplayHeads(m_tailsArray, strHeadOrTail); m_formMultiTails->DisplayHeads(m_tailsArray, strHeadOrTail);
//是否正在加载json
g_iLoadingJson = 0;
} }
//计算最大宽度 //计算最大宽度
@ -5134,6 +5140,9 @@ void MainWindowCurve::s_showHeadTable()
{ {
m_bHeadLoadJson = false; m_bHeadLoadJson = false;
//是否正在加载json
g_iLoadingJson = 1;
QString strHeadOrTail = ""; //Head代表图头 Tail代表成果表 QString strHeadOrTail = ""; //Head代表图头 Tail代表成果表
//展示所有图头 //展示所有图头
strHeadOrTail = "Head"; //Head代表图头 Tail代表成果表 strHeadOrTail = "Head"; //Head代表图头 Tail代表成果表
@ -5141,6 +5150,9 @@ void MainWindowCurve::s_showHeadTable()
//展示所有成果表 //展示所有成果表
strHeadOrTail = "Tail"; //Head代表图头 Tail代表成果表 strHeadOrTail = "Tail"; //Head代表图头 Tail代表成果表
m_formMultiTails->DisplayHeads(m_tailsArray, strHeadOrTail); m_formMultiTails->DisplayHeads(m_tailsArray, strHeadOrTail);
//是否正在加载json
g_iLoadingJson = 0;
} }
//判断头宽 //判断头宽
int iWidth_Head, iHight_Head; int iWidth_Head, iHight_Head;

View File

@ -115,7 +115,7 @@ void CQtFormulaDialogFactory::disconnectPropertyManager(CQtFormulaDialogProperty
} }
void CQtFormulaDialogFactoryPrivate::slotPropertyChanged(QtProperty *property, QString value) void CQtFormulaDialogFactoryPrivate::slotPropertyChanged(QtProperty *property, QVariant value)
{ {
const PropertyToEditorListMap::iterator it = m_createdEditors.find(property); const PropertyToEditorListMap::iterator it = m_createdEditors.find(property);
@ -124,7 +124,7 @@ void CQtFormulaDialogFactoryPrivate::slotPropertyChanged(QtProperty *property, Q
QListIterator<CQtFormulaDialogEditWidget *> itEditor(it.value()); QListIterator<CQtFormulaDialogEditWidget *> itEditor(it.value());
while (itEditor.hasNext()) while (itEditor.hasNext())
itEditor.next()->setValue(value); itEditor.next()->setValue(value.toString());
} }
void CQtFormulaDialogFactoryPrivate::slotSetValue(QString value) void CQtFormulaDialogFactoryPrivate::slotSetValue(QString value)
@ -324,7 +324,7 @@ QWidget(parent),
lt->addWidget(m_button); lt->addWidget(m_button);
m_label->setText(m_formula); m_label->setText(m_formula);
m_tableView->setMouseTracking(true); m_tableView->setMouseTracking(true);
formulaDialog->setLayout(NULL); formulaDialog->setLayout(nullptr);
initConnect(); initConnect();
} }
void CQtFormulaDialogEditWidget::initConnect() void CQtFormulaDialogEditWidget::initConnect()

View File

@ -103,7 +103,7 @@ private:
QScopedPointer<CQtFormulaDialogFactoryPrivate> d_ptr; QScopedPointer<CQtFormulaDialogFactoryPrivate> d_ptr;
Q_DECLARE_PRIVATE(CQtFormulaDialogFactory) Q_DECLARE_PRIVATE(CQtFormulaDialogFactory)
Q_DISABLE_COPY(CQtFormulaDialogFactory) Q_DISABLE_COPY(CQtFormulaDialogFactory)
Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, QString)) Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, QVariant))
Q_PRIVATE_SLOT(d_func(), void slotSetValue(QString)) Q_PRIVATE_SLOT(d_func(), void slotSetValue(QString))
Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *)) Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
@ -117,7 +117,7 @@ class QTPROPERTYBROWSER_EXPORT CQtFormulaDialogFactoryPrivate : public EditorFac
Q_DECLARE_PUBLIC(CQtFormulaDialogFactory) Q_DECLARE_PUBLIC(CQtFormulaDialogFactory)
public: public:
void slotPropertyChanged(QtProperty *property, QString value); void slotPropertyChanged(QtProperty *property, QVariant value);
void slotSetValue(QString value); void slotSetValue(QString value);
}; };