X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Fdeclarative%2Ftutorials%2Fextending%2Fchapter4-customPropertyTypes%2Fpieslice.cpp;h=764ef23944e179e6d8a5cd640af396a3927437b5;hb=76dd4f8af9c48a685cb50bfa02389b392bc12a5a;hp=f36c8ce3f40126d10776e696a491b7883700985d;hpb=f22ae0f5f18a354bf3addd8023ad8b8810e42bac;p=profile%2Fivi%2Fqtdeclarative.git diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp index f36c8ce..764ef23 100644 --- a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp +++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp @@ -41,11 +41,9 @@ #include -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); }