Brush rendering notes
This commit is contained in:
parent
a15825fa4c
commit
a996c0a3af
|
@ -168,6 +168,9 @@ void QGIHatch::setFill(std::string fillSpec)
|
||||||
//QString qs(QString::fromUtf8("../src/Mod/Drawing/patterns/square.svg"));
|
//QString qs(QString::fromUtf8("../src/Mod/Drawing/patterns/square.svg"));
|
||||||
QSvgRenderer renderer(qs);
|
QSvgRenderer renderer(qs);
|
||||||
//QBitmap pixMap(64,64); //this size is scene units (mm) instead of pixels?
|
//QBitmap pixMap(64,64); //this size is scene units (mm) instead of pixels?
|
||||||
|
//QPixmap::fromImage(m_image);
|
||||||
|
//QImage(qt_patternForBrush(style, 0), 8, 8, 1, QImage::Format_MonoLSB);
|
||||||
|
//QPixmap::scaled(QSize,QTAspectmode,QTTransformmode)
|
||||||
QBitmap pixMap(renderer.defaultSize());
|
QBitmap pixMap(renderer.defaultSize());
|
||||||
pixMap.fill(Qt::white); //try Qt::transparent?
|
pixMap.fill(Qt::white); //try Qt::transparent?
|
||||||
QPainter painter(&pixMap);
|
QPainter painter(&pixMap);
|
||||||
|
@ -176,6 +179,8 @@ void QGIHatch::setFill(std::string fillSpec)
|
||||||
m_texture = pixMap;
|
m_texture = pixMap;
|
||||||
m_brush = QBrush(m_texture);
|
m_brush = QBrush(m_texture);
|
||||||
m_brush.setStyle(Qt::TexturePattern);
|
m_brush.setStyle(Qt::TexturePattern);
|
||||||
|
//m_brush = QBrush(Qt::CrossPattern);
|
||||||
|
//m_brush = QBrush(Qt::DiagCrossPattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGIHatch::setColor(App::Color c)
|
void QGIHatch::setColor(App::Color c)
|
||||||
|
|
|
@ -389,10 +389,10 @@ void QGIViewPart::drawViewPart()
|
||||||
item->setAcceptHoverEvents(true);
|
item->setAcceptHoverEvents(true);
|
||||||
item->setZValue(ZVALUE::EDGE);
|
item->setZValue(ZVALUE::EDGE);
|
||||||
//debug a path
|
//debug a path
|
||||||
QPainterPath edgePath=drawPainterPath(*itEdge);
|
//QPainterPath edgePath=drawPainterPath(*itEdge);
|
||||||
std::stringstream edgeId;
|
//std::stringstream edgeId;
|
||||||
edgeId << "QGIVP.edgePath" << i;
|
//edgeId << "QGIVP.edgePath" << i;
|
||||||
_dumpPath(edgeId.str().c_str(),edgePath);
|
//_dumpPath(edgeId.str().c_str(),edgePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user