#include "formline.h" #include "ui_formline.h" #include #include "DrawTvd.h" //demo画线,暂时不用 FormLine::FormLine(QWidget *parent, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName) : QWidget(parent), ui(new Ui::FormLine) { ui->setupUi(this); 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); } FormLine::~FormLine() { delete ui; } 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) CDrawTvd *drawTvd = new CDrawTvd(); drawTvd->sFilePath = m_strSlfName; drawTvd->DrawTvd(&painter, rect); // 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); }