 |
KD Chart 2
[rev.2.8]
|
Go to the documentation of this file.
24 #include "KDChartAbstractCartesianDiagram_p.h"
26 #include <KDABLibFakes>
31 AbstractCartesianDiagram::Private::Private()
32 : referenceDiagram( 0 )
36 AbstractCartesianDiagram::Private::~Private()
42 if ( other ==
this )
return true;
70 void AbstractCartesianDiagram::init()
86 if ( !
d->axesList.contains( axis ) ) {
87 d->axesList.append( axis );
95 const int idx =
d->axesList.indexOf( axis );
97 d->axesList.takeAt( idx );
118 if ( coordinatePlane() ) {
119 disconnect( attributesModel(), SIGNAL( rowsRemoved(
const QModelIndex&,
int,
int ) ),
120 coordinatePlane(), SLOT( relayout() ) );
121 disconnect( attributesModel(), SIGNAL( rowsInserted(
const QModelIndex&,
int,
int ) ),
122 coordinatePlane(), SLOT( relayout() ) );
123 disconnect( attributesModel(), SIGNAL( columnsRemoved(
const QModelIndex&,
int,
int ) ),
124 coordinatePlane(), SLOT( relayout() ) );
125 disconnect( attributesModel(), SIGNAL( columnsInserted(
const QModelIndex&,
int,
int ) ),
126 coordinatePlane(), SLOT( relayout() ) );
127 disconnect( coordinatePlane() );
133 connect( attributesModel(), SIGNAL( rowsRemoved(
const QModelIndex&,
int,
int ) ),
134 plane, SLOT( relayout() ) );
135 connect( attributesModel(), SIGNAL( rowsInserted(
const QModelIndex&,
int,
int ) ),
136 plane, SLOT( relayout() ) );
137 connect( attributesModel(), SIGNAL( columnsRemoved(
const QModelIndex&,
int,
int ) ),
138 plane, SLOT( relayout() ) );
139 connect( attributesModel(), SIGNAL( columnsInserted(
const QModelIndex&,
int,
int ) ),
140 plane, SLOT( relayout() ) );
141 connect( plane, SIGNAL( viewportCoordinateSystemChanged() ),
142 this, SIGNAL( viewportCoordinateSystemChanged() ) );
143 connect( plane, SIGNAL( viewportCoordinateSystemChanged() ),
this, SLOT( update() ) );
149 d->referenceDiagram = diagram;
150 d->referenceDiagramOffset = offset;
155 return d->referenceDiagram;
160 return d->referenceDiagramOffset;
171 if ( m == model() ) {
198 d->compressor.setModel( newModel );
~AbstractCartesianDiagram() override
void setRootIndex(const QModelIndex &idx) override
Set the root index in the model, where the diagram starts referencing data for display.
virtual void addAxis(CartesianAxis *axis)
Add the axis to the diagram.
void connectAttributesModel(AttributesModel *)
void layoutPlanes()
Calling layoutPlanes() on the plane triggers the global KDChart::Chart::slotLayoutPlanes()
virtual void setReferenceDiagram(AbstractCartesianDiagram *diagram, const QPointF &offset=QPointF())
Makes this diagram use another diagram diagram as reference diagram with relative offset offset.
The class for cartesian axes.
void layoutChanged(AbstractDiagram *)
Diagrams are supposed to emit this signal, when the layout of one of their element changes.
void viewportCoordinateSystemChanged()
Emitted upon change of the view coordinate system.
void deleteObserver(AbstractDiagram *diagram)
virtual AbstractCartesianDiagram * referenceDiagram() const
virtual void setParentWidget(QWidget *widget)
Inform the item about its widget: This enables the item, to trigger that widget's update,...
virtual void layoutPlanes()
Triggers layouting of all coordinate planes on the current chart.
void setCoordinatePlane(AbstractCoordinatePlane *plane) override
[reimplemented]
Base class for diagrams based on a cartesian coordianate system.
void setModel(QAbstractItemModel *model) override
A proxy model used for decorating data with attributes.
virtual AttributesModel * attributesModel() const
Returns the AttributesModel, that is used by this diagram.
void setModel(QAbstractItemModel *model) override
Associate a model with the diagram.
void attributesModelAboutToChange(AttributesModel *newModel, AttributesModel *oldModel)
This signal is emitted just before the new attributes model is connected internally.
bool compare(const AbstractCartesianDiagram *other) const
Returns true if both diagrams have the same settings.
AbstractDiagram defines the interface for diagram classes.
void setRootIndex(const QModelIndex &index) override
void createObserver(AbstractDiagram *diagram)
virtual void setAttributesModel(AttributesModel *model)
Associate an AttributesModel with this diagram.
Cartesian coordinate plane.
AbstractCartesianDiagram(QWidget *parent=0, CartesianCoordinatePlane *plane=0)
virtual KDChart::CartesianAxisList axes() const
virtual void setCoordinatePlane(AbstractCoordinatePlane *plane)
Set the coordinate plane associated with the diagram.
Base class common for all coordinate planes, CartesianCoordinatePlane, PolarCoordinatePlane,...
virtual void takeAxis(CartesianAxis *axis)
Removes the axis from the diagram, without deleting it.
void setAttributesModel(AttributesModel *model) override
Associate an AttributesModel with this diagram.
virtual QPointF referenceDiagramOffset() const