解释结论,竖写居中显示
设置道宽为1-2cm显示不正常bug
This commit is contained in:
parent
90955103a3
commit
0d44dc12e7
|
|
@ -2896,6 +2896,8 @@ QMyCustomPlot* FormDraw::addTableLine(QString strUuid, QString strSlfName, QStri
|
||||||
}
|
}
|
||||||
else if (strLineName == "RESULT")
|
else if (strLineName == "RESULT")
|
||||||
{
|
{
|
||||||
|
curv->setRowGridVisible(false);
|
||||||
|
curv->setColGridVisible(false);
|
||||||
//解释结论
|
//解释结论
|
||||||
initResult(curv, strSlfName, strLineName);
|
initResult(curv, strSlfName, strLineName);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -791,8 +791,8 @@ void FormInfo::paintEvent(QPaintEvent* event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//painter.setBrush(QBrush(Qt::red, Qt::SolidPattern));
|
//painter.setBrush(QBrush(Qt::red, Qt::SolidPattern));
|
||||||
QRect rectRound(rect.left()+2,rect.top()+4, rect.width()-4, rect.height()-8);
|
//QRect rectRound(rect.left() + 2, rect.top() + 4, rect.width() - 4, rect.height() - 8);
|
||||||
painter.setPen(QPen(m_lineColor, m_dWidth, m_lineStyle));
|
//painter.setPen(QPen(m_lineColor, m_dWidth, m_lineStyle));
|
||||||
//painter.drawRoundRect(rectRound);//利用画刷(颜色/岩性图片),画框
|
//painter.drawRoundRect(rectRound);//利用画刷(颜色/岩性图片),画框
|
||||||
//painter.drawRect(rectRound);
|
//painter.drawRect(rectRound);
|
||||||
|
|
||||||
|
|
@ -965,15 +965,17 @@ void FormInfo::paintEvent(QPaintEvent* event)
|
||||||
{
|
{
|
||||||
QRect rt = rect;
|
QRect rt = rect;
|
||||||
QString text = "";
|
QString text = "";
|
||||||
|
bool bVer = false;
|
||||||
if (!m_bVerticaDrawing)
|
if (!m_bVerticaDrawing)
|
||||||
{
|
{
|
||||||
rt.setX(rect.left());
|
QFontMetrics fm1(m_curveNameFont);
|
||||||
rt.setY(rect.top() + rect.height() / 3);
|
QRect textRect = fm1.boundingRect(strShowTxt);
|
||||||
rt.setWidth(rect.width());
|
if (textRect.width() > rt.width())
|
||||||
rt.setHeight(rect.height() / 3);
|
{
|
||||||
text = strShowTxt;
|
bVer = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
if (m_bVerticaDrawing || bVer)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < strShowTxt.size(); i++) {
|
for (int i = 0; i < strShowTxt.size(); i++) {
|
||||||
if (!i)text += strShowTxt.at(i);
|
if (!i)text += strShowTxt.at(i);
|
||||||
|
|
@ -983,6 +985,14 @@ void FormInfo::paintEvent(QPaintEvent* event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rt.setX(rect.left());
|
||||||
|
rt.setY(rect.top() + rect.height() / 3);
|
||||||
|
rt.setWidth(rect.width());
|
||||||
|
rt.setHeight(rect.height() / 3);
|
||||||
|
text = strShowTxt;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_nRotationAngle != 0)
|
if (m_nRotationAngle != 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -218,9 +218,10 @@ QVector<QWidget *> FormWell::new_track(QStringList listdt, QString strTrackName)
|
||||||
|
|
||||||
//曲线名称栏
|
//曲线名称栏
|
||||||
formTrack = new FormTrack(this, strWellName, strTrackName);
|
formTrack = new FormTrack(this, strWellName, strTrackName);
|
||||||
formTrack->setBorderFlags(BorderFlags(BottomBorder | RightBorder));
|
formTrack->setBorderFlags(BorderFlags(BottomBorder |RightBorder));
|
||||||
|
formTrack->setFixedWidth(dW * g_dPixelPerCm);
|
||||||
// if ("curveObject" == strType)
|
// if ("curveObject" == strType)
|
||||||
// formTrack->setFixedWidth(nW / 2);
|
//formTrack->setFixedWidth(20);
|
||||||
vec << formTrack;
|
vec << formTrack;
|
||||||
formTrack->m_strUuid = m_strUuid;
|
formTrack->m_strUuid = m_strUuid;
|
||||||
formTrack->show();
|
formTrack->show();
|
||||||
|
|
@ -580,7 +581,21 @@ int FormWell::setColWidth(int iCurrentCol, float fWidth)
|
||||||
//
|
//
|
||||||
FormDraw *formDraw = qobject_cast<FormDraw*>(myWidget);//获得widget
|
FormDraw *formDraw = qobject_cast<FormDraw*>(myWidget);//获得widget
|
||||||
if(formDraw)
|
if(formDraw)
|
||||||
{
|
{
|
||||||
|
if (formDraw->m_formTrack)
|
||||||
|
{
|
||||||
|
formDraw->m_formTrack->setFixedWidth(iNewWidth);
|
||||||
|
// QRect rt = formDraw->m_formTrack->geometry();
|
||||||
|
// rt.setWidth(iNewWidth);
|
||||||
|
// formDraw->m_formTrack->setGeometry(rt);
|
||||||
|
|
||||||
|
// const QVector<FormInfo*>& vecIfo = formDraw->m_formTrack->getVecFormInfo();
|
||||||
|
// for (FormInfo *pinfo : vecIfo) {
|
||||||
|
// QRect rt = pinfo->geometry();
|
||||||
|
// rt.setWidth(iNewWidth);
|
||||||
|
// pinfo->setGeometry(rt);
|
||||||
|
// }
|
||||||
|
}
|
||||||
formDraw->setColWidth(iNewWidth);
|
formDraw->setColWidth(iNewWidth);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="topMargin">
|
<property name="topMargin">
|
||||||
<number>2</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="rightMargin">
|
<property name="rightMargin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
|
|
|
||||||
|
|
@ -10192,6 +10192,24 @@ void QMyCustomPlot::drawGrid(bool b)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QMyCustomPlot::setRowGridVisible(bool bvis)
|
||||||
|
{
|
||||||
|
m_bRowGridVisible = bvis;
|
||||||
|
for (int i = 0; i < m_vecRowGrid.size(); i++)
|
||||||
|
{
|
||||||
|
m_vecRowGrid.at(i)->setVisible(bvis);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void QMyCustomPlot::setColGridVisible(bool bvis)
|
||||||
|
{
|
||||||
|
m_bColGridVisible = bvis;
|
||||||
|
for (int i = 0; i < m_vecColGrid.size(); i++)
|
||||||
|
{
|
||||||
|
m_vecColGrid.at(i)->setVisible(bvis);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//道宽改变后,避免井壁取心等组件变形,需要重新刷新
|
//道宽改变后,避免井壁取心等组件变形,需要重新刷新
|
||||||
void QMyCustomPlot::resetPosition()
|
void QMyCustomPlot::resetPosition()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,8 @@ public:
|
||||||
//绘制网格
|
//绘制网格
|
||||||
void drawGrid(bool b = false);
|
void drawGrid(bool b = false);
|
||||||
|
|
||||||
|
void setRowGridVisible(bool bvis);
|
||||||
|
void setColGridVisible(bool bvis);
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user