logplus/logPlus/wellheader.cpp

71 lines
1.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.

#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) :
FormBase(parent, strSlfName, strWellName)
{
}
WellHeader::~WellHeader()
{
}
void WellHeader::initProperty(QJsonObject obj)
{
}
QJsonObject WellHeader::makeJson()
{
QJsonObject rootObj;
return rootObj;
}
void WellHeader::paintEvent(QPaintEvent *event)
{
FormBase::paintEvent(event);
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)
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);
}
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, "");
}
}