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 );
119 disconnect(
attributesModel(), SIGNAL( rowsRemoved(
const QModelIndex&,
int,
int ) ),
121 disconnect(
attributesModel(), SIGNAL( rowsInserted(
const QModelIndex&,
int,
int ) ),
123 disconnect(
attributesModel(), SIGNAL( columnsRemoved(
const QModelIndex&,
int,
int ) ),
125 disconnect(
attributesModel(), SIGNAL( columnsInserted(
const QModelIndex&,
int,
int ) ),
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() ) );
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 );
Base class common for all coordinate planes, CartesianCoordinatePlane, PolarCoordinatePlane, TernaryCoordinatePlane.
virtual void setReferenceDiagram(AbstractCartesianDiagram *diagram, const QPointF &offset=QPointF())
Makes this diagram use another diagram diagram as reference diagram with relative offset offset...
void connectAttributesModel(AttributesModel *)
virtual void addAxis(CartesianAxis *axis)
Add the axis to the diagram.
void deleteObserver(AbstractDiagram *diagram)
void setAttributesModel(AttributesModel *model) override
Associate an AttributesModel with this diagram.
void layoutPlanes()
Calling layoutPlanes() on the plane triggers the global KDChart::Chart::slotLayoutPlanes() ...
~AbstractCartesianDiagram() override
virtual AttributesModel * attributesModel() const
Returns the AttributesModel, that is used by this diagram.
AbstractCoordinatePlane * coordinatePlane() const
The coordinate plane associated with the diagram.
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 createObserver(AbstractDiagram *diagram)
void setRootIndex(const QModelIndex &idx) override
Set the root index in the model, where the diagram starts referencing data for display.
AbstractDiagram defines the interface for diagram classes.
void setCoordinatePlane(AbstractCoordinatePlane *plane) override
[reimplemented]
The class for cartesian axes.
void setRootIndex(const QModelIndex &index) override
A proxy model used for decorating data with attributes.
virtual AbstractCartesianDiagram * referenceDiagram() const
virtual KDChart::CartesianAxisList axes() const
virtual void setAttributesModel(AttributesModel *model)
Associate an AttributesModel with this diagram.
virtual void setCoordinatePlane(AbstractCoordinatePlane *plane)
Set the coordinate plane associated with the diagram.
bool compare(const AbstractAxis *other) const
Returns true if both axes have the same settings.
void setModel(QAbstractItemModel *model) override
virtual QPointF referenceDiagramOffset() const
void setModel(QAbstractItemModel *model) override
Associate a model with the diagram.
Base class for diagrams based on a cartesian coordianate system.
AbstractCartesianDiagram(QWidget *parent=0, CartesianCoordinatePlane *plane=0)
void viewportCoordinateSystemChanged()
Emitted upon change of the view coordinate system.
void layoutChanged(AbstractDiagram *)
Diagrams are supposed to emit this signal, when the layout of one of their element changes...
Cartesian coordinate plane.
void attributesModelAboutToChange(AttributesModel *newModel, AttributesModel *oldModel)
This signal is emitted just before the new attributes model is connected internally.
virtual void takeAxis(CartesianAxis *axis)
Removes the axis from the diagram, without deleting it.
bool compare(const AbstractCartesianDiagram *other) const
Returns true if both diagrams have the same settings.