PB Sample buffers: falsehijackWindow() context created for Widget(0x22ff18, name = "Widget") 1
C++ (Qt)void Widget::paintEvent(QPaintEvent *event){ qreal penWidth = 1.5; QPainter painter(this); painter.fillRect(0, 0, width(), height(), Qt::darkGray); painter.setBrush(Qt::NoBrush); painter.setPen(QPen(QBrush(Qt::white), penWidth)); painter.setRenderHint(QPainter::Antialiasing, true); QRectF clipRect(0, 0, width(), height()); clipRect.adjust(-penWidth, -penWidth, penWidth, penWidth); QPainterPath clipPath; clipPath.addRect(clipRect); foreach(const circle &c, circles) { QPointF center = c.c * scale + shift; qreal radius = c.r * scale; QPainterPath path; path.addEllipse(center, radius, radius); path = path.intersected(clipPath); if (path != clipPath) painter.drawPath(path); }}