Class QAccelPlot::LegendModel¶
ClassList > QAccelPlot > LegendModel
List model of the legend entries of a list of series. More...
#include <LegendModel.hpp>
Inherits the following classes: QAbstractListModel
Inheritance diagram¶
flowchart TB
classQAccelPlot_1_1LegendModel["QAccelPlot::LegendModel"]
external_base_classQAccelPlot_1_1LegendModel_1["QAbstractListModel"]
external_base_classQAccelPlot_1_1LegendModel_1 --> classQAccelPlot_1_1LegendModel
Public Types¶
| Type | Name |
|---|---|
| enum | Role Data roles; the QML role names are listed in the class description. |
Public Properties¶
| Type | Name |
|---|---|
| property int | count Read-only: number of rows. |
| property QList< PlotSeries * > | series Series to list, in legend order. Default: empty. |
Public Signals¶
| Type | Name |
|---|---|
| signal void | countChanged Emitted when the number of rows changes. |
| signal void | seriesChanged Emitted when the series property changes. |
Public Functions¶
| Type | Name |
|---|---|
| LegendModel (QObject * parent=nullptr) Constructs an empty model with the given parent . |
|
| int | count () const Returns the number of rows. |
| QVariant | data (const QModelIndex & index, int role) override const Returns the value of role for the row at__index . |
| QHash< int, QByteArray > | roleNames () override const Returns the QML role names. |
| int | rowCount (const QModelIndex & parent={}) override const Returns the number of rows; parent must be invalid. |
| QList< PlotSeries * > | series () const Returns the listed series. |
| void | setSeries (const QList< PlotSeries * > & series) Sets the listed series to series . |
Detailed Description¶
Has one row per PlotSeries::legendEntries() entry of each visible series in series: one row for most series, and one per category for a series colored by category. Series without an entry, such as HeatmapSeries, and hidden series have no row. Rows follow changes of the series' entries, names, and visibility.
Roles: series, name (the entry's name, else the series' name, its objectName, or "Series N"), and entry (a LegendEntry). Plot provides one over all its series as legendModel:
QAccelPlot.Plot {
id: plot
legend: QAccelPlot.Legend { model: QAccelPlot.LegendModel { series: [signal, fit] } }
}
See also: LegendEntry, PlotSeries::legendEntries()
Public Types Documentation¶
enum Role¶
Data roles; the QML role names are listed in the class description.
Public Properties Documentation¶
property count¶
Read-only: number of rows.
property series¶
Series to list, in legend order. Default: empty.
Public Signals Documentation¶
signal countChanged¶
Emitted when the number of rows changes.
signal seriesChanged¶
Emitted when the series property changes.
Public Functions Documentation¶
function LegendModel¶
Constructs an empty model with the given parent .
function count¶
Returns the number of rows.
function data¶
Returns the value of role for the row at__index .
function roleNames¶
Returns the QML role names.
function rowCount¶
Returns the number of rows; parent must be invalid.
function series¶
Returns the listed series.
function setSeries¶
Sets the listed series to series .
The documentation for this class was generated from the following file QAccelPlot/src/QAccelPlot/legend/LegendModel.hpp