kstars
#include <qcustomplot.h>

Public Member Functions | |
QCPPlottableLegendItem (QCPLegend *parent, QCPAbstractPlottable *plottable) | |
QCPAbstractPlottable * | plottable () |
![]() | |
QCPAbstractLegendItem (QCPLegend *parent) | |
QFont | font () const |
QCPLegend * | parentLegend () const |
bool | selectable () const |
bool | selected () const |
QFont | selectedFont () const |
QColor | selectedTextColor () const |
double | selectTest (const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const override |
void | setFont (const QFont &font) |
Q_SLOT void | setSelectable (bool selectable) |
Q_SLOT void | setSelected (bool selected) |
void | setSelectedFont (const QFont &font) |
void | setSelectedTextColor (const QColor &color) |
void | setTextColor (const QColor &color) |
QColor | textColor () const |
![]() | |
QCPLayoutElement (QCustomPlot *parentPlot=nullptr) | |
~QCPLayoutElement () override | |
QCP::MarginSides | autoMargins () const |
virtual QList< QCPLayoutElement * > | elements (bool recursive) const |
QCPLayout * | layout () const |
QCPMarginGroup * | marginGroup (QCP::MarginSide side) const |
QHash< QCP::MarginSide, QCPMarginGroup * > | marginGroups () const |
QMargins | margins () const |
QSize | maximumSize () const |
virtual QSize | maximumSizeHint () const |
QMargins | minimumMargins () const |
QSize | minimumSize () const |
QRect | outerRect () const |
QRect | rect () const |
void | setAutoMargins (QCP::MarginSides sides) |
void | setMarginGroup (QCP::MarginSides sides, QCPMarginGroup *group) |
void | setMargins (const QMargins &margins) |
void | setMaximumSize (const QSize &size) |
void | setMaximumSize (int width, int height) |
void | setMinimumMargins (const QMargins &margins) |
void | setMinimumSize (const QSize &size) |
void | setMinimumSize (int width, int height) |
void | setOuterRect (const QRect &rect) |
virtual void | update (UpdatePhase phase) |
![]() | |
QCPLayerable (QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=nullptr) | |
~QCPLayerable () override | |
bool | antialiased () const |
QCPLayer * | layer () const |
QCPLayerable * | parentLayerable () const |
QCustomPlot * | parentPlot () const |
bool | realVisibility () const |
void | setAntialiased (bool enabled) |
Q_SLOT bool | setLayer (QCPLayer *layer) |
bool | setLayer (const QString &layerName) |
void | setVisible (bool on) |
bool | visible () const |
![]() | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Protected Member Functions | |
void | draw (QCPPainter *painter) override |
QFont | getFont () const |
QPen | getIconBorderPen () const |
QColor | getTextColor () const |
QSize | minimumSizeHint () const override |
![]() | |
void | applyDefaultAntialiasingHint (QCPPainter *painter) const override |
QRect | clipRect () const override |
void | deselectEvent (bool *selectionStateChanged) override |
void | selectEvent (QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) override |
QCP::Interaction | selectionCategory () const override |
![]() | |
virtual int | calculateAutoMargin (QCP::MarginSide side) |
virtual void | layoutChanged () |
void | parentPlotInitialized (QCustomPlot *parentPlot) override |
![]() | |
void | applyAntialiasingHint (QCPPainter *painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const |
void | initializeParentPlot (QCustomPlot *parentPlot) |
virtual void | mouseDoubleClickEvent (QMouseEvent *event, const QVariant &details) |
virtual void | mouseMoveEvent (QMouseEvent *event, const QPointF &startPos) |
virtual void | mousePressEvent (QMouseEvent *event, const QVariant &details) |
virtual void | mouseReleaseEvent (QMouseEvent *event, const QPointF &startPos) |
bool | moveToLayer (QCPLayer *layer, bool prepend) |
void | setParentLayerable (QCPLayerable *parentLayerable) |
virtual void | wheelEvent (QWheelEvent *event) |
![]() | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Protected Attributes | |
QCPAbstractPlottable * | mPlottable |
![]() | |
QFont | mFont |
QCPLegend * | mParentLegend |
bool | mSelectable |
bool | mSelected |
QFont | mSelectedFont |
QColor | mSelectedTextColor |
QColor | mTextColor |
![]() | |
QCP::MarginSides | mAutoMargins |
QHash< QCP::MarginSide, QCPMarginGroup * > | mMarginGroups |
QMargins | mMargins |
QSize | mMaximumSize |
QMargins | mMinimumMargins |
QSize | mMinimumSize |
QRect | mOuterRect |
QCPLayout * | mParentLayout |
QRect | mRect |
![]() | |
bool | mAntialiased |
QCPLayer * | mLayer |
QPointer< QCPLayerable > | mParentLayerable |
QCustomPlot * | mParentPlot |
bool | mVisible |
Additional Inherited Members | |
![]() | |
enum | UpdatePhase { upPreparation, upMargins, upLayout } |
![]() | |
void | selectableChanged (bool selectable) |
void | selectionChanged (bool selected) |
![]() | |
void | layerChanged (QCPLayer *newLayer) |
![]() | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
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) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
![]() | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
![]() | |
objectName | |
Detailed Description
A legend item representing a plottable with an icon and the plottable name.
This is the standard legend item for plottables. It displays an icon of the plottable next to the plottable name. The icon is drawn by the respective plottable itself (QCPAbstractPlottable::drawLegendIcon), and tries to give an intuitive symbol for the plottable. For example, the QCPGraph draws a centered horizontal line and/or a single scatter point in the middle.
Legend items of this type are always associated with one plottable (retrievable via the plottable() function and settable with the constructor). You may change the font of the plottable name with setFont. Icon padding and border pen is taken from the parent QCPLegend, see QCPLegend::setIconBorderPen and QCPLegend::setIconTextPadding.
The function QCPAbstractPlottable::addToLegend/QCPAbstractPlottable::removeFromLegend creates/removes legend items of this type in the default implementation. However, these functions may be reimplemented such that a different kind of legend item (e.g a direct subclass of QCPAbstractLegendItem) is used for that plottable.
Since QCPLegend is based on QCPLayoutGrid, a legend item itself is just a subclass of QCPLayoutElement. While it could be added to a legend (or any other layout) via the normal layout interface, QCPLegend has specialized functions for handling legend items conveniently, see the documentation of QCPLegend.
Definition at line 5766 of file qcustomplot.h.
Constructor & Destructor Documentation
QCPPlottableLegendItem::QCPPlottableLegendItem | ( | QCPLegend * | parent, |
QCPAbstractPlottable * | plottable | ||
) |
Creates a new legend item associated with plottable.
Once it's created, it can be added to the legend via QCPLegend::addItem.
A more convenient way of adding/removing a plottable to/from the legend is via the functions QCPAbstractPlottable::addToLegend and QCPAbstractPlottable::removeFromLegend.
Definition at line 18384 of file qcustomplot.cpp.
Member Function Documentation
|
overrideprotectedvirtual |
Draws the item with painter. The size and position of the drawn legend item is defined by the parent layout (typically a QCPLegend) and the minimumSizeHint and maximumSizeHint of this legend item.
Implements QCPAbstractLegendItem.
Definition at line 18426 of file qcustomplot.cpp.
|
protected |
Returns the font that shall be used to draw text, taking into account the selection state of this item.
Definition at line 18415 of file qcustomplot.cpp.
|
protected |
Returns the pen that shall be used to draw the icon border, taking into account the selection state of this item.
Definition at line 18395 of file qcustomplot.cpp.
|
protected |
Returns the text color that shall be used to draw text, taking into account the selection state of this item.
Definition at line 18405 of file qcustomplot.cpp.
|
overrideprotectedvirtual |
Calculates and returns the size of this item. This includes the icon, the text and the padding in between.
Reimplemented from QCPLayoutElement.
Definition at line 18467 of file qcustomplot.cpp.
|
inline |
Definition at line 5773 of file qcustomplot.h.
Member Data Documentation
|
protected |
Definition at line 5780 of file qcustomplot.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2019 The KDE developers.
Generated on Fri Dec 13 2019 02:57:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.