diff options
Diffstat (limited to 'examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp')
-rw-r--r-- | examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp index f36c8ce3f4..764ef23944 100644 --- a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp +++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp @@ -41,11 +41,9 @@ #include <QPainter> -PieSlice::PieSlice(QDeclarativeItem *parent) - : QDeclarativeItem(parent) +PieSlice::PieSlice(QSGItem *parent) + : QSGPaintedItem(parent) { - // need to disable this flag to draw inside a QDeclarativeItem - setFlag(QGraphicsItem::ItemHasNoContents, false); } QColor PieSlice::color() const @@ -58,11 +56,11 @@ void PieSlice::setColor(const QColor &color) m_color = color; } -void PieSlice::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) +void PieSlice::paint(QPainter *painter) { QPen pen(m_color, 2); painter->setPen(pen); - painter->setRenderHints(QPainter::Antialiasing, true); + painter->setRenderHints(QPainter::HighQualityAntialiasing, true); painter->drawPie(boundingRect(), 90 * 16, 290 * 16); } |