draw Avatar circle
This commit is contained in:
parent
0f6d9f6aa9
commit
2b1556d2a3
|
@ -25,7 +25,18 @@ void Avatar::paintEvent(QPaintEvent *event)
|
|||
{
|
||||
QPainter painter(this);
|
||||
|
||||
painter.drawRect(0, 50, 50, 50);
|
||||
painter.drawRect(rect().adjusted(0, 0, -1, -1));
|
||||
|
||||
painter.setRenderHint(QPainter::Antialiasing);
|
||||
|
||||
QBrush brush;
|
||||
brush.setStyle(Qt::SolidPattern);
|
||||
|
||||
painter.setPen(Qt::NoPen);
|
||||
painter.setBrush(brush);
|
||||
|
||||
QRect r = rect();
|
||||
painter.drawEllipse(r.center(), 24, 24);
|
||||
|
||||
QWidget::paintEvent(event);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue