KD Chart API Documentation 3.1
|
#include <KDChartDatasetProxyModel.h>
DatasetProxyModel takes a KDChart dataset configuration and translates it into a filtering proxy model.
The resulting model will only contain the part of the model that is selected by the dataset, and the according row and column header data.
Currently, this model is implemented for table models only. The way it would work with models representing a tree is to be decided.
The column selection is configured by passing a dataset description vector to the model. This vector (of integers) is supposed to have one value for each column of the original model. If the value at position x is -1, column x of the original model is not included in the dataset. If it is between 0 and (columnCount() -1), it is the column the source column is mapped to in the resulting model. Any other value is an error.
Definition at line 43 of file KDChartDatasetProxyModel.h.
Create a DatasetProxyModel. Without further configuration, this model is invalid.
Definition at line 19 of file KDChartDatasetProxyModel.cpp.
|
overridevirtual |
Reimplemented from QSortFilterProxyModel.
Definition at line 24 of file KDChartDatasetProxyModel.cpp.
References index().
|
overridevirtual |
Overloaded from base class.
Reimplemented from QSortFilterProxyModel.
Definition at line 195 of file KDChartDatasetProxyModel.cpp.
References index(), mapToSource(), and QAbstractProxyModel::sourceModel.
|
overrideprotectedvirtual |
Decide whether the column is accepted.
Reimplemented from QSortFilterProxyModel.
Definition at line 128 of file KDChartDatasetProxyModel.cpp.
References QSortFilterProxyModel::columnCount(), QVector::isEmpty(), QObject::qobject_cast(), QVector::size(), and QAbstractProxyModel::sourceModel.
|
overrideprotectedvirtual |
Decide whether the row is accepted.
Reimplemented from QSortFilterProxyModel.
Definition at line 110 of file KDChartDatasetProxyModel.cpp.
References QVector::isEmpty(), QObject::qobject_cast(), QSortFilterProxyModel::rowCount(), QVector::size(), and QAbstractProxyModel::sourceModel.
|
overridevirtual |
Reimplemented from QSortFilterProxyModel.
Definition at line 29 of file KDChartDatasetProxyModel.cpp.
References QModelIndex::flags(), index(), mapToSource(), and QAbstractProxyModel::sourceModel.
|
overridevirtual |
Overloaded from base class.
Reimplemented from QSortFilterProxyModel.
Definition at line 205 of file KDChartDatasetProxyModel.cpp.
References Qt::Horizontal, and QAbstractProxyModel::sourceModel.
|
overridevirtual |
Reimplemented from QSortFilterProxyModel.
Definition at line 62 of file KDChartDatasetProxyModel.cpp.
References index(), mapFromSource(), QObject::parent(), and QAbstractProxyModel::sourceModel.
Referenced by buddy(), data(), flags(), index(), and setData().
|
overridevirtual |
Implements the mapping from the source to the proxy indexes.
Reimplemented from QSortFilterProxyModel.
Definition at line 76 of file KDChartDatasetProxyModel.cpp.
References QAbstractItemModel::createIndex(), QVector::isEmpty(), QObject::qobject_cast(), and QAbstractProxyModel::sourceModel.
|
overridevirtual |
Implements the mapping from the proxy to the source indexes.
Reimplemented from QSortFilterProxyModel.
Definition at line 94 of file KDChartDatasetProxyModel.cpp.
References QVector::isEmpty(), QObject::qobject_cast(), and QAbstractProxyModel::sourceModel.
|
overridevirtual |
Reimplemented from QSortFilterProxyModel.
Definition at line 70 of file KDChartDatasetProxyModel.cpp.
References mapFromSource(), mapToSource(), QObject::parent(), and QAbstractProxyModel::sourceModel.
|
slot |
Reset all dataset description. After that, the result of the proxying is an empty model (a new dataset description needs to be set to achieve a non-empty result).
Definition at line 186 of file KDChartDatasetProxyModel.cpp.
References QVector::clear(), and QSortFilterProxyModel::invalidate().
Referenced by setSourceModel(), and setSourceRootIndex().
|
overridevirtual |
Overloaded from base class.
Reimplemented from QSortFilterProxyModel.
Definition at line 200 of file KDChartDatasetProxyModel.cpp.
References index(), mapToSource(), and QAbstractProxyModel::sourceModel.
|
slot |
Configure the dataset selection for the columns. Every call to this method resets the previous dataset description.
Definition at line 44 of file KDChartDatasetProxyModel.cpp.
References QSortFilterProxyModel::columnCount(), QSortFilterProxyModel::invalidate(), QObject::qobject_cast(), and QAbstractProxyModel::sourceModel.
Referenced by setDatasetDescriptionVectors().
|
slot |
Convenience method to configure rows and columns in one step.
Definition at line 54 of file KDChartDatasetProxyModel.cpp.
References QObject::qobject_cast(), setDatasetColumnDescriptionVector(), and setDatasetRowDescriptionVector().
|
slot |
Configure the dataset selection for the rows. Every call to this method resets the previous dataset description.
Definition at line 34 of file KDChartDatasetProxyModel.cpp.
References QSortFilterProxyModel::invalidate(), QObject::qobject_cast(), QSortFilterProxyModel::rowCount(), and QAbstractProxyModel::sourceModel.
Referenced by setDatasetDescriptionVectors().
|
overridevirtual |
Overloaded from base class.
Reimplemented from QSortFilterProxyModel.
Definition at line 252 of file KDChartDatasetProxyModel.cpp.
References QObject::connect(), QObject::disconnect(), QAbstractItemModel::layoutChanged(), resetDatasetDescriptions(), QSortFilterProxyModel::setSourceModel(), and QAbstractProxyModel::sourceModel.
void DatasetProxyModel::setSourceRootIndex | ( | const QModelIndex & | rootIdx | ) |
Set the root index of the table in the source model
Definition at line 268 of file KDChartDatasetProxyModel.cpp.
References QObject::qobject_cast(), and resetDatasetDescriptions().