KD Chart API Documentation 3.1
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | Protected Slots | List of all members
KDChart::AbstractAxis Class Referenceabstract

#include <KDChartAbstractAxis.h>

Inheritance diagram for KDChart::AbstractAxis:
Inheritance graph
[legend]
Collaboration diagram for KDChart::AbstractAxis:
Collaboration graph
[legend]

Public Slots

void update ()
 

Signals

void coordinateSystemChanged ()
 
- Signals inherited from KDChart::AbstractArea
void positionChanged (AbstractArea *)
 

Public Member Functions

 AbstractAxis (AbstractDiagram *diagram=nullptr)
 
 ~AbstractAxis () override
 
bool compare (const AbstractAxis *other) const
 
virtual void connectSignals ()
 
const AbstractCoordinatePlanecoordinatePlane () const
 Convenience function, returns the coordinate plane, in which this axis is used.
 
void createObserver (AbstractDiagram *diagram)
 
virtual const QString customizedLabel (const QString &label) const
 Reimplement this method if you want to adjust axis labels before they are printed.
 
void deleteObserver (AbstractDiagram *diagram)
 
const AbstractDiagramdiagram () const
 
QRect geometry () const override=0
 
QStringList labels () const
 
bool observedBy (AbstractDiagram *diagram) const
 
RulerAttributes rulerAttributes () const
 Returns the attributes to be used for painting the rulers.
 
void setGeometry (const QRect &rect) override=0
 
void setLabels (const QStringList &list)
 Use this to specify your own set of strings, to be used as axis labels.
 
void setRulerAttributes (const RulerAttributes &a)
 Use this to specify the attributes used to paint the axis ruler.
 
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 too long.
 
void setTextAttributes (const TextAttributes &a)
 Use this to specify the text attributes to be used for axis labels.
 
QStringList shortLabels () const
 
TextAttributes textAttributes () const
 Returns the text attributes to be used for axis labels.
 
- Public Member Functions inherited from KDChart::AbstractArea
 ~AbstractArea () override
 
virtual int bottomOverlap (bool doNotRecalculate=false) const
 
virtual int leftOverlap (bool doNotRecalculate=false) const
 
void paintAll (QPainter &painter) override
 
virtual void paintIntoRect (QPainter &painter, const QRect &rect)
 Draws the background and frame, then calls paint().
 
virtual int rightOverlap (bool doNotRecalculate=false) const
 
virtual int topOverlap (bool doNotRecalculate=false) const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
virtual ~QObject ()
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< TfindChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< TfindChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< TfindChildren (const QString &name, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
T qFindChild (const QObject *obj, const QString &name)
 
QList< TqFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< TqFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 
- Public Member Functions inherited from KDChart::AbstractAreaBase
void alignToReferencePoint (const RelativePosition &position)
 
BackgroundAttributes backgroundAttributes () const
 
bool compare (const AbstractAreaBase *other) const
 
FrameAttributes frameAttributes () const
 
void getFrameLeadings (int &left, int &top, int &right, int &bottom) const
 
virtual void paintBackground (QPainter &painter, const QRect &rectangle)
 
virtual void paintFrame (QPainter &painter, const QRect &rectangle)
 
void setBackgroundAttributes (const BackgroundAttributes &a)
 
void setFrameAttributes (const FrameAttributes &a)
 
- Public Member Functions inherited from KDChart::AbstractLayoutItem
 AbstractLayoutItem (Qt::Alignment itemAlignment={})
 
virtual void paint (QPainter *)=0
 
virtual void paintCtx (PaintContext *context)
 
QLayoutparentLayout ()
 
void removeFromParentLayout ()
 
void setParentLayout (QLayout *lay)
 
virtual void setParentWidget (QWidget *widget)
 
virtual void sizeHintChanged () const
 
- Public Member Functions inherited from QLayoutItem
 QLayoutItem (Qt::Alignment alignment)
 
virtual ~QLayoutItem ()
 
Qt::Alignment alignment () const const
 
virtual QSizePolicy::ControlTypes controlTypes () const const
 
virtual Qt::Orientations expandingDirections () const const=0
 
virtual bool hasHeightForWidth () const const
 
virtual int heightForWidth (int) const const
 
virtual void invalidate ()
 
virtual bool isEmpty () const const=0
 
virtual QLayoutlayout ()
 
virtual QSize maximumSize () const const=0
 
virtual int minimumHeightForWidth (int w) const const
 
virtual QSize minimumSize () const const=0
 
void setAlignment (Qt::Alignment alignment)
 
virtual QSize sizeHint () const const=0
 
virtual QSpacerItemspacerItem ()
 
virtual QWidgetwidget ()
 

Protected Slots

virtual void delayedInit ()
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Static Public Member Functions inherited from KDChart::AbstractAreaBase
static void paintBackgroundAttributes (QPainter &painter, const QRect &rectangle, const KDChart::BackgroundAttributes &attributes)
 
static void paintFrameAttributes (QPainter &painter, const QRect &rectangle, const KDChart::FrameAttributes &attributes)
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from KDChart::AbstractArea
 AbstractArea ()
 
QRect areaGeometry () const override
 
void positionHasChanged () override
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 
- Protected Member Functions inherited from KDChart::AbstractAreaBase
 AbstractAreaBase ()
 
virtual ~AbstractAreaBase ()
 
QRect innerRect () const
 
- Protected Attributes inherited from KDChart::AbstractLayoutItem
QWidgetmParent = nullptr
 
QLayoutmParentLayout = nullptr
 
- Properties inherited from QObject
 objectName
 

Detailed Description

The base class for axes.

For being useful, axes need to be assigned to a diagram, see AbstractCartesianDiagram::addAxis and AbstractCartesianDiagram::takeAxis.

See also
PolarAxis, AbstractCartesianDiagram

Definition at line 44 of file KDChartAbstractAxis.h.

Constructor & Destructor Documentation

◆ AbstractAxis()

AbstractAxis::AbstractAxis ( AbstractDiagram diagram = nullptr)
explicit

Definition at line 100 of file KDChartAbstractAxis.cpp.

References delayedInit(), and QTimer::singleShot.

◆ ~AbstractAxis()

AbstractAxis::~AbstractAxis ( )
override

Definition at line 107 of file KDChartAbstractAxis.cpp.

References d.

Member Function Documentation

◆ compare()

bool AbstractAxis::compare ( const AbstractAxis other) const

Returns true if both axes have the same settings.

Definition at line 132 of file KDChartAbstractAxis.cpp.

References compare(), labels(), QObject::qobject_cast(), shortLabels(), and textAttributes().

Referenced by compare(), and KDChart::CartesianAxis::compare().

◆ connectSignals()

void AbstractAxis::connectSignals ( )
virtual

Wireing the signal/slot connections.

This method gets called automatically, each time, when you assign the axis to a diagram, either by passing a diagram* to the c'tor, or by calling the diagram's setAxis method, resp.

If overwriting this method in derived classes, make sure to call this base method AbstractAxis::connectSignals(), so your axis gets connected to the diagram's built-in signals.

See also
AbstractCartesianDiagram::addAxis()

Definition at line 159 of file KDChartAbstractAxis.cpp.

References QObject::connect(), coordinateSystemChanged(), d, KDChart::DiagramObserver::diagramDataChanged(), and QObject::qobject_cast().

◆ coordinatePlane()

const AbstractCoordinatePlane * AbstractAxis::coordinatePlane ( ) const

Convenience function, returns the coordinate plane, in which this axis is used.

If the axis is not used in a coordinate plane, the return value is Zero.

Definition at line 222 of file KDChartAbstractAxis.cpp.

References KDChart::AbstractDiagram::coordinatePlane(), d, and KDChart::AbstractCoordinatePlane::diagram().

◆ coordinateSystemChanged

void KDChart::AbstractAxis::coordinateSystemChanged ( )
signal

Referenced by connectSignals().

◆ createObserver()

void AbstractAxis::createObserver ( AbstractDiagram diagram)

Definition at line 149 of file KDChartAbstractAxis.cpp.

References d, and diagram().

Referenced by KDChart::AbstractCartesianDiagram::addAxis().

◆ customizedLabel()

const QString AbstractAxis::customizedLabel ( const QString label) const
virtual

Reimplement this method if you want to adjust axis labels before they are printed.

KD Chart is calling this method immediately before drawing the text, this means: What you return here will be drawn without further modifications.

Parameters
labelThe text of the label as KD Chart has calculated it automatically (or as it was taken from a QStringList provided by you, resp.)
Note
If you reimplement this method in a subclass of KDChartCartesianAxis, and your reimplementation's return value depends on data other than label (so KDChart will not know when it changes), you must manually ensure that layouts are adapted to any changed sizes of the axis labels. To do that, call KDChartCartesianAxis::layoutPlanes() from your reimplementation when you know that the external data changed and it will change label sizes - or when you cannot exclude that.
Returns
The text to be drawn. By default this is the same as label.

Definition at line 144 of file KDChartAbstractAxis.cpp.

References QObject::qobject_cast().

Referenced by KDChart::LeveyJenningsAxis::paintAsOrdinate(), and KDChart::CartesianAxis::paintCtx().

◆ delayedInit

void AbstractAxis::delayedInit ( )
protectedvirtualslot

called for initializing after the c'tor has completed

Definition at line 124 of file KDChartAbstractAxis.cpp.

References d.

Referenced by AbstractAxis().

◆ deleteObserver()

void AbstractAxis::deleteObserver ( AbstractDiagram diagram)

Definition at line 154 of file KDChartAbstractAxis.cpp.

References d, and diagram().

Referenced by KDChart::AbstractCartesianDiagram::takeAxis().

◆ diagram()

const AbstractDiagram * KDChart::AbstractAxis::diagram ( ) const

◆ geometry()

QRect KDChart::AbstractAxis::geometry ( ) const
overridepure virtual

Implements QLayoutItem.

Implemented in KDChart::CartesianAxis, and KDChart::TernaryAxis.

◆ labels()

QStringList AbstractAxis::labels ( ) const

Returns a list of strings, that are used as axis labels, as set via setLabels.

See also
setLabels

Definition at line 203 of file KDChartAbstractAxis.cpp.

References d.

Referenced by compare(), KDChart::LeveyJenningsAxis::paintAsOrdinate(), and KDChart::TernaryAxis::paintCtx().

◆ observedBy()

bool KDChart::AbstractAxis::observedBy ( AbstractDiagram diagram) const

Definition at line 234 of file KDChartAbstractAxis.cpp.

References d.

◆ rulerAttributes()

RulerAttributes AbstractAxis::rulerAttributes ( ) const

Returns the attributes to be used for painting the rulers.

See also
setRulerAttributes

Definition at line 189 of file KDChartAbstractAxis.cpp.

References d.

Referenced by KDChart::CartesianAxis::paintCtx(), and KDChart::CartesianAxis::tickLength().

◆ setGeometry()

void KDChart::AbstractAxis::setGeometry ( const QRect rect)
overridepure virtual

Implements QLayoutItem.

Implemented in KDChart::CartesianAxis, and KDChart::TernaryAxis.

◆ setLabels()

void AbstractAxis::setLabels ( const QStringList list)

Use this to specify your own set of strings, to be used as axis labels.

Labels specified via setLabels take precedence: If a non-empty list is passed, KD Chart will use these strings as axis labels, instead of calculating them.

If you pass a smaller number of strings than the number of labels drawn at this axis, KD Chart will repeat the strings until all labels are drawn. As an example you could specify the seven days of the week as abscissa labels, which would be repeatedly used then.

By passing an empty QStringList you can reset the default behaviour.

See also
labels, setShortLabels

Definition at line 194 of file KDChartAbstractAxis.cpp.

References d, and QObject::qobject_cast().

Referenced by KDChart::LeveyJenningsAxis::paintAsAbscissa().

◆ setRulerAttributes()

void AbstractAxis::setRulerAttributes ( const RulerAttributes a)

Use this to specify the attributes used to paint the axis ruler.

Every axis has a default set of ruler attributes that is exactly the same among them. Use this method to specify your own attributes.

See also
rulerAttributes

Definition at line 183 of file KDChartAbstractAxis.cpp.

References d.

◆ setShortLabels()

void AbstractAxis::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 too long.

Note
Setting done via setShortLabels will be ignored, if you did not pass a non-empty string list via setLabels too!

By passing an empty QStringList you can reset the default behaviour.

See also
shortLabels, setLabels

Definition at line 208 of file KDChartAbstractAxis.cpp.

References d, and QObject::qobject_cast().

◆ setTextAttributes()

void AbstractAxis::setTextAttributes ( const TextAttributes a)

Use this to specify the text attributes to be used for axis labels.

By default, the reference area will be set at painting time. It will be the then-valid coordinate plane's parent widget, so normally, it will be the KDChart::Chart. Thus the labels of all of your axes in all of your diagrams within that Chart will be drawn in same font size, by default.

See also
textAttributes, setLabels

Definition at line 169 of file KDChartAbstractAxis.cpp.

References d.

Referenced by KDChart::LeveyJenningsAxis::setType().

◆ shortLabels()

QStringList AbstractAxis::shortLabels ( ) const

Returns a list of strings, that are used as axis labels, as set via setShortLabels.

Note
Setting done via setShortLabels will be ignored, if you did not pass a non-empty string list via setLabels too!
See also
setShortLabels

Definition at line 217 of file KDChartAbstractAxis.cpp.

References d.

Referenced by compare().

◆ textAttributes()

TextAttributes AbstractAxis::textAttributes ( ) const

◆ update

void KDChart::AbstractAxis::update ( )
slot

Definition at line 239 of file KDChartAbstractAxis.cpp.

References d, and KDChart::AbstractDiagram::update().


The documentation for this class was generated from the following files:

© 2001 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-chart/
Generated on Fri Apr 26 2024 00:04:57 for KD Chart API Documentation by doxygen 1.9.8