<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qhpiemodelmapper.cpp --> <title>QHPieModelMapper Class | Qt Charts 5.9</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.9</td><td ><a href="qtcharts-index.html">Qt Charts</a></td><td ><a href="qt-charts-module.html">C++ Classes</a></td><td >QHPieModelMapper</td></tr></table><table class="buildversion"><tr> <td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</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="#signals">Signals</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">QHPieModelMapper Class</h1> <!-- $$$QHPieModelMapper-brief --> <p>The <a href="qhpiemodelmapper.html">QHPieModelMapper</a> is a horizontal model mapper for pie series. <a href="#details">More...</a></p> <!-- @@@QHPieModelMapper --> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QHPieModelMapper></span> </td></tr><tr><td class="memItemLeft rightAlign topAlign"> Instantiated By:</td><td class="memItemRight bottomAlign"> <a href="qml-qtcharts-hpiemodelmapper.html">HPieModelMapper</a></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> QPieModelMapper</td></tr></table></div><ul> <li><a href="qhpiemodelmapper-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="qhpiemodelmapper.html#columnCount-prop">columnCount</a></b> : int</li> <li class="fn"><b><a href="qhpiemodelmapper.html#firstColumn-prop">firstColumn</a></b> : int</li> <li class="fn"><b><a href="qhpiemodelmapper.html#labelsRow-prop">labelsRow</a></b> : int</li> </ul></td><td class="topAlign"><ul> <li class="fn"><b><a href="qhpiemodelmapper.html#model-prop">model</a></b> : QAbstractItemModel *</li> <li class="fn"><b><a href="qhpiemodelmapper.html#series-prop">series</a></b> : QPieSeries *</li> <li class="fn"><b><a href="qhpiemodelmapper.html#valuesRow-prop">valuesRow</a></b> : int</li> </ul> </td></tr> </table></div> <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="qhpiemodelmapper.html#QHPieModelMapper">QHPieModelMapper</a></b>(QObject *<i>parent</i> = Q_NULLPTR)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qhpiemodelmapper.html#columnCount-prop">columnCount</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qhpiemodelmapper.html#firstColumn-prop">firstColumn</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qhpiemodelmapper.html#labelsRow">labelsRow</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QAbstractItemModel *</td><td class="memItemRight bottomAlign"><b><a href="qhpiemodelmapper.html#model-prop">model</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QPieSeries *</td><td class="memItemRight bottomAlign"><b><a href="qhpiemodelmapper.html#series-prop">series</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qhpiemodelmapper.html#columnCount-prop">setColumnCount</a></b>(int <i>columnCount</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qhpiemodelmapper.html#firstColumn-prop">setFirstColumn</a></b>(int <i>firstColumn</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qhpiemodelmapper.html#setLabelsRow">setLabelsRow</a></b>(int <i>labelsRow</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qhpiemodelmapper.html#model-prop">setModel</a></b>(QAbstractItemModel *<i>model</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qhpiemodelmapper.html#series-prop">setSeries</a></b>(QPieSeries *<i>series</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qhpiemodelmapper.html#setValuesRow">setValuesRow</a></b>(int <i>valuesRow</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qhpiemodelmapper.html#valuesRow">valuesRow</a></b>() const</td></tr> </table></div> <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="qhpiemodelmapper.html#columnCountChanged">columnCountChanged</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qhpiemodelmapper.html#firstColumnChanged">firstColumnChanged</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qhpiemodelmapper.html#labelsRowChanged">labelsRowChanged</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qhpiemodelmapper.html#modelReplaced">modelReplaced</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qhpiemodelmapper.html#seriesReplaced">seriesReplaced</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qhpiemodelmapper.html#valuesRowChanged">valuesRowChanged</a></b>()</td></tr> </table></div> <h3>Additional Inherited Members</h3> <ul> <li class="fn">14 protected functions inherited from <a href="qpiemodelmapper.html#protected-functions">QPieModelMapper</a></li> </ul> <a name="details"></a> <!-- $$$QHPieModelMapper-description --> <div class="descr"> <h2 id="details">Detailed Description</h2> <p>The <a href="qhpiemodelmapper.html">QHPieModelMapper</a> is a horizontal model mapper for pie series.</p> <p>Model mappers enable using a data model derived from the QAbstractItemModel class as a data source for a chart. A horizontal model mapper is used to create a connection between a data model and <a href="qpieseries.html">QPieSeries</a>, so that each column in the data model defines a pie slice and each row maps to the label or the value of the pie slice.</p> <p>Both model and pie series properties can be used to manipulate the data. The model mapper keeps the pie series and the data model in sync.</p> </div> <!-- @@@QHPieModelMapper --> <div class="prop"> <h2>Property Documentation</h2> <!-- $$$columnCount-prop$$$columnCount$$$setColumnCountint$$$columnCountChanged --> <h3 class="fn" id="columnCount-prop"><a name="columnCount-prop"></a><span class="name">columnCount</span> : <span class="type">int</span></h3> <p>This property holds the number of columns of the model that are mapped as the data for the pie series.</p> <p>The minimum and default value is -1 (number limited to the number of columns in the model).</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>columnCount</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setColumnCount</b></span>(int <i>columnCount</i>)</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="qhpiemodelmapper.html#columnCountChanged">columnCountChanged</a></b></span>()</td></tr> </table></div> <!-- @@@columnCount --> <!-- $$$firstColumn-prop$$$firstColumn$$$setFirstColumnint$$$firstColumnChanged --> <h3 class="fn" id="firstColumn-prop"><a name="firstColumn-prop"></a><span class="name">firstColumn</span> : <span class="type">int</span></h3> <p>This property holds the column of the model that contains the first slice value.</p> <p>The minimum and default value is 0.</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>firstColumn</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setFirstColumn</b></span>(int <i>firstColumn</i>)</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="qhpiemodelmapper.html#firstColumnChanged">firstColumnChanged</a></b></span>()</td></tr> </table></div> <!-- @@@firstColumn --> <!-- $$$labelsRow-prop$$$labelsRow$$$setLabelsRowint$$$labelsRowChanged --> <h3 class="fn" id="labelsRow-prop"><a name="labelsRow-prop"></a><span class="name">labelsRow</span> : <span class="type">int</span></h3> <p>This property holds the row of the model that is kept in sync with the labels of the pie's slices.</p> <p>The default value is -1 (invalid mapping).</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="qhpiemodelmapper.html#labelsRow">labelsRow</a></b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qhpiemodelmapper.html#setLabelsRow">setLabelsRow</a></b></span>(int <i>labelsRow</i>)</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="qhpiemodelmapper.html#labelsRowChanged">labelsRowChanged</a></b></span>()</td></tr> </table></div> <!-- @@@labelsRow --> <!-- $$$model-prop$$$model$$$setModelQAbstractItemModel*$$$modelReplaced --> <h3 class="fn" id="model-prop"><a name="model-prop"></a><span class="name">model</span> : <span class="type">QAbstractItemModel</span> *</h3> <p>This property holds the model that is used by the mapper.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> QAbstractItemModel *</td><td class="memItemRight bottomAlign"><span class="name"><b>model</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setModel</b></span>(QAbstractItemModel *<i>model</i>)</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="qhpiemodelmapper.html#modelReplaced">modelReplaced</a></b></span>()</td></tr> </table></div> <!-- @@@model --> <!-- $$$series-prop$$$series$$$setSeriesQPieSeries*$$$seriesReplaced --> <h3 class="fn" id="series-prop"><a name="series-prop"></a><span class="name">series</span> : <span class="type"><a href="qpieseries.html">QPieSeries</a></span> *</h3> <p>This property holds the pie series that is used by the mapper.</p> <p>All the data in the series is discarded when it is set to the mapper. When a new series is specified, the old series is disconnected (but it preserves its data).</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> QPieSeries *</td><td class="memItemRight bottomAlign"><span class="name"><b>series</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setSeries</b></span>(QPieSeries *<i>series</i>)</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="qhpiemodelmapper.html#seriesReplaced">seriesReplaced</a></b></span>()</td></tr> </table></div> <!-- @@@series --> <!-- $$$valuesRow-prop$$$valuesRow$$$setValuesRowint$$$valuesRowChanged --> <h3 class="fn" id="valuesRow-prop"><a name="valuesRow-prop"></a><span class="name">valuesRow</span> : <span class="type">int</span></h3> <p>This property holds the row of the model that is kept in sync with the values of the pie's slices.</p> <p>The default value is -1 (invalid mapping).</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="qhpiemodelmapper.html#valuesRow">valuesRow</a></b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qhpiemodelmapper.html#setValuesRow">setValuesRow</a></b></span>(int <i>valuesRow</i>)</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="qhpiemodelmapper.html#valuesRowChanged">valuesRowChanged</a></b></span>()</td></tr> </table></div> <!-- @@@valuesRow --> </div> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QHPieModelMapper[overload1]$$$QHPieModelMapperQObject* --> <h3 class="fn" id="QHPieModelMapper"><a name="QHPieModelMapper"></a>QHPieModelMapper::<span class="name">QHPieModelMapper</span>(<span class="type">QObject</span> *<i>parent</i> = Q_NULLPTR)</h3> <p>Constructs a mapper object that is a child of <i>parent</i>.</p> <!-- @@@QHPieModelMapper --> <!-- $$$columnCountChanged --> <h3 class="fn" id="columnCountChanged"><a name="columnCountChanged"></a><code>[signal] </code><span class="type">void</span> QHPieModelMapper::<span class="name">columnCountChanged</span>()</h3> <p>This signal is emitted when the number of columns changes.</p> <p><b>Note:</b> Notifier signal for property <a href="qhpiemodelmapper.html#columnCount-prop">columnCount</a>. </p><!-- @@@columnCountChanged --> <!-- $$$firstColumnChanged --> <h3 class="fn" id="firstColumnChanged"><a name="firstColumnChanged"></a><code>[signal] </code><span class="type">void</span> QHPieModelMapper::<span class="name">firstColumnChanged</span>()</h3> <p>This signal is emitted when the first column changes.</p> <p><b>Note:</b> Notifier signal for property <a href="qhpiemodelmapper.html#firstColumn-prop">firstColumn</a>. </p><!-- @@@firstColumnChanged --> <!-- $$$labelsRow --> <h3 class="fn" id="labelsRow"><a name="labelsRow"></a><span class="type">int</span> QHPieModelMapper::<span class="name">labelsRow</span>() const</h3> <p>Returns the row of the model that is kept in sync with the labels of the pie's slices.</p> <p><b>Note:</b> Getter function for property <a href="qhpiemodelmapper.html#labelsRow-prop">labelsRow</a>. </p><p><b>See also </b><a href="qhpiemodelmapper.html#setLabelsRow">setLabelsRow</a>().</p> <!-- @@@labelsRow --> <!-- $$$labelsRowChanged --> <h3 class="fn" id="labelsRowChanged"><a name="labelsRowChanged"></a><code>[signal] </code><span class="type">void</span> QHPieModelMapper::<span class="name">labelsRowChanged</span>()</h3> <p>This signal is emitted when the labels row changes.</p> <p><b>Note:</b> Notifier signal for property <a href="qhpiemodelmapper.html#labelsRow-prop">labelsRow</a>. </p><!-- @@@labelsRowChanged --> <!-- $$$modelReplaced --> <h3 class="fn" id="modelReplaced"><a name="modelReplaced"></a><code>[signal] </code><span class="type">void</span> QHPieModelMapper::<span class="name">modelReplaced</span>()</h3> <p>This signal is emitted when the model that the mapper is connected to changes.</p> <p><b>Note:</b> Notifier signal for property <a href="qhpiemodelmapper.html#model-prop">model</a>. </p><!-- @@@modelReplaced --> <!-- $$$seriesReplaced --> <h3 class="fn" id="seriesReplaced"><a name="seriesReplaced"></a><code>[signal] </code><span class="type">void</span> QHPieModelMapper::<span class="name">seriesReplaced</span>()</h3> <p>This signal is emitted when the series that the mapper is connected to changes.</p> <p><b>Note:</b> Notifier signal for property <a href="qhpiemodelmapper.html#series-prop">series</a>. </p><!-- @@@seriesReplaced --> <!-- $$$setLabelsRow --> <h3 class="fn" id="setLabelsRow"><a name="setLabelsRow"></a><span class="type">void</span> QHPieModelMapper::<span class="name">setLabelsRow</span>(<span class="type">int</span> <i>labelsRow</i>)</h3> <p>Sets the model row that is kept in sync with the pie slices' labels to <i>labelsRow</i>.</p> <p><b>Note:</b> Setter function for property <a href="qhpiemodelmapper.html#labelsRow-prop">labelsRow</a>. </p><p><b>See also </b><a href="qhpiemodelmapper.html#labelsRow">labelsRow</a>().</p> <!-- @@@setLabelsRow --> <!-- $$$setValuesRow --> <h3 class="fn" id="setValuesRow"><a name="setValuesRow"></a><span class="type">void</span> QHPieModelMapper::<span class="name">setValuesRow</span>(<span class="type">int</span> <i>valuesRow</i>)</h3> <p>Sets the model row that is kept in sync with the pie slices' values to <i>valuesRow</i>.</p> <p><b>Note:</b> Setter function for property <a href="qhpiemodelmapper.html#valuesRow-prop">valuesRow</a>. </p><p><b>See also </b><a href="qhpiemodelmapper.html#valuesRow">valuesRow</a>().</p> <!-- @@@setValuesRow --> <!-- $$$valuesRow --> <h3 class="fn" id="valuesRow"><a name="valuesRow"></a><span class="type">int</span> QHPieModelMapper::<span class="name">valuesRow</span>() const</h3> <p>Returns the row of the model that is kept in sync with the values of the pie's slices.</p> <p><b>Note:</b> Getter function for property <a href="qhpiemodelmapper.html#valuesRow-prop">valuesRow</a>. </p><p><b>See also </b><a href="qhpiemodelmapper.html#setValuesRow">setValuesRow</a>().</p> <!-- @@@valuesRow --> <!-- $$$valuesRowChanged --> <h3 class="fn" id="valuesRowChanged"><a name="valuesRowChanged"></a><code>[signal] </code><span class="type">void</span> QHPieModelMapper::<span class="name">valuesRowChanged</span>()</h3> <p>This signal is emitted when the values row changes.</p> <p><b>Note:</b> Notifier signal for property <a href="qhpiemodelmapper.html#valuesRow-prop">valuesRow</a>. </p><!-- @@@valuesRowChanged --> </div> </div> </div> </div> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2017 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>