Remove "All rights reserved" line from license headers.
[profile/ivi/qtdeclarative.git] / examples / declarative / tutorials / extending / chapter3-bindings / piechart.cpp
index 375025e..2a39212 100644 (file)
@@ -1,8 +1,7 @@
 /****************************************************************************
 **
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
 **
 ** This file is part of the documentation of the Qt Toolkit.
 **
 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
 ** $QT_END_LICENSE$
 **
 ****************************************************************************/
 #include "piechart.h"
 #include <QPainter>
-#include <QDebug>
 
-PieChart::PieChart(QDeclarativeItem *parent)
-    : QDeclarativeItem(parent)
+PieChart::PieChart(QQuickItem *parent)
+    : QQuickPaintedItem(parent)
 {
-    // need to disable this flag to draw inside a QDeclarativeItem
-    setFlag(QGraphicsItem::ItemHasNoContents, false);
 }
 
 QString PieChart::name() const
@@ -74,11 +71,11 @@ void PieChart::setColor(const QColor &color)
 }
 //![0]
 
-void PieChart::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+void PieChart::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);
 }