aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.cpp')
-rw-r--r--examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.cpp b/examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.cpp
index 16f4bae11b..70338f08a0 100644
--- a/examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.cpp
+++ b/examples/declarative/tutorials/extending/chapter5-listproperties/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
@@ -78,11 +76,11 @@ void PieSlice::setAngleSpan(int angle)
m_angleSpan = angle;
}
-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(), m_fromAngle * 16, m_angleSpan * 16);
}