24 #include "KDChartAbstractAxis_p.h" 30 #include <KDABLibFakes> 45 AbstractAxis::Private::~Private()
51 bool AbstractAxis::Private::setDiagram(
AbstractDiagram* diagram_,
bool delayedInit )
60 ((diagram == mDiagram) || secondaryDiagrams.contains( diagram )) )
63 bool bNewDiagramStored =
false;
69 const bool con = connect( observer, SIGNAL( diagramDataChanged(
AbstractDiagram *) ),
70 mAxis, SIGNAL( coordinateSystemChanged() ) );
73 bNewDiagramStored =
true;
79 secondaryDiagrams.enqueue( diagram );
81 return bNewDiagramStored;
86 if ( diagram == mDiagram ) {
91 secondaryDiagrams.removeAll( diagram );
93 if ( !secondaryDiagrams.isEmpty() ) {
95 setDiagram( nextDiagram );
99 bool AbstractAxis::Private::hasDiagram(
AbstractDiagram* diagram )
const 101 return diagram == mDiagram || secondaryDiagrams.contains( diagram );
104 void AbstractAxis::Private::updateLayouts()
106 if (
CartesianAxis* cartesianAxis = qobject_cast< CartesianAxis* >( mAxis ) ) {
107 cartesianAxis->layoutPlanes();
123 d->secondaryDiagrams.clear();
127 void AbstractAxis::init()
130 d->textAttributes.setFontSize( m );
133 d->textAttributes.setMinimalFontSize( m );
143 d->setDiagram( 0,
true );
148 if ( other ==
this ) {
155 return ( static_cast<const AbstractAreaBase*>(
this)->
compare( other ) ) &&
170 d->setDiagram( diagram );
175 d->unsetDiagram( diagram );
181 const bool con = connect(
d->observer, SIGNAL( diagramDataChanged(
AbstractDiagram *) ),
190 if (
d->textAttributes == a )
193 d->textAttributes = a;
199 return d->textAttributes;
205 d->rulerAttributes = a;
211 return d->rulerAttributes;
216 if (
d->hardLabels == list )
219 d->hardLabels = list;
225 return d->hardLabels;
230 if (
d->hardShortLabels == list )
233 d->hardShortLabels = list;
239 return d->hardShortLabels;
245 return d->diagram()->coordinatePlane();
256 return d->hasDiagram( diagram );
262 d->diagram()->update();
virtual void delayedInit()
called for initializing after the c'tor has completed
A DiagramObserver watches the associated diagram for changes and deletion and emits corresponsing sig...
Base class common for all coordinate planes, CartesianCoordinatePlane, PolarCoordinatePlane, TernaryCoordinatePlane.
virtual void connectSignals()
Wireing the signal/slot connections.
An area in the chart with a background, a frame, etc.
void setLabels(const QStringList &list)
Use this to specify your own set of strings, to be used as axis labels.
void deleteObserver(AbstractDiagram *diagram)
Definition of global enums.
void setShortLabels(const QStringList &list)
Use this to specify your own set of strings, to be used as axis labels, in case the normal labels are...
QStringList shortLabels() const
Returns a list of strings, that are used as axis labels, as set via setShortLabels.
A set of attributes controlling the appearance of axis rulers.
void createObserver(AbstractDiagram *diagram)
AbstractDiagram defines the interface for diagram classes.
QStringList labels() const
Returns a list of strings, that are used as axis labels, as set via setLabels.
const AbstractDiagram * diagram() const
The class for cartesian axes.
void coordinateSystemChanged()
void setTextAttributes(const TextAttributes &a)
Use this to specify the text attributes to be used for axis labels.
TextAttributes textAttributes() const
Returns the text attributes to be used for axis labels.
Declaring the class KDChart::Measure.
bool observedBy(AbstractDiagram *diagram) const
bool compare(const AbstractAxis *other) const
Returns true if both axes have the same settings.
void setRulerAttributes(const RulerAttributes &a)
Use this to specify the attributes used to paint the axis ruler.
Measure is used to specify relative and absolute sizes in KDChart, e.g.
void setCalculationMode(KDChartEnums::MeasureCalculationMode mode)
virtual const QString customizedLabel(const QString &label) const
Reimplement this method if you want to adjust axis labels before they are printed.
const AbstractCoordinatePlane * coordinatePlane() const
Convenience function, returns the coordinate plane, in which this axis is used.
RulerAttributes rulerAttributes() const
Returns the attributes to be used for painting the rulers.
A set of text attributes.