blob: fda229bbd86cc25a6c0045d1fb50f8067ba52022 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "ellipseitem.h"
#include <QPainter>
EllipseItem::EllipseItem(QQuickItem *parent)
: QQuickPaintedItem(parent)
{
}
EllipseItem::~EllipseItem()
{
}
void EllipseItem::paint(QPainter *painter)
{
const qreal halfPenWidth = qMax(painter->pen().width() / 2.0, 1.0);
QRectF rect = boundingRect();
rect.adjust(halfPenWidth, halfPenWidth, -halfPenWidth, -halfPenWidth);
painter->drawEllipse(rect);
}
|