本文整理汇总了C++中Painter::drawArc方法的典型用法代码示例。如果您正苦于以下问题:C++ Painter::drawArc方法的具体用法?C++ Painter::drawArc怎么用?C++ Painter::drawArc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Painter
的用法示例。
在下文中一共展示了Painter::drawArc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
void RadialAnimation::draw(Painter &p, const QRect &inner, int32 thickness, const style::color &color) {
float64 o = p.opacity();
p.setOpacity(o * _opacity);
QPen pen(color->p), was(p.pen());
pen.setWidth(thickness);
p.setPen(pen);
int32 len = MinArcLength + a_arcEnd.current();
int32 from = QuarterArcLength - a_arcStart.current() - len;
if (rtl()) {
from = QuarterArcLength - (from - QuarterArcLength) - len;
if (from < 0) from += FullArcLength;
}
p.setRenderHint(QPainter::HighQualityAntialiasing);
p.drawArc(inner, from, len);
p.setRenderHint(QPainter::HighQualityAntialiasing, false);
p.setPen(was);
p.setOpacity(o);
}
示例2: draw
void InfiniteRadialAnimation::draw(
Painter &p,
QPoint position,
QSize size,
int outerWidth) {
const auto state = computeState();
auto o = p.opacity();
p.setOpacity(o * state.shown);
const auto rect = rtlrect(
position.x(),
position.y(),
size.width(),
size.height(),
outerWidth);
const auto was = p.pen();
const auto brush = p.brush();
if (anim::Disabled()) {
anim::DrawStaticLoading(p, rect, _st.thickness, _st.color);
} else {
auto pen = _st.color->p;
pen.setWidth(_st.thickness);
pen.setCapStyle(Qt::RoundCap);
p.setPen(pen);
{
PainterHighQualityEnabler hq(p);
p.drawArc(
rect,
state.arcFrom,
state.arcLength);
}
}
p.setPen(was);
p.setBrush(brush);
p.setOpacity(o);
}
示例3: draw
void RadialAnimation::draw(Painter &p, const QRect &inner, int32 thickness, style::color color) {
float64 o = p.opacity();
p.setOpacity(o * _opacity);
QPen pen(color->p), was(p.pen());
pen.setWidth(thickness);
pen.setCapStyle(Qt::RoundCap);
p.setPen(pen);
auto len = MinArcLength + qRound(a_arcEnd.current());
auto from = QuarterArcLength - qRound(a_arcStart.current()) - len;
if (rtl()) {
from = QuarterArcLength - (from - QuarterArcLength) - len;
if (from < 0) from += FullArcLength;
}
{
PainterHighQualityEnabler hq(p);
p.drawArc(inner, from, len);
}
p.setPen(was);
p.setOpacity(o);
}