Aquila
2.0 prealpha
Cognitive Robotics Architecture
|
The abstract base class for all items in a QCPLegend. More...
#include <plot2d.h>
Signals | |
void | selectionChanged (bool selected) |
Public Member Functions | |
QCPAbstractLegendItem (QCPLegend *parent) | |
virtual | ~QCPAbstractLegendItem () |
bool | antialiased () const |
QFont | font () const |
QColor | textColor () const |
QFont | selectedFont () const |
QColor | selectedTextColor () const |
bool | selectable () const |
bool | selected () const |
void | setAntialiased (bool enabled) |
void | setFont (const QFont &font) |
void | setTextColor (const QColor &color) |
void | setSelectedFont (const QFont &font) |
void | setSelectedTextColor (const QColor &color) |
void | setSelectable (bool selectable) |
void | setSelected (bool selected) |
Protected Member Functions | |
virtual void | draw (QCPPainter *painter, const QRect &rect) const =0 |
virtual QSize | size (const QSize &targetSize) const =0 |
void | applyAntialiasingHint (QCPPainter *painter) const |
Protected Attributes | |
QCPLegend * | mParentLegend |
bool | mAntialiased |
QFont | mFont |
QColor | mTextColor |
QFont | mSelectedFont |
QColor | mSelectedTextColor |
bool | mSelectable |
bool | mSelected |
Friends | |
class | QCPLegend |
The abstract base class for all items in a QCPLegend.
It defines a very basic interface to items in a QCPLegend. For representing plottables in the legend, the subclass QCPPlottableLegendItem is more suitable.
Only derive directly from this class when you need absolute freedom (i.e. a legend item that's not associated with a plottable).
You must implement the following pure virtual functions:
You inherit the following members you may use:
QCPLegend *mParentLegend | A pointer to the parent QCPLegend. |
QFont mFont | The generic font of the item. You should use this font for all or at least the most prominent text of the item. |
QCPAbstractLegendItem::QCPAbstractLegendItem | ( | QCPLegend * | parent | ) |
Constructs a QCPAbstractLegendItem and associates it with the QCPLegend parent. This does not cause the item to be added to parent, so QCPLegend::addItem must be called separately.
|
inlinevirtual |
|
inline |
|
protected |
|
protectedpure virtual |
Draws this legend item with painter inside the specified rect. The rect typically has the size which was returned from a preceding size call.
Implemented in QCPPlottableLegendItem.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
signal |
This signal is emitted when the selection state of this legend item has changed, either by user interaction or by a direct call to setSelected.
void QCPAbstractLegendItem::setAntialiased | ( | bool | enabled | ) |
Sets whether this legend item is drawn antialiased or not.
Note that this setting may be overridden by QCustomPlot::setAntialiasedElements and QCustomPlot::setNotAntialiasedElements.
void QCPAbstractLegendItem::setFont | ( | const QFont & | font | ) |
Sets the default font of this specific legend item to font.
void QCPAbstractLegendItem::setSelectable | ( | bool | selectable | ) |
Sets whether this specific legend item is selectable.
void QCPAbstractLegendItem::setSelected | ( | bool | selected | ) |
Sets whether this specific legend item is selected. The selection state of the parent QCPLegend is updated correspondingly.
It is possible to set the selection state of this item by calling this function directly, even if setSelectable is set to false.
void QCPAbstractLegendItem::setSelectedFont | ( | const QFont & | font | ) |
When this legend item is selected, font is used to draw generic text, instead of the normal font set with setFont.
void QCPAbstractLegendItem::setSelectedTextColor | ( | const QColor & | color | ) |
When this legend item is selected, color is used to draw generic text, instead of the normal color set with setTextColor.
void QCPAbstractLegendItem::setTextColor | ( | const QColor & | color | ) |
Sets the default text color of this specific legend item to color.
|
protectedpure virtual |
Returns the size this item occupies in the legend. The legend will adapt its layout with the help of this function. If this legend item can have a variable width (e.g. auto-wrapping text), this function tries to find a size with a width close to the width of targetSize. The height of targetSize only may have meaning in specific sublasses. Typically, it's ignored.
Implemented in QCPPlottableLegendItem.
|
inline |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |