2026-04-21 09:02:09 +08:00
|
|
|
|
#include "wellheader.h"
|
|
|
|
|
|
#include "formwell.h"
|
|
|
|
|
|
#include "CallManage.h"
|
|
|
|
|
|
#include <QDebug>
|
|
|
|
|
|
#include <QMimeData>
|
|
|
|
|
|
#include <QPushButton>
|
|
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
|
#include <QMenu>
|
|
|
|
|
|
#include "PropertyWidget.h"
|
|
|
|
|
|
|
|
|
|
|
|
//曲线名称(单个)
|
|
|
|
|
|
WellHeader::WellHeader(QWidget *parent, QString strSlfName, QString strWellName) :
|
2026-04-21 11:21:57 +08:00
|
|
|
|
FormBase(parent, strSlfName, strWellName)
|
2026-04-21 09:02:09 +08:00
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
WellHeader::~WellHeader()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WellHeader::initProperty(QJsonObject obj)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QJsonObject WellHeader::makeJson()
|
|
|
|
|
|
{
|
|
|
|
|
|
QJsonObject rootObj;
|
|
|
|
|
|
return rootObj;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-21 11:21:57 +08:00
|
|
|
|
void WellHeader::paintEvent(QPaintEvent *event)
|
|
|
|
|
|
{
|
|
|
|
|
|
FormBase::paintEvent(event);
|
2026-04-21 09:02:09 +08:00
|
|
|
|
|
2026-04-21 11:21:57 +08:00
|
|
|
|
QPainter painter(this);
|
|
|
|
|
|
QRect rect = this->rect();
|
|
|
|
|
|
//背景透明
|
|
|
|
|
|
painter.fillRect(rect.left(), rect.top(), rect.width(), rect.height(), QColor(0, 0, 0, 0)); //QColor(67, 67, 67, 100)
|
2026-04-21 09:02:09 +08:00
|
|
|
|
|
2026-04-21 11:21:57 +08:00
|
|
|
|
QString strShowTxt = "";
|
|
|
|
|
|
painter.setBrush(Qt::NoBrush); // 确保文字不被填充色遮挡
|
|
|
|
|
|
painter.setFont(m_Font);
|
|
|
|
|
|
painter.setPen(m_Color); // fontColor QColor(220, 220, 220)
|
|
|
|
|
|
painter.drawText(rect, Qt::AlignCenter, m_strWellName);
|
2026-04-21 09:02:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WellHeader::mousePressEvent(QMouseEvent *event)
|
|
|
|
|
|
{
|
|
|
|
|
|
QWidget::mousePressEvent(event);
|
|
|
|
|
|
if (event->button() == Qt::LeftButton)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_press = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WellHeader::mouseReleaseEvent(QMouseEvent *event)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (m_press)//如果鼠标左键被释放
|
|
|
|
|
|
{
|
|
|
|
|
|
m_press = false;//按下标志置fasle,形成互斥
|
|
|
|
|
|
|
|
|
|
|
|
PropertyService()->initWellProperty(m_strUuid, m_strSlfName, m_strWellName,
|
|
|
|
|
|
m_pFormWell->m_iY1, m_pFormWell->m_iY2, m_pFormWell);
|
|
|
|
|
|
|
|
|
|
|
|
//选中单元格
|
|
|
|
|
|
emit CallManage::getInstance()->sig_Raise(m_strUuid, m_strSlfName, m_strWellName, "", "", 1, "");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|