<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qpieseries.cpp --> <title>QPieSeries Class | Qt Charts 5.12.6</title> <link rel="stylesheet" type="text/css" href="style/offline-simple.css" /> <script type="text/javascript"> document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css"); // loading style sheet breaks anchors that were jumped to before // so force jumping to anchor again setTimeout(function() { var anchor = location.hash; // need to jump to different anchor first (e.g. none) location.hash = "#"; setTimeout(function() { location.hash = anchor; }, 0); }, 0); </script> </head> <body> <div class="header" id="qtdocheader"> <div class="main"> <div class="main-rounded"> <div class="navigationbar"> <table><tr> <td >Qt 5.12</td><td ><a href="qtcharts-index.html">Qt Charts</a></td><td ><a href="qtcharts-module.html">C++ Classes</a></td><td >QPieSeries</td></tr></table><table class="buildversion"><tr> <td id="buildversion" width="100%" align="right"><a href="qtcharts-index.html">Qt Charts | Commercial or GPLv3</a></td> </tr></table> </div> </div> <div class="content"> <div class="line"> <div class="content mainContent"> <div class="sidebar"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#properties">Properties</a></li> <li class="level1"><a href="#public-functions">Public Functions</a></li> <li class="level1"><a href="#reimplemented-public-functions">Reimplemented Public Functions</a></li> <li class="level1"><a href="#signals">Signals</a></li> <li class="level1"><a href="#static-public-members">Static Public Members</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">QPieSeries Class</h1> <!-- $$$QPieSeries-brief --> <p>The <a href="qpieseries.html">QPieSeries</a> class presents data in pie charts. <a href="#details">More...</a></p> <!-- @@@QPieSeries --> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QPieSeries></span> </td></tr><tr><td class="memItemLeft rightAlign topAlign"> Instantiated By:</td><td class="memItemRight bottomAlign"> <a href="qml-qtcharts-pieseries.html">PieSeries</a></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qabstractseries.html">QAbstractSeries</a></td></tr></table></div><ul> <li><a href="qpieseries-members.html">List of all members, including inherited members</a></li> </ul> <a name="properties"></a> <h2 id="properties">Properties</h2> <div class="table"><table class="propsummary"> <tr><td class="topAlign"><ul> <li class="fn"><b><a href="qpieseries.html#count-prop">count</a></b> : const int</li> <li class="fn"><b><a href="qpieseries.html#endAngle-prop">endAngle</a></b> : qreal</li> <li class="fn"><b><a href="qpieseries.html#holeSize-prop">holeSize</a></b> : qreal</li> <li class="fn"><b><a href="qpieseries.html#horizontalPosition-prop">horizontalPosition</a></b> : qreal</li> </ul></td><td class="topAlign"><ul> <li class="fn"><b><a href="qpieseries.html#size-prop">size</a></b> : qreal</li> <li class="fn"><b><a href="qpieseries.html#startAngle-prop">startAngle</a></b> : qreal</li> <li class="fn"><b><a href="qpieseries.html#sum-prop">sum</a></b> : const qreal</li> <li class="fn"><b><a href="qpieseries.html#verticalPosition-prop">verticalPosition</a></b> : qreal</li> </ul> </td></tr> </table></div> <ul> <li class="fn">5 properties inherited from <a href="qabstractseries.html#properties">QAbstractSeries</a></li> </ul> <a name="public-functions"></a> <h2 id="public-functions">Public Functions</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#QPieSeries">QPieSeries</a></b>(QObject *<i>parent</i> = nullptr)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#dtor.QPieSeries">~QPieSeries</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#append">append</a></b>(QPieSlice *<i>slice</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#append-1">append</a></b>(QList<QPieSlice *> <i>slices</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QPieSlice *</td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#append-2">append</a></b>(QString <i>label</i>, qreal <i>value</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#clear">clear</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#count">count</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#holeSize-prop">holeSize</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#horizontalPosition-prop">horizontalPosition</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#insert">insert</a></b>(int <i>index</i>, QPieSlice *<i>slice</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#isEmpty">isEmpty</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#pieEndAngle">pieEndAngle</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#size-prop">pieSize</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#startAngle-prop">pieStartAngle</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#remove">remove</a></b>(QPieSlice *<i>slice</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#holeSize-prop">setHoleSize</a></b>(qreal <i>holeSize</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#horizontalPosition-prop">setHorizontalPosition</a></b>(qreal <i>relativePosition</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#setLabelsPosition">setLabelsPosition</a></b>(QPieSlice::LabelPosition <i>position</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#setLabelsVisible">setLabelsVisible</a></b>(bool <i>visible</i> = true)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#setPieEndAngle">setPieEndAngle</a></b>(qreal <i>angle</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#size-prop">setPieSize</a></b>(qreal <i>relativeSize</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#startAngle-prop">setPieStartAngle</a></b>(qreal <i>startAngle</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#verticalPosition-prop">setVerticalPosition</a></b>(qreal <i>relativePosition</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QList<QPieSlice *> </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#slices">slices</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#sum">sum</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#take">take</a></b>(QPieSlice *<i>slice</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#verticalPosition-prop">verticalPosition</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QPieSeries &</td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#operator-lt-lt">operator<<</a></b>(QPieSlice *<i>slice</i>)</td></tr> </table></div> <a name="reimplemented-public-functions"></a> <h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> virtual QAbstractSeries::SeriesType </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#type">type</a></b>() const</td></tr> </table></div> <ul> <li class="fn">15 public functions inherited from <a href="qabstractseries.html#public-functions">QAbstractSeries</a></li> </ul> <a name="signals"></a> <h2 id="signals">Signals</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#added">added</a></b>(QList<QPieSlice *> <i>slices</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#clicked">clicked</a></b>(QPieSlice *<i>slice</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#countChanged">countChanged</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#doubleClicked">doubleClicked</a></b>(QPieSlice *<i>slice</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#hovered">hovered</a></b>(QPieSlice *<i>slice</i>, bool <i>state</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#pressed">pressed</a></b>(QPieSlice *<i>slice</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#released">released</a></b>(QPieSlice *<i>slice</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#removed">removed</a></b>(QList<QPieSlice *> <i>slices</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#sumChanged">sumChanged</a></b>()</td></tr> </table></div> <ul> <li class="fn">4 signals inherited from <a href="qabstractseries.html#signals">QAbstractSeries</a></li> </ul> <a name="static-public-members"></a> <h2 id="static-public-members">Static Public Members</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> const QMetaObject </td><td class="memItemRight bottomAlign"><b><a href="qpieseries.html#staticMetaObject-var">staticMetaObject</a></b></td></tr> </table></div> <a name="details"></a> <!-- $$$QPieSeries-description --> <div class="descr"> <h2 id="details">Detailed Description</h2> <p>The <a href="qpieseries.html">QPieSeries</a> class presents data in pie charts.</p> <p>A pie series consists of slices that are defined as <a href="qpieslice.html">QPieSlice</a> objects. The slices can have any values as the <a href="qpieseries.html">QPieSeries</a> object calculates the percentage of a slice compared with the sum of all slices in the series to determine the actual size of the slice in the chart.</p> <p>Pie size and position on the chart are controlled by using relative values that range from 0.0 to 1.0. These relate to the actual chart rectangle.</p> <p>By default, the pie is defined as a full pie. A partial pie can be created by setting a starting angle and angle span for the series. A full pie is 360 degrees, where 0 is at 12 a'clock.</p> <p>See the <a href="qtcharts-piechart-example.html">pie chart example</a> or <a href="qtcharts-donutchart-example.html">donut chart example</a> to learn how to use <a href="qpieseries.html">QPieSeries</a>.</p> <p class="centerAlign"><img src="images/examples_piechart.png" alt="" /></p><p class="centerAlign"><img src="images/examples_donutchart.png" alt="" /></p></div> <p><b>See also </b><a href="qpieslice.html">QPieSlice</a> and <a href="qchart.html">QChart</a>.</p> <!-- @@@QPieSeries --> <div class="prop"> <h2>Property Documentation</h2> <!-- $$$count-prop$$$count$$$countChanged --> <h3 class="fn" id="count-prop"><a name="count-prop"></a><span class="name">count</span> : const <span class="type">int</span></h3> <p>This property holds the number of slices in the series.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qpieseries.html#count">count</a></b></span>() const</td></tr> </table></div> <p><b>Notifier signal:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qpieseries.html#countChanged">countChanged</a></b></span>()</td></tr> </table></div> <!-- @@@count --> <!-- $$$endAngle-prop$$$pieEndAngle$$$setPieEndAngleqreal --> <h3 class="fn" id="endAngle-prop"><a name="endAngle-prop"></a><span class="name">endAngle</span> : <span class="type">qreal</span></h3> <p>This property holds the ending angle of the pie.</p> <p>A full pie is 360 degrees, where 0 degrees is at 12 a'clock.</p> <p>The default value is 360.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qpieseries.html#pieEndAngle">pieEndAngle</a></b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qpieseries.html#setPieEndAngle">setPieEndAngle</a></b></span>(qreal <i>angle</i>)</td></tr> </table></div> <!-- @@@endAngle --> <!-- $$$holeSize-prop$$$holeSize$$$setHoleSizeqreal --> <h3 class="fn" id="holeSize-prop"><a name="holeSize-prop"></a><span class="name">holeSize</span> : <span class="type">qreal</span></h3> <p>This property holds the donut hole size.</p> <p>The value is relative to the chart rectangle, so that:</p> <ul> <li>0.0 is the minimum size (full pie drawn without a hole).</li> <li>1.0 is the maximum size that can fit the chart (the donut has no width).</li> </ul> <p>When setting this property, the <a href="qpieseries.html#size-prop">size</a> property is adjusted if necessary, to ensure that the hole size is not greater than the pie size.</p> <p>The default value is 0.0.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><span class="name"><b>holeSize</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setHoleSize</b></span>(qreal <i>holeSize</i>)</td></tr> </table></div> <!-- @@@holeSize --> <!-- $$$horizontalPosition-prop$$$horizontalPosition$$$setHorizontalPositionqreal --> <h3 class="fn" id="horizontalPosition-prop"><a name="horizontalPosition-prop"></a><span class="name">horizontalPosition</span> : <span class="type">qreal</span></h3> <p>This property holds the horizontal position of the pie.</p> <p>The value is relative to the chart rectangle, so that:</p> <ul> <li>0.0 is the absolute left.</li> <li>1.0 is the absolute right.</li> </ul> <p>The default value is 0.5 (center).</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><span class="name"><b>horizontalPosition</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setHorizontalPosition</b></span>(qreal <i>relativePosition</i>)</td></tr> </table></div> <p><b>See also </b><a href="qpieseries.html#verticalPosition-prop">verticalPosition</a>.</p> <!-- @@@horizontalPosition --> <!-- $$$size-prop$$$pieSize$$$setPieSizeqreal --> <h3 class="fn" id="size-prop"><a name="size-prop"></a><span class="name">size</span> : <span class="type">qreal</span></h3> <p>This property holds the pie size.</p> <p>The value is relative to the chart rectangle, so that:</p> <ul> <li>0.0 is the minimum size (pie not drawn).</li> <li>1.0 is the maximum size that can fit the chart.</li> </ul> <p>When setting this property, the <a href="qpieseries.html#holeSize-prop">holeSize</a> property is adjusted if necessary, to ensure that the hole size is not greater than the pie size.</p> <p>The default value is 0.7.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><span class="name"><b>pieSize</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setPieSize</b></span>(qreal <i>relativeSize</i>)</td></tr> </table></div> <!-- @@@size --> <!-- $$$startAngle-prop$$$pieStartAngle$$$setPieStartAngleqreal --> <h3 class="fn" id="startAngle-prop"><a name="startAngle-prop"></a><span class="name">startAngle</span> : <span class="type">qreal</span></h3> <p>This property holds the starting angle of the pie.</p> <p>A full pie is 360 degrees, where 0 degrees is at 12 a'clock.</p> <p>The default value is 0.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><span class="name"><b>pieStartAngle</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setPieStartAngle</b></span>(qreal <i>startAngle</i>)</td></tr> </table></div> <!-- @@@startAngle --> <!-- $$$sum-prop$$$sum$$$sumChanged --> <h3 class="fn" id="sum-prop"><a name="sum-prop"></a><span class="name">sum</span> : const <span class="type">qreal</span></h3> <p>This property holds the sum of all slices.</p> <p>The series keeps track of the sum of all the slices it holds.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qpieseries.html#sum">sum</a></b></span>() const</td></tr> </table></div> <p><b>Notifier signal:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qpieseries.html#sumChanged">sumChanged</a></b></span>()</td></tr> </table></div> <!-- @@@sum --> <!-- $$$verticalPosition-prop$$$verticalPosition$$$setVerticalPositionqreal --> <h3 class="fn" id="verticalPosition-prop"><a name="verticalPosition-prop"></a><span class="name">verticalPosition</span> : <span class="type">qreal</span></h3> <p>This property holds the vertical position of the pie.</p> <p>The value is relative to the chart rectangle, so that:</p> <ul> <li>0.0 is the absolute top.</li> <li>1.0 is the absolute bottom.</li> </ul> <p>The default value is 0.5 (center).</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><span class="name"><b>verticalPosition</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setVerticalPosition</b></span>(qreal <i>relativePosition</i>)</td></tr> </table></div> <p><b>See also </b><a href="qpieseries.html#horizontalPosition-prop">horizontalPosition</a>.</p> <!-- @@@verticalPosition --> </div> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QPieSeries[overload1]$$$QPieSeriesQObject* --> <h3 class="fn" id="QPieSeries"><a name="QPieSeries"></a>QPieSeries::<span class="name">QPieSeries</span>(<span class="type">QObject</span> *<i>parent</i> = nullptr)</h3> <p>Constructs a series object that is a child of <i>parent</i>.</p> <!-- @@@QPieSeries --> <!-- $$$~QPieSeries[overload1]$$$~QPieSeries --> <h3 class="fn" id="dtor.QPieSeries"><a name="dtor.QPieSeries"></a><code>[virtual] </code>QPieSeries::<span class="name">~QPieSeries</span>()</h3> <p>Removes the pie series and its slices.</p> <!-- @@@~QPieSeries --> <!-- $$$added[overload1]$$$addedQList<QPieSlice*> --> <h3 class="fn" id="added"><a name="added"></a><code>[signal] </code><span class="type">void</span> QPieSeries::<span class="name">added</span>(<span class="type">QList</span><<span class="type"><a href="qpieslice.html">QPieSlice</a></span> *> <i>slices</i>)</h3> <p>This signal is emitted when the slices specified by <i>slices</i> are added to the series.</p> <p><b>See also </b><a href="qpieseries.html#append">append</a>() and <a href="qpieseries.html#insert">insert</a>().</p> <!-- @@@added --> <!-- $$$append[overload1]$$$appendQPieSlice* --> <h3 class="fn" id="append"><a name="append"></a><span class="type">bool</span> QPieSeries::<span class="name">append</span>(<span class="type"><a href="qpieslice.html">QPieSlice</a></span> *<i>slice</i>)</h3> <p>Appends the slice specified by <i>slice</i> to the series. Slice ownership is passed to the series.</p> <p>Returns <code>true</code> if appending succeeds.</p> <!-- @@@append --> <!-- $$$append$$$appendQList<QPieSlice*> --> <h3 class="fn" id="append-1"><a name="append-1"></a><span class="type">bool</span> QPieSeries::<span class="name">append</span>(<span class="type">QList</span><<span class="type"><a href="qpieslice.html">QPieSlice</a></span> *> <i>slices</i>)</h3> <p>Appends the array of slices specified by <i>slices</i> to the series. Slice ownership is passed to the series.</p> <p>Returns <code>true</code> if appending succeeds.</p> <!-- @@@append --> <!-- $$$append$$$appendQStringqreal --> <h3 class="fn" id="append-2"><a name="append-2"></a><span class="type"><a href="qpieslice.html">QPieSlice</a></span> *QPieSeries::<span class="name">append</span>(<span class="type">QString</span> <i>label</i>, <span class="type">qreal</span> <i>value</i>)</h3> <p>Appends a single slice with the specified <i>value</i> and <i>label</i> to the series. Slice ownership is passed to the series. Returns null if <i>value</i> is <code>NaN</code>, <code>Inf</code>, or <code>-Inf</code> and adds nothing to the series.</p> <!-- @@@append --> <!-- $$$clear[overload1]$$$clear --> <h3 class="fn" id="clear"><a name="clear"></a><span class="type">void</span> QPieSeries::<span class="name">clear</span>()</h3> <p>Clears all slices from the series.</p> <!-- @@@clear --> <!-- $$$clicked[overload1]$$$clickedQPieSlice* --> <h3 class="fn" id="clicked"><a name="clicked"></a><code>[signal] </code><span class="type">void</span> QPieSeries::<span class="name">clicked</span>(<span class="type"><a href="qpieslice.html">QPieSlice</a></span> *<i>slice</i>)</h3> <p>This signal is emitted when the slice specified by <i>slice</i> is clicked.</p> <p><b>See also </b><a href="qpieslice.html#clicked">QPieSlice::clicked</a>().</p> <!-- @@@clicked --> <!-- $$$count --> <h3 class="fn" id="count"><a name="count"></a><span class="type">int</span> QPieSeries::<span class="name">count</span>() const</h3> <p>Returns the number of the slices in this series.</p> <p><b>Note:</b> Getter function for property <a href="qpieseries.html#count-prop">count</a>. </p><!-- @@@count --> <!-- $$$countChanged --> <h3 class="fn" id="countChanged"><a name="countChanged"></a><code>[signal] </code><span class="type">void</span> QPieSeries::<span class="name">countChanged</span>()</h3> <p>This signal is emitted when the slice count changes.</p> <p><b>Note:</b> Notifier signal for property <a href="qpieseries.html#count-prop">count</a>. </p><p><b>See also </b><a href="qpieseries.html#count-prop">count</a>.</p> <!-- @@@countChanged --> <!-- $$$doubleClicked[overload1]$$$doubleClickedQPieSlice* --> <h3 class="fn" id="doubleClicked"><a name="doubleClicked"></a><code>[signal] </code><span class="type">void</span> QPieSeries::<span class="name">doubleClicked</span>(<span class="type"><a href="qpieslice.html">QPieSlice</a></span> *<i>slice</i>)</h3> <p>This signal is emitted when the slice specified by <i>slice</i> is double-clicked.</p> <p><b>See also </b><a href="qpieslice.html#doubleClicked">QPieSlice::doubleClicked</a>().</p> <!-- @@@doubleClicked --> <!-- $$$hovered[overload1]$$$hoveredQPieSlice*bool --> <h3 class="fn" id="hovered"><a name="hovered"></a><code>[signal] </code><span class="type">void</span> QPieSeries::<span class="name">hovered</span>(<span class="type"><a href="qpieslice.html">QPieSlice</a></span> *<i>slice</i>, <span class="type">bool</span> <i>state</i>)</h3> <p>This signal is emitted when a mouse is hovered over the slice specified by <i>slice</i>. When the mouse moves over the slice, <i>state</i> turns <code>true</code>, and when the mouse moves away again, it turns <code>false</code>.</p> <p><b>See also </b><a href="qpieslice.html#hovered">QPieSlice::hovered</a>().</p> <!-- @@@hovered --> <!-- $$$insert[overload1]$$$insertintQPieSlice* --> <h3 class="fn" id="insert"><a name="insert"></a><span class="type">bool</span> QPieSeries::<span class="name">insert</span>(<span class="type">int</span> <i>index</i>, <span class="type"><a href="qpieslice.html">QPieSlice</a></span> *<i>slice</i>)</h3> <p>Inserts the slice specified by <i>slice</i> to the series before the slice at the position specified by <i>index</i>. Slice ownership is passed to the series.</p> <p>Returns <code>true</code> if inserting succeeds.</p> <!-- @@@insert --> <!-- $$$isEmpty[overload1]$$$isEmpty --> <h3 class="fn" id="isEmpty"><a name="isEmpty"></a><span class="type">bool</span> QPieSeries::<span class="name">isEmpty</span>() const</h3> <p>Returns <code>true</code> if the series is empty.</p> <!-- @@@isEmpty --> <!-- $$$pieEndAngle --> <h3 class="fn" id="pieEndAngle"><a name="pieEndAngle"></a><span class="type">qreal</span> QPieSeries::<span class="name">pieEndAngle</span>() const</h3> <p>Returns the end angle of the pie.</p> <p>A full pie is 360 degrees, where 0 degrees is at 12 a'clock.</p> <p><b>Note:</b> Getter function for property <a href="qpieseries.html#endAngle-prop">endAngle</a>. </p><p><b>See also </b><a href="qpieseries.html#setPieEndAngle">setPieEndAngle</a>(), <a href="qpieseries.html#startAngle-prop">pieStartAngle</a>(), and <a href="qpieseries.html#startAngle-prop">setPieStartAngle</a>().</p> <!-- @@@pieEndAngle --> <!-- $$$pressed[overload1]$$$pressedQPieSlice* --> <h3 class="fn" id="pressed"><a name="pressed"></a><code>[signal] </code><span class="type">void</span> QPieSeries::<span class="name">pressed</span>(<span class="type"><a href="qpieslice.html">QPieSlice</a></span> *<i>slice</i>)</h3> <p>This signal is emitted when the user clicks the slice specified by <i>slice</i> and holds down the mouse button.</p> <p><b>See also </b><a href="qpieslice.html#pressed">QPieSlice::pressed</a>().</p> <!-- @@@pressed --> <!-- $$$released[overload1]$$$releasedQPieSlice* --> <h3 class="fn" id="released"><a name="released"></a><code>[signal] </code><span class="type">void</span> QPieSeries::<span class="name">released</span>(<span class="type"><a href="qpieslice.html">QPieSlice</a></span> *<i>slice</i>)</h3> <p>This signal is emitted when the user releases the mouse press on the slice specified by <i>slice</i>.</p> <p><b>See also </b><a href="qpieslice.html#released">QPieSlice::released</a>().</p> <!-- @@@released --> <!-- $$$remove[overload1]$$$removeQPieSlice* --> <h3 class="fn" id="remove"><a name="remove"></a><span class="type">bool</span> QPieSeries::<span class="name">remove</span>(<span class="type"><a href="qpieslice.html">QPieSlice</a></span> *<i>slice</i>)</h3> <p>Removes a single slice, specified by <i>slice</i>, from the series and deletes it permanently.</p> <p>The pointer cannot be referenced after this call.</p> <p>Returns <code>true</code> if the removal succeeds.</p> <!-- @@@remove --> <!-- $$$removed[overload1]$$$removedQList<QPieSlice*> --> <h3 class="fn" id="removed"><a name="removed"></a><code>[signal] </code><span class="type">void</span> QPieSeries::<span class="name">removed</span>(<span class="type">QList</span><<span class="type"><a href="qpieslice.html">QPieSlice</a></span> *> <i>slices</i>)</h3> <p>This signal is emitted when the slices specified by <i>slices</i> are removed from the series.</p> <p><b>See also </b><a href="qpieseries.html#remove">remove</a>().</p> <!-- @@@removed --> <!-- $$$setLabelsPosition[overload1]$$$setLabelsPositionQPieSlice::LabelPosition --> <h3 class="fn" id="setLabelsPosition"><a name="setLabelsPosition"></a><span class="type">void</span> QPieSeries::<span class="name">setLabelsPosition</span>(<span class="type"><a href="qpieslice.html#LabelPosition-enum">QPieSlice::LabelPosition</a></span> <i>position</i>)</h3> <p>Sets the position of all the slice labels to <i>position</i>.</p> <p><b>Note: </b>This function affects only the current slices in the series. If a new slice is added, the default label position is <a href="qpieslice.html#LabelPosition-enum">QPieSlice::LabelOutside</a>.</p><p><b>See also </b><a href="qpieslice.html#labelPosition-prop">QPieSlice::labelPosition</a>() and <a href="qpieslice.html#labelPosition-prop">QPieSlice::setLabelPosition</a>().</p> <!-- @@@setLabelsPosition --> <!-- $$$setLabelsVisible[overload1]$$$setLabelsVisiblebool --> <h3 class="fn" id="setLabelsVisible"><a name="setLabelsVisible"></a><span class="type">void</span> QPieSeries::<span class="name">setLabelsVisible</span>(<span class="type">bool</span> <i>visible</i> = true)</h3> <p>Sets the visibility of all slice labels to <i>visible</i>.</p> <p><b>Note: </b>This function affects only the current slices in the series. If a new slice is added, the default label visibility is <code>false</code>.</p><p><b>See also </b><a href="qpieslice.html#labelVisible-prop">QPieSlice::isLabelVisible</a>() and <a href="qpieslice.html#labelVisible-prop">QPieSlice::setLabelVisible</a>().</p> <!-- @@@setLabelsVisible --> <!-- $$$setPieEndAngle --> <h3 class="fn" id="setPieEndAngle"><a name="setPieEndAngle"></a><span class="type">void</span> QPieSeries::<span class="name">setPieEndAngle</span>(<span class="type">qreal</span> <i>angle</i>)</h3> <p>Sets the end angle of the pie.</p> <p>A full pie is 360 degrees, where 0 degrees is at 12 a'clock.</p> <p><i>angle</i> must be greater than the start angle.</p> <p><b>Note:</b> Setter function for property <a href="qpieseries.html#endAngle-prop">endAngle</a>. </p><p><b>See also </b><a href="qpieseries.html#pieEndAngle">pieEndAngle</a>(), <a href="qpieseries.html#startAngle-prop">pieStartAngle</a>(), and <a href="qpieseries.html#startAngle-prop">setPieStartAngle</a>().</p> <!-- @@@setPieEndAngle --> <!-- $$$slices[overload1]$$$slices --> <h3 class="fn" id="slices"><a name="slices"></a><span class="type">QList</span><<span class="type"><a href="qpieslice.html">QPieSlice</a></span> *> QPieSeries::<span class="name">slices</span>() const</h3> <p>Returns a list of slices that belong to this series.</p> <!-- @@@slices --> <!-- $$$sum --> <h3 class="fn" id="sum"><a name="sum"></a><span class="type">qreal</span> QPieSeries::<span class="name">sum</span>() const</h3> <p>Returns the sum of all slice values in this series.</p> <p><b>Note:</b> Getter function for property <a href="qpieseries.html#sum-prop">sum</a>. </p><p><b>See also </b><a href="qpieslice.html#value-prop">QPieSlice::value</a>(), <a href="qpieslice.html#value-prop">QPieSlice::setValue</a>(), and <a href="qpieslice.html#percentage-prop">QPieSlice::percentage</a>().</p> <!-- @@@sum --> <!-- $$$sumChanged --> <h3 class="fn" id="sumChanged"><a name="sumChanged"></a><code>[signal] </code><span class="type">void</span> QPieSeries::<span class="name">sumChanged</span>()</h3> <p>This signal is emitted when the sum of all slices changes.</p> <p><b>Note:</b> Notifier signal for property <a href="qpieseries.html#sum-prop">sum</a>. </p><p><b>See also </b><a href="qpieseries.html#sum-prop">sum</a>.</p> <!-- @@@sumChanged --> <!-- $$$take[overload1]$$$takeQPieSlice* --> <h3 class="fn" id="take"><a name="take"></a><span class="type">bool</span> QPieSeries::<span class="name">take</span>(<span class="type"><a href="qpieslice.html">QPieSlice</a></span> *<i>slice</i>)</h3> <p>Takes a single slice, specified by <i>slice</i>, from the series. Does not delete the slice object.</p> <p><b>Note: </b>The series remains the slice's parent object. You must set the parent object to take full ownership.</p><p>Returns <code>true</code> if the take operation was successful.</p> <!-- @@@take --> <!-- $$$type[overload1]$$$type --> <h3 class="fn" id="type"><a name="type"></a><code>[virtual] </code><span class="type"><a href="qabstractseries.html#SeriesType-enum">QAbstractSeries::SeriesType</a></span> QPieSeries::<span class="name">type</span>() const</h3> <p>Reimplemented from <a href="qabstractseries.html#type-prop">QAbstractSeries::type</a>().</p> <p>Returns the type of the series.</p> <!-- @@@type --> <!-- $$$operator<<[overload1]$$$operator<<QPieSlice* --> <h3 class="fn" id="operator-lt-lt"><a name="operator-lt-lt"></a><span class="type"><a href="qpieseries.html#QPieSeries">QPieSeries</a></span> &QPieSeries::<span class="name">operator<<</span>(<span class="type"><a href="qpieslice.html">QPieSlice</a></span> *<i>slice</i>)</h3> <p>Appends the slice specified by <i>slice</i> to the series and returns a reference to the series. Slice ownership is passed to the series.</p> <!-- @@@operator<< --> </div> </div> </div> </div> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2019 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.<br/> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br/> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. </p> </div> </body> </html>