Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
|
A legend item representing a plottable with an icon and the plottable name. More...
#include <qcustomplot.h>
Protected Member Functions | |
virtual void | draw (QCPPainter *painter) |
virtual QSize | minimumSizeHint () const |
QPen | getIconBorderPen () const |
QColor | getTextColor () const |
QFont | getFont () const |
Protected Member Functions inherited from QCPAbstractLegendItem | |
virtual QCP::Interaction | selectionCategory () const |
virtual void | applyDefaultAntialiasingHint (QCPPainter *painter) const |
virtual QRect | clipRect () const |
virtual void | selectEvent (QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) |
virtual void | deselectEvent (bool *selectionStateChanged) |
Protected Member Functions inherited from QCPLayoutElement | |
virtual int | calculateAutoMargin (QCP::MarginSide side) |
virtual void | mousePressEvent (QMouseEvent *event) |
virtual void | mouseMoveEvent (QMouseEvent *event) |
virtual void | mouseReleaseEvent (QMouseEvent *event) |
virtual void | mouseDoubleClickEvent (QMouseEvent *event) |
virtual void | wheelEvent (QWheelEvent *event) |
virtual void | parentPlotInitialized (QCustomPlot *parentPlot) |
Protected Member Functions inherited from QCPLayerable | |
void | initializeParentPlot (QCustomPlot *parentPlot) |
void | setParentLayerable (QCPLayerable *parentLayerable) |
bool | moveToLayer (QCPLayer *layer, bool prepend) |
void | applyAntialiasingHint (QCPPainter *painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const |
Protected Attributes | |
QCPAbstractPlottable * | mPlottable |
Protected Attributes inherited from QCPAbstractLegendItem | |
QCPLegend * | mParentLegend |
QFont | mFont |
QColor | mTextColor |
QFont | mSelectedFont |
QColor | mSelectedTextColor |
bool | mSelectable |
bool | mSelected |
Protected Attributes inherited from QCPLayoutElement | |
QCPLayout * | mParentLayout |
QSize | mMinimumSize |
QSize | mMaximumSize |
QRect | mRect |
QRect | mOuterRect |
QMargins | mMargins |
QMargins | mMinimumMargins |
QCP::MarginSides | mAutoMargins |
QHash< QCP::MarginSide, QCPMarginGroup * > | mMarginGroups |
Protected Attributes inherited from QCPLayerable | |
bool | mVisible |
QCustomPlot * | mParentPlot |
QPointer< QCPLayerable > | mParentLayerable |
QCPLayer * | mLayer |
bool | mAntialiased |
Additional Inherited Members | |
Public Types inherited from QCPLayoutElement | |
enum | UpdatePhase { upPreparation, upMargins, upLayout } |
Signals inherited from QCPAbstractLegendItem | |
void | selectionChanged (bool selected) |
void | selectableChanged (bool selectable) |
Signals inherited from QCPLayerable | |
void | layerChanged (QCPLayer *newLayer) |
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 2145 of file qcustomplot.h.
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 12817 of file qcustomplot.cpp.
|
protectedvirtual |
Implements QCPAbstractLegendItem.
Definition at line 12859 of file qcustomplot.cpp.
|
protected |
Definition at line 12848 of file qcustomplot.cpp.
|
protected |
Definition at line 12828 of file qcustomplot.cpp.
|
protected |
Definition at line 12838 of file qcustomplot.cpp.
|
protectedvirtual |
Returns the minimum size this layout element (the inner rect) may be compressed to.
if a minimum size (setMinimumSize) was not set manually, parent layouts consult this function to determine the minimum allowed size of this layout element. (A manual minimum size is considered set if it is non-zero.)
Reimplemented from QCPLayoutElement.
Definition at line 12888 of file qcustomplot.cpp.
|
inline |
Definition at line 2152 of file qcustomplot.h.
|
protected |
Definition at line 2156 of file qcustomplot.h.