本文整理汇总了C++中QPainterPathStroker::setDashOffset方法的典型用法代码示例。如果您正苦于以下问题:C++ QPainterPathStroker::setDashOffset方法的具体用法?C++ QPainterPathStroker::setDashOffset怎么用?C++ QPainterPathStroker::setDashOffset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QPainterPathStroker
的用法示例。
在下文中一共展示了QPainterPathStroker::setDashOffset方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: strokeBoundingRect
FloatRect Path::strokeBoundingRect(StrokeStyleApplier* applier)
{
GraphicsContext* gc = scratchContext();
QPainterPathStroker stroke;
if (applier) {
applier->strokeStyle(gc);
QPen pen = gc->pen();
stroke.setWidth(pen.widthF());
stroke.setCapStyle(pen.capStyle());
stroke.setJoinStyle(pen.joinStyle());
stroke.setMiterLimit(pen.miterLimit());
stroke.setDashPattern(pen.dashPattern());
stroke.setDashOffset(pen.dashOffset());
}
return stroke.createStroke(m_path).boundingRect();
}
示例2: strokeContains
bool Path::strokeContains(StrokeStyleApplier* applier, const FloatPoint& point) const
{
ASSERT(applier);
QPainterPathStroker stroke;
GraphicsContext* gc = scratchContext();
applier->strokeStyle(gc);
QPen pen = gc->pen();
stroke.setWidth(pen.widthF());
stroke.setCapStyle(pen.capStyle());
stroke.setJoinStyle(pen.joinStyle());
stroke.setMiterLimit(pen.miterLimit());
stroke.setDashPattern(pen.dashPattern());
stroke.setDashOffset(pen.dashOffset());
return stroke.createStroke(m_path).contains(point);
}
示例3: testStroker
void tst_QPainterPath::testStroker()
{
QFETCH(QPainterPath, path);
QFETCH(QPen, pen);
QFETCH(QPainterPath, stroke);
QPainterPathStroker stroker;
stroker.setWidth(pen.widthF());
stroker.setCapStyle(pen.capStyle());
stroker.setJoinStyle(pen.joinStyle());
stroker.setMiterLimit(pen.miterLimit());
stroker.setDashPattern(pen.style());
stroker.setDashOffset(pen.dashOffset());
QPainterPath result = stroker.createStroke(path);
// check if stroke == result
QVERIFY(result.subtracted(stroke).isEmpty());
QVERIFY(stroke.subtracted(result).isEmpty());
}
示例4: strokeBoundingRect
FloatRect Path::strokeBoundingRect(StrokeStyleApplier* applier)
{
// FIXME: We should try to use a 'shared Context' instead of creating a new ImageBuffer
// on each call.
OwnPtr<ImageBuffer> scratchImage = ImageBuffer::create(IntSize(1, 1));
GraphicsContext* gc = scratchImage->context();
QPainterPathStroker stroke;
if (applier) {
applier->strokeStyle(gc);
QPen pen = gc->pen();
stroke.setWidth(pen.widthF());
stroke.setCapStyle(pen.capStyle());
stroke.setJoinStyle(pen.joinStyle());
stroke.setMiterLimit(pen.miterLimit());
stroke.setDashPattern(pen.dashPattern());
stroke.setDashOffset(pen.dashOffset());
}
return stroke.createStroke(m_path).boundingRect();
}
示例5: strokeContains
bool Path::strokeContains(StrokeStyleApplier* applier, const FloatPoint& point) const
{
ASSERT(applier);
// FIXME: We should try to use a 'shared Context' instead of creating a new ImageBuffer
// on each call.
OwnPtr<ImageBuffer> scratchImage = ImageBuffer::create(IntSize(1, 1));
GraphicsContext* gc = scratchImage->context();
QPainterPathStroker stroke;
applier->strokeStyle(gc);
QPen pen = gc->pen();
stroke.setWidth(pen.widthF());
stroke.setCapStyle(pen.capStyle());
stroke.setJoinStyle(pen.joinStyle());
stroke.setMiterLimit(pen.miterLimit());
stroke.setDashPattern(pen.dashPattern());
stroke.setDashOffset(pen.dashOffset());
return stroke.createStroke(m_path).contains(point);
}