本文整理汇总了C++中KstPainter::lineWidthAdjustmentFactor方法的典型用法代码示例。如果您正苦于以下问题:C++ KstPainter::lineWidthAdjustmentFactor方法的具体用法?C++ KstPainter::lineWidthAdjustmentFactor怎么用?C++ KstPainter::lineWidthAdjustmentFactor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KstPainter
的用法示例。
在下文中一共展示了KstPainter::lineWidthAdjustmentFactor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paintSelf
void KstViewArrow::paintSelf(KstPainter& p, const QRegion& bounds) {
p.save();
if (p.type() != KstPainter::P_PRINT && p.type() != KstPainter::P_EXPORT) {
if (p.makingMask()) {
p.setCompositionMode(QPainter::CompositionMode_Source);
} else {
const QRegion clip(clipRegion());
KstViewLine::paintSelf(p, bounds - _myClipMask);
p.setClipRegion(bounds & clip);
}
} else {
KstViewLine::paintSelf(p, bounds);
}
if (hasArrow()) {
QPoint to = KstViewLine::to();
QPoint from = KstViewLine::from();
const int w = width() * p.lineWidthAdjustmentFactor();
QPen pen(_foregroundColor, w);
pen.setCapStyle(capStyle());
p.setPen(pen);
p.setBrush(_foregroundColor);
if (_hasToArrow) {
paintArrow(p, to, from, w, _toArrowScaling);
}
if (_hasFromArrow) {
paintArrow(p, from, to, w, _fromArrowScaling);
}
}
p.restore();
}
示例2: setContentsRectForDevice
void KstBorderedViewObject::setContentsRectForDevice(const KstPainter& painter, QRect& rect) {
const int mpb = (_margin + _padding + _borderWidth) * painter.lineWidthAdjustmentFactor();
_geom.setX(rect.left() - mpb);
_geom.setY(rect.top() - mpb);
_geom.setWidth(rect.width() + 2 * mpb);
_geom.setHeight(rect.height() + 2 * mpb);
}
示例3: contentsRectForDevice
QRect KstBorderedViewObject::contentsRectForDevice(const KstPainter& painter) const {
QRect rc;
const int mpb = (_margin + _padding + _borderWidth) * painter.lineWidthAdjustmentFactor();
rc.setX(_geom.left() + mpb);
rc.setY(_geom.top() + mpb);
rc.setWidth(_geom.width() - 2 * mpb);
rc.setHeight(_geom.height() - 2 * mpb);
return rc;
}