kplato
KPlato::AbstractChartModel Class Reference
The AbstractChartModel class provides the abstract interface for chart model classes. More...
#include <kptabstractchartmodel.h>

Public Types | |
| enum | AxisType { Axis_None = 0, Axis_X, Axis_Y } |
| enum | DataRole { AxisPositionRole = Qt::UserRole+1, AxisMinRole, AxisMaxRole, AxisTypeRole, AxisDataTypeRole, AxisStartDateRole, DataLabelRole } |
Signals | |
| void | axisSetChanged (const ChartAxisIndex &index) |
| void | dataSetChanged (const ChartDataIndex &index) |
| void | reset () |
Public Member Functions | |
| AbstractChartModel (QObject *parent=0) | |
| virtual | ~AbstractChartModel () |
| virtual int | axisCount (const ChartAxisIndex &parent=ChartAxisIndex()) const =0 |
| virtual QVariant | axisData (const ChartAxisIndex &index, int role=Qt::DisplayRole) const =0 |
| virtual ChartAxisIndex | axisIndex (int axisset, const ChartAxisIndex &parent=ChartAxisIndex()) const =0 |
| virtual int | childCount (const ChartDataIndex &parent) const |
| virtual QVariant | data (const ChartDataIndex &index, const ChartAxisIndex &axis, int role=Qt::DisplayRole) const =0 |
| virtual QVariant | data (const ChartDataIndex &index, int role=Qt::DisplayRole) const =0 |
| virtual int | dataSetCount (const ChartAxisIndex &index) const =0 |
| virtual bool | hasAxisChildren (const ChartAxisIndex &parent=ChartAxisIndex()) const |
| virtual bool | hasChildren (const ChartDataIndex &parent) const |
| virtual ChartDataIndex | index (int dataset, const ChartDataIndex &parent) const |
| virtual ChartDataIndex | index (int dataset, const ChartAxisIndex &index) const =0 |
| virtual ChartAxisIndex | parent (const ChartAxisIndex &index) const |
Protected Member Functions | |
| ChartAxisIndex | createAxisIndex (int number, const ChartAxisIndex &parent, int userdata=0, int parentId=-1) const |
| ChartDataIndex | createDataIndex (int number, const ChartDataIndex &parent, int userdata=0) const |
| ChartDataIndex | createDataIndex (int number, const ChartAxisIndex &axisIndex, int userdata=0) const |
Detailed Description
The AbstractChartModel class provides the abstract interface for chart model classes.
When subclassing AbstractChartModel, at the very least you must implement index(), childCount(), data(), axisCount(), axisData() and axisIndex().
ChartAxisIndex !- ChartDataIndex !- ChartDataIndex ! ChartAxisIndex !
Definition at line 113 of file kptabstractchartmodel.h.
Member Enumeration Documentation
Defines the axis' position.
Definition at line 134 of file kptabstractchartmodel.h.
Data axcess roles. Extends Qt::ItemDataRole.
- Enumerator:
AxisPositionRole AxisMinRole AxisMaxRole AxisTypeRole AxisDataTypeRole AxisStartDateRole DataLabelRole
Definition at line 123 of file kptabstractchartmodel.h.
Constructor & Destructor Documentation
| KPlato::AbstractChartModel::AbstractChartModel | ( | QObject * | parent = 0 |
) |
Create a model with parent.
Definition at line 95 of file kptabstractchartmodel.cpp.
| KPlato::AbstractChartModel::~AbstractChartModel | ( | ) | [virtual] |
Destructor.
Definition at line 100 of file kptabstractchartmodel.cpp.
Member Function Documentation
| virtual int KPlato::AbstractChartModel::axisCount | ( | const ChartAxisIndex & | parent = ChartAxisIndex() |
) | const [pure virtual] |
Return the number if axis with parent in this model.
Implemented in KPlato::NodeChartModel.
| virtual QVariant KPlato::AbstractChartModel::axisData | ( | const ChartAxisIndex & | index, | |
| int | role = Qt::DisplayRole | |||
| ) | const [pure virtual] |
Return data for role for the axis set index.
Implemented in KPlato::NodeChartModel.
| virtual ChartAxisIndex KPlato::AbstractChartModel::axisIndex | ( | int | axisset, | |
| const ChartAxisIndex & | parent = ChartAxisIndex() | |||
| ) | const [pure virtual] |
Create an index for axisset with parent.
Implemented in KPlato::NodeChartModel.
| void KPlato::AbstractChartModel::axisSetChanged | ( | const ChartAxisIndex & | index | ) | [signal] |
Emitted when data in axis set index has changed.
| int KPlato::AbstractChartModel::childCount | ( | const ChartDataIndex & | parent | ) | const [virtual] |
Return the number of child data sets the parent has.
Reimplemented in KPlato::NodeChartModel.
Definition at line 119 of file kptabstractchartmodel.cpp.
| ChartAxisIndex KPlato::AbstractChartModel::createAxisIndex | ( | int | number, | |
| const ChartAxisIndex & | parent, | |||
| int | userdata = 0, |
|||
| int | parentId = -1 | |||
| ) | const [protected] |
Definition at line 145 of file kptabstractchartmodel.cpp.
| ChartDataIndex KPlato::AbstractChartModel::createDataIndex | ( | int | number, | |
| const ChartDataIndex & | parent, | |||
| int | userdata = 0 | |||
| ) | const [protected] |
Definition at line 137 of file kptabstractchartmodel.cpp.
| ChartDataIndex KPlato::AbstractChartModel::createDataIndex | ( | int | number, | |
| const ChartAxisIndex & | axisIndex, | |||
| int | userdata = 0 | |||
| ) | const [protected] |
Definition at line 129 of file kptabstractchartmodel.cpp.
| virtual QVariant KPlato::AbstractChartModel::data | ( | const ChartDataIndex & | index, | |
| const ChartAxisIndex & | axis, | |||
| int | role = Qt::DisplayRole | |||
| ) | const [pure virtual] |
Return data for role (e.g. a list of values to plot) for the data set index.
Implemented in KPlato::NodeChartModel.
| virtual QVariant KPlato::AbstractChartModel::data | ( | const ChartDataIndex & | index, | |
| int | role = Qt::DisplayRole | |||
| ) | const [pure virtual] |
Return data for role (e.g. a list of values to plot) for the data set index.
Implemented in KPlato::NodeChartModel.
| void KPlato::AbstractChartModel::dataSetChanged | ( | const ChartDataIndex & | index | ) | [signal] |
Emitted when data in data set index has changed.
| virtual int KPlato::AbstractChartModel::dataSetCount | ( | const ChartAxisIndex & | index | ) | const [pure virtual] |
Return the number of data sets that shall be plotted against the axis set index.
Implemented in KPlato::NodeChartModel.
| bool KPlato::AbstractChartModel::hasAxisChildren | ( | const ChartAxisIndex & | parent = ChartAxisIndex() |
) | const [virtual] |
Return true if parent has child axis sets.
Definition at line 124 of file kptabstractchartmodel.cpp.
| bool KPlato::AbstractChartModel::hasChildren | ( | const ChartDataIndex & | parent | ) | const [virtual] |
Return true if parent has child data sets.
Definition at line 104 of file kptabstractchartmodel.cpp.
| ChartDataIndex KPlato::AbstractChartModel::index | ( | int | dataset, | |
| const ChartDataIndex & | parent | |||
| ) | const [virtual] |
Create an index for the child number in the data set parent.
Implement if your data sets have children.
Reimplemented in KPlato::NodeChartModel.
Definition at line 109 of file kptabstractchartmodel.cpp.
| virtual ChartDataIndex KPlato::AbstractChartModel::index | ( | int | dataset, | |
| const ChartAxisIndex & | index | |||
| ) | const [pure virtual] |
Create an index for the dataset in the axis set index.
Implemented in KPlato::NodeChartModel.
| ChartAxisIndex KPlato::AbstractChartModel::parent | ( | const ChartAxisIndex & | index | ) | const [virtual] |
Return the parent ChartAxisIndex of index.
Reimplemented in KPlato::NodeChartModel.
Definition at line 114 of file kptabstractchartmodel.cpp.
| void KPlato::AbstractChartModel::reset | ( | ) | [signal] |
Emitted when the model is reset.
The documentation for this class was generated from the following files:
