2025-10-29 17:23:30 +08:00
|
|
|
|
#include "formline.h"
|
|
|
|
|
|
#include "ui_formline.h"
|
2026-01-14 15:24:23 +08:00
|
|
|
|
#include <QPainter>
|
|
|
|
|
|
#include "DrawTvd.h"
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
|
|
|
|
|
//demo画线,暂时不用
|
2026-01-14 15:24:23 +08:00
|
|
|
|
FormLine::FormLine(QWidget *parent, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName) :
|
2025-10-29 17:23:30 +08:00
|
|
|
|
QWidget(parent),
|
|
|
|
|
|
ui(new Ui::FormLine)
|
|
|
|
|
|
{
|
|
|
|
|
|
ui->setupUi(this);
|
2026-01-14 15:24:23 +08:00
|
|
|
|
|
|
|
|
|
|
m_strSlfName = strSlfName;
|
|
|
|
|
|
m_strWellName = strWellName;
|
|
|
|
|
|
m_strTrackName = strTrackName;
|
|
|
|
|
|
m_strLineName = strLineName;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void FormLine::DrawTvd()
|
|
|
|
|
|
{
|
|
|
|
|
|
//
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
|
|
CDrawTvd *drawTvd = new CDrawTvd();
|
|
|
|
|
|
drawTvd->sFilePath = m_strSlfName;
|
|
|
|
|
|
drawTvd->DrawTvd(&painter, rect);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FormLine::~FormLine()
|
|
|
|
|
|
{
|
|
|
|
|
|
delete ui;
|
|
|
|
|
|
}
|
2026-01-14 15:24:23 +08:00
|
|
|
|
|
|
|
|
|
|
void FormLine::paintEvent(QPaintEvent*)
|
|
|
|
|
|
{
|
|
|
|
|
|
// 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)
|
|
|
|
|
|
|
|
|
|
|
|
// painter.setPen(QPen(Qt::green,2,Qt::DashLine));
|
|
|
|
|
|
// //painter.setBrush(QBrush(Qt::red,Qt::SolidPattern));
|
|
|
|
|
|
|
|
|
|
|
|
// QFont font1("微软雅黑", 10, false, false); //fontSize 10
|
|
|
|
|
|
// painter.setFont(font1);
|
|
|
|
|
|
// painter.setPen(QColor(0, 0, 0)); // fontColor QColor(220, 220, 220)
|
|
|
|
|
|
// painter.drawText(rect.left() + 10, 10, ("画图")); // titleBarText QStringLiteral("动画")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// QRect rectRound(rect.left()+2,rect.top()+4, rect.width()-3, rect.height()-4);
|
|
|
|
|
|
// painter.drawRoundRect(rectRound);
|
|
|
|
|
|
|
|
|
|
|
|
}
|