phy*_*att 13
在paintEvent使用中:
http://doc.qt.io/qt-4.8/qpainter.html#drawEllipse
http://doc.qt.io/qt-4.8/qgraphicsscene.html#addEllipse
在QGraphicsView/ QGraphicsScene使用这个:
http://doc.qt.io/qt-4.8/qgraphicsellipseitem.html
http://doc.qt.io/qt-4.8/qpainter.html#drawEllipse
列出的最后一个链接是一个重载方法,允许您输入指定了两个半径的中心点.
void QPainter::drawEllipse ( const QPointF & center, qreal rx, qreal ry )
所以你的代码看起来像:
// inside MyWidget::paintEvent()
painter.drawEllipse(QPointF(x,y), radius, radius);
Run Code Online (Sandbox Code Playgroud)
希望有所帮助.
| 归档时间: |
|
| 查看次数: |
40284 次 |
| 最近记录: |