KChart::AbstractAxis
#include <KChartAbstractAxis.h>
Signals | |
void | coordinateSystemChanged () |
Signals inherited from KChart::AbstractArea | |
void | positionChanged (KChart::AbstractArea *) |
Public Slots | |
void | update () |
Public Member Functions | |
AbstractAxis (AbstractDiagram *diagram=nullptr) | |
bool | compare (const AbstractAxis *other) const |
virtual void | connectSignals () |
const AbstractCoordinatePlane * | coordinatePlane () const |
void | createObserver (AbstractDiagram *diagram) |
virtual const QString | customizedLabel (const QString &label) const |
void | deleteObserver (AbstractDiagram *diagram) |
const AbstractDiagram * | diagram () const |
QRect | geometry () const override=0 |
QStringList | labels () const |
bool | observedBy (AbstractDiagram *diagram) const |
RulerAttributes | rulerAttributes () const |
void | setGeometry (const QRect &rect) override=0 |
void | setLabels (const QStringList &list) |
void | setRulerAttributes (const RulerAttributes &a) |
void | setShortLabels (const QStringList &list) |
void | setTextAttributes (const TextAttributes &a) |
QStringList | shortLabels () const |
TextAttributes | textAttributes () const |
Public Member Functions inherited from KChart::AbstractArea | |
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) |
virtual int | rightOverlap (bool doNotRecalculate=false) const |
virtual int | topOverlap (bool doNotRecalculate=false) const |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QBindable< QString > | bindableObjectName () |
bool | blockSignals (bool block) |
const QObjectList & | children () 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 () const const |
void | dumpObjectTree () const const |
QList< QByteArray > | dynamicPropertyNames () 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< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (Qt::FindChildOptions options) const const |
bool | inherits (const char *className) const const |
void | installEventFilter (QObject *filterObj) |
bool | isQuickItemType () const const |
bool | isWidgetType () const const |
bool | isWindowType () const const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
QVariant | property (const char *name) const const |
Q_CLASSINFO (Name, Value) | |
Q_EMIT Q_EMIT | |
Q_ENUM (...) | |
Q_ENUM_NS (...) | |
Q_ENUMS (...) | |
Q_FLAG (...) | |
Q_FLAG_NS (...) | |
Q_FLAGS (...) | |
Q_GADGET Q_GADGET | |
Q_GADGET_EXPORT (EXPORT_MACRO) | |
Q_INTERFACES (...) | |
Q_INVOKABLE Q_INVOKABLE | |
Q_MOC_INCLUDE Q_MOC_INCLUDE | |
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 | qobject_cast (const QObject *object) |
T | 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 | setObjectName (QAnyStringView name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | setProperty (const char *name, QVariant &&value) |
bool | signalsBlocked () const const |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType) |
QThread * | thread () const const |
Public Member Functions inherited from KChart::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 KChart::AbstractLayoutItem | |
AbstractLayoutItem (Qt::Alignment itemAlignment=Qt::Alignment()) | |
virtual void | paint (QPainter *)=0 |
virtual void | paintCtx (PaintContext *context) |
QLayout * | parentLayout () |
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) | |
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 QLayout * | layout () |
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 QSpacerItem * | spacerItem () |
virtual QWidget * | widget () const const |
Protected Slots | |
virtual void | delayedInit () |
Additional Inherited Members | |
Public Types inherited from QObject | |
typedef | QObjectList |
Properties inherited from QObject | |
objectName | |
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) |
Static Public Member Functions inherited from KChart::AbstractAreaBase | |
static void | paintBackgroundAttributes (QPainter &painter, const QRect &rectangle, const KChart::BackgroundAttributes &attributes) |
static void | paintFrameAttributes (QPainter &painter, const QRect &rectangle, const KChart::FrameAttributes &attributes) |
Protected Member Functions inherited from KChart::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 |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
Protected Member Functions inherited from KChart::AbstractAreaBase | |
QRect | innerRect () const |
Protected Attributes inherited from KChart::AbstractLayoutItem | |
QWidget * | mParent |
QLayout * | mParentLayout |
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 43 of file KChartAbstractAxis.h.
Constructor & Destructor Documentation
◆ AbstractAxis()
|
explicit |
Definition at line 98 of file KChartAbstractAxis.cpp.
◆ ~AbstractAxis()
|
override |
Definition at line 105 of file KChartAbstractAxis.cpp.
Member Function Documentation
◆ compare()
bool AbstractAxis::compare | ( | const AbstractAxis * | other | ) | const |
Returns true if both axes have the same settings.
Definition at line 131 of file KChartAbstractAxis.cpp.
◆ 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.
Definition at line 163 of file KChartAbstractAxis.cpp.
◆ 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 227 of file KChartAbstractAxis.cpp.
◆ createObserver()
void AbstractAxis::createObserver | ( | AbstractDiagram * | diagram | ) |
Method invoked by AbstractCartesianDiagram::addAxis().
You should not call this function, unless you know exactly, what you are doing.
Definition at line 153 of file KChartAbstractAxis.cpp.
◆ customizedLabel()
Reimplement this method if you want to adjust axis labels before they are printed.
KChart is calling this method immediately before drawing the text, this means: What you return here will be drawn without further modifications.
- Parameters
-
label The text of the label as KChart 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 KChart::CartesianAxis, and your reimplementation's return value depends on data other than
label
(so KChart 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 KChart::CartesianAxis::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 147 of file KChartAbstractAxis.cpp.
◆ delayedInit
|
protectedvirtualslot |
called for initializing after the c'tor has completed
Definition at line 123 of file KChartAbstractAxis.cpp.
◆ deleteObserver()
void AbstractAxis::deleteObserver | ( | AbstractDiagram * | diagram | ) |
Method invoked by AbstractCartesianDiagram::takeAxis().
You should not call this function, unless you know exactly, what you are doing.
Definition at line 158 of file KChartAbstractAxis.cpp.
◆ diagram()
const AbstractDiagram * KChart::AbstractAxis::diagram | ( | ) | const |
Definition at line 234 of file KChartAbstractAxis.cpp.
◆ geometry()
|
overridepure virtual |
Implements QLayoutItem.
Implemented in KChart::CartesianAxis.
◆ 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 208 of file KChartAbstractAxis.cpp.
◆ observedBy()
bool KChart::AbstractAxis::observedBy | ( | AbstractDiagram * | diagram | ) | const |
Definition at line 239 of file KChartAbstractAxis.cpp.
◆ rulerAttributes()
RulerAttributes AbstractAxis::rulerAttributes | ( | ) | const |
Returns the attributes to be used for painting the rulers.
- See also
- setRulerAttributes
Definition at line 194 of file KChartAbstractAxis.cpp.
◆ setGeometry()
|
overridepure virtual |
Implements QLayoutItem.
Implemented in KChart::CartesianAxis.
◆ 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, KChart 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, KChart 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 199 of file KChartAbstractAxis.cpp.
◆ 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 188 of file KChartAbstractAxis.cpp.
◆ 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 213 of file KChartAbstractAxis.cpp.
◆ 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 KChart::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 173 of file KChartAbstractAxis.cpp.
◆ 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 222 of file KChartAbstractAxis.cpp.
◆ textAttributes()
TextAttributes AbstractAxis::textAttributes | ( | ) | const |
Returns the text attributes to be used for axis labels.
- See also
- setTextAttributes
Definition at line 182 of file KChartAbstractAxis.cpp.
◆ update
|
slot |
Definition at line 244 of file KChartAbstractAxis.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 27 2024 11:54:32 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.