本文整理汇总了C++中QVectorPath::controlPointRect方法的典型用法代码示例。如果您正苦于以下问题:C++ QVectorPath::controlPointRect方法的具体用法?C++ QVectorPath::controlPointRect怎么用?C++ QVectorPath::controlPointRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QVectorPath
的用法示例。
在下文中一共展示了QVectorPath::controlPointRect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: stroke
void QEmulationPaintEngine::stroke(const QVectorPath &path, const QPen &pen)
{
QPainterState *s = state();
if (s->bgMode == Qt::OpaqueMode && pen.style() > Qt::SolidLine) {
QPen bgPen = pen;
bgPen.setBrush(s->bgBrush);
bgPen.setStyle(Qt::SolidLine);
real_engine->stroke(path, bgPen);
}
QBrush brush = pen.brush();
QPen copy = pen;
Qt::BrushStyle style = qbrush_style(brush);
if (style >= Qt::LinearGradientPattern && style <= Qt::ConicalGradientPattern) {
const QGradient *g = brush.gradient();
if (g->coordinateMode() > QGradient::LogicalMode) {
if (g->coordinateMode() == QGradient::StretchToDeviceMode) {
QTransform mat = brush.transform();
mat.scale(real_engine->painter()->device()->width(), real_engine->painter()->device()->height());
brush.setTransform(mat);
copy.setBrush(brush);
real_engine->stroke(path, copy);
return;
} else if (g->coordinateMode() == QGradient::ObjectBoundingMode) {
QTransform mat = brush.transform();
QRectF r = path.controlPointRect();
mat.translate(r.x(), r.y());
mat.scale(r.width(), r.height());
brush.setTransform(mat);
copy.setBrush(brush);
real_engine->stroke(path, copy);
return;
}
}
}
real_engine->stroke(path, pen);
}
示例2: fill
void QEmulationPaintEngine::fill(const QVectorPath &path, const QBrush &brush)
{
QPainterState *s = state();
if (s->bgMode == Qt::OpaqueMode) {
Qt::BrushStyle style = brush.style();
if (style >= Qt::Dense1Pattern && style <= Qt::DiagCrossPattern)
real_engine->fill(path, s->bgBrush);
}
Qt::BrushStyle style = qbrush_style(brush);
if (style >= Qt::LinearGradientPattern && style <= Qt::ConicalGradientPattern) {
const QGradient *g = brush.gradient();
if (g->coordinateMode() > QGradient::LogicalMode) {
if (g->coordinateMode() == QGradient::StretchToDeviceMode) {
QBrush copy = brush;
QTransform mat = copy.transform();
mat.scale(real_engine->painter()->device()->width(), real_engine->painter()->device()->height());
copy.setTransform(mat);
real_engine->fill(path, copy);
return;
} else if (g->coordinateMode() == QGradient::ObjectBoundingMode) {
QBrush copy = brush;
QTransform mat = copy.transform();
QRectF r = path.controlPointRect();
mat.translate(r.x(), r.y());
mat.scale(r.width(), r.height());
copy.setTransform(mat);
real_engine->fill(path, copy);
return;
}
}
}
real_engine->fill(path, brush);
}