Gra zręcznościowa „Straszna Epidemia"  V1.2
Projekt Wizualizacja Danych Sensorycznych Kewin Gałuszka rok akademicki 2019/2020
Dokumentacja klasy QCPLegend

Manages a legend inside a QCustomPlot. Więcej...

#include <qcustomplot.h>

Diagram dziedziczenia dla QCPLegend
Diagram współpracy dla QCPLegend:

Typy publiczne

enum  SelectablePart { spNone = 0x000, spLegendBox = 0x001, spItems = 0x002 }
 
- Typy publiczne dziedziczone z QCPLayoutGrid
enum  FillOrder { foRowsFirst, foColumnsFirst }
 
- Typy publiczne dziedziczone z QCPLayoutElement
enum  UpdatePhase { upPreparation, upMargins, upLayout }
 
enum  SizeConstraintRect { scrInnerRect, scrOuterRect }
 

Sygnały

void selectionChanged (QCPLegend::SelectableParts parts)
 
void selectableChanged (QCPLegend::SelectableParts parts)
 
- Sygnały dziedziczone z QCPLayerable
void layerChanged (QCPLayer *newLayer)
 

Metody publiczne

 QCPLegend ()
 
virtual ~QCPLegend ()
 
QPen borderPen () const
 
QBrush brush () const
 
QFont font () const
 
QColor textColor () const
 
QSize iconSize () const
 
int iconTextPadding () const
 
QPen iconBorderPen () const
 
SelectableParts selectableParts () const
 
SelectableParts selectedParts () const
 
QPen selectedBorderPen () const
 
QPen selectedIconBorderPen () const
 
QBrush selectedBrush () const
 
QFont selectedFont () const
 
QColor selectedTextColor () const
 
void setBorderPen (const QPen &pen)
 
void setBrush (const QBrush &brush)
 
void setFont (const QFont &font)
 
void setTextColor (const QColor &color)
 
void setIconSize (const QSize &size)
 
void setIconSize (int width, int height)
 
void setIconTextPadding (int padding)
 
void setIconBorderPen (const QPen &pen)
 
Q_SLOT void setSelectableParts (const SelectableParts &selectableParts)
 
Q_SLOT void setSelectedParts (const SelectableParts &selectedParts)
 
void setSelectedBorderPen (const QPen &pen)
 
void setSelectedIconBorderPen (const QPen &pen)
 
void setSelectedBrush (const QBrush &brush)
 
void setSelectedFont (const QFont &font)
 
void setSelectedTextColor (const QColor &color)
 
virtual double selectTest (const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
 
QCPAbstractLegendItemitem (int index) const
 
QCPPlottableLegendItemitemWithPlottable (const QCPAbstractPlottable *plottable) const
 
int itemCount () const
 
bool hasItem (QCPAbstractLegendItem *item) const
 
bool hasItemWithPlottable (const QCPAbstractPlottable *plottable) const
 
bool addItem (QCPAbstractLegendItem *item)
 
bool removeItem (int index)
 
bool removeItem (QCPAbstractLegendItem *item)
 
void clearItems ()
 
QList< QCPAbstractLegendItem * > selectedItems () const
 
- Metody publiczne dziedziczone z QCPLayoutGrid
 QCPLayoutGrid ()
 
virtual ~QCPLayoutGrid ()
 
int rowCount () const
 
int columnCount () const
 
QList< double > columnStretchFactors () const
 
QList< double > rowStretchFactors () const
 
int columnSpacing () const
 
int rowSpacing () const
 
int wrap () const
 
FillOrder fillOrder () const
 
void setColumnStretchFactor (int column, double factor)
 
void setColumnStretchFactors (const QList< double > &factors)
 
void setRowStretchFactor (int row, double factor)
 
void setRowStretchFactors (const QList< double > &factors)
 
void setColumnSpacing (int pixels)
 
void setRowSpacing (int pixels)
 
void setWrap (int count)
 
void setFillOrder (FillOrder order, bool rearrange=true)
 
virtual void updateLayout () Q_DECL_OVERRIDE
 
virtual int elementCount () const Q_DECL_OVERRIDE
 
virtual QCPLayoutElementelementAt (int index) const Q_DECL_OVERRIDE
 
virtual QCPLayoutElementtakeAt (int index) Q_DECL_OVERRIDE
 
virtual bool take (QCPLayoutElement *element) Q_DECL_OVERRIDE
 
virtual QList< QCPLayoutElement * > elements (bool recursive) const Q_DECL_OVERRIDE
 
virtual void simplify () Q_DECL_OVERRIDE
 
virtual QSize minimumOuterSizeHint () const Q_DECL_OVERRIDE
 
virtual QSize maximumOuterSizeHint () const Q_DECL_OVERRIDE
 
QCPLayoutElementelement (int row, int column) const
 
bool addElement (int row, int column, QCPLayoutElement *element)
 
bool addElement (QCPLayoutElement *element)
 
bool hasElement (int row, int column)
 
void expandTo (int newRowCount, int newColumnCount)
 
void insertRow (int newIndex)
 
void insertColumn (int newIndex)
 
int rowColToIndex (int row, int column) const
 
void indexToRowCol (int index, int &row, int &column) const
 
- Metody publiczne dziedziczone z QCPLayout
 QCPLayout ()
 
virtual void update (UpdatePhase phase) Q_DECL_OVERRIDE
 
bool removeAt (int index)
 
bool remove (QCPLayoutElement *element)
 
void clear ()
 
- Metody publiczne dziedziczone z QCPLayoutElement
 QCPLayoutElement (QCustomPlot *parentPlot=0)
 
virtual ~QCPLayoutElement ()
 
QCPLayoutlayout () const
 
QRect rect () const
 
QRect outerRect () const
 
QMargins margins () const
 
QMargins minimumMargins () const
 
QCP::MarginSides autoMargins () const
 
QSize minimumSize () const
 
QSize maximumSize () const
 
SizeConstraintRect sizeConstraintRect () const
 
QCPMarginGroupmarginGroup (QCP::MarginSide side) const
 
QHash< QCP::MarginSide, QCPMarginGroup * > marginGroups () const
 
void setOuterRect (const QRect &rect)
 
void setMargins (const QMargins &margins)
 
void setMinimumMargins (const QMargins &margins)
 
void setAutoMargins (QCP::MarginSides sides)
 
void setMinimumSize (const QSize &size)
 
void setMinimumSize (int width, int height)
 
void setMaximumSize (const QSize &size)
 
void setMaximumSize (int width, int height)
 
void setSizeConstraintRect (SizeConstraintRect constraintRect)
 
void setMarginGroup (QCP::MarginSides sides, QCPMarginGroup *group)
 
- Metody publiczne dziedziczone z QCPLayerable
 QCPLayerable (QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=0)
 
virtual ~QCPLayerable ()
 
bool visible () const
 
QCustomPlotparentPlot () const
 
QCPLayerableparentLayerable () const
 
QCPLayerlayer () const
 
bool antialiased () const
 
void setVisible (bool on)
 
Q_SLOT bool setLayer (QCPLayer *layer)
 
bool setLayer (const QString &layerName)
 
void setAntialiased (bool enabled)
 
bool realVisibility () const
 

Metody chronione

virtual void parentPlotInitialized (QCustomPlot *parentPlot) Q_DECL_OVERRIDE
 
virtual QCP::Interaction selectionCategory () const Q_DECL_OVERRIDE
 
virtual void applyDefaultAntialiasingHint (QCPPainter *painter) const Q_DECL_OVERRIDE
 
virtual void draw (QCPPainter *painter) Q_DECL_OVERRIDE
 
virtual void selectEvent (QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) Q_DECL_OVERRIDE
 
virtual void deselectEvent (bool *selectionStateChanged) Q_DECL_OVERRIDE
 
QPen getBorderPen () const
 
QBrush getBrush () const
 
- Metody chronione dziedziczone z QCPLayoutGrid
void getMinimumRowColSizes (QVector< int > *minColWidths, QVector< int > *minRowHeights) const
 
void getMaximumRowColSizes (QVector< int > *maxColWidths, QVector< int > *maxRowHeights) const
 
- Metody chronione dziedziczone z QCPLayout
void sizeConstraintsChanged () const
 
void adoptElement (QCPLayoutElement *el)
 
void releaseElement (QCPLayoutElement *el)
 
QVector< int > getSectionSizes (QVector< int > maxSizes, QVector< int > minSizes, QVector< double > stretchFactors, int totalSize) const
 
- Metody chronione dziedziczone z QCPLayoutElement
virtual int calculateAutoMargin (QCP::MarginSide side)
 
virtual void layoutChanged ()
 
- Metody chronione dziedziczone z QCPLayerable
virtual QRect clipRect () const
 
virtual void mousePressEvent (QMouseEvent *event, const QVariant &details)
 
virtual void mouseMoveEvent (QMouseEvent *event, const QPointF &startPos)
 
virtual void mouseReleaseEvent (QMouseEvent *event, const QPointF &startPos)
 
virtual void mouseDoubleClickEvent (QMouseEvent *event, const QVariant &details)
 
virtual void wheelEvent (QWheelEvent *event)
 
void initializeParentPlot (QCustomPlot *parentPlot)
 
void setParentLayerable (QCPLayerable *parentLayerable)
 
bool moveToLayer (QCPLayer *layer, bool prepend)
 
void applyAntialiasingHint (QCPPainter *painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const
 

Atrybuty chronione

QPen mBorderPen
 
QPen mIconBorderPen
 
QBrush mBrush
 
QFont mFont
 
QColor mTextColor
 
QSize mIconSize
 
int mIconTextPadding
 
SelectableParts mSelectedParts
 
SelectableParts mSelectableParts
 
QPen mSelectedBorderPen
 
QPen mSelectedIconBorderPen
 
QBrush mSelectedBrush
 
QFont mSelectedFont
 
QColor mSelectedTextColor
 
- Atrybuty chronione dziedziczone z QCPLayoutGrid
QList< QList< QCPLayoutElement * > > mElements
 
QList< double > mColumnStretchFactors
 
QList< double > mRowStretchFactors
 
int mColumnSpacing
 
int mRowSpacing
 
int mWrap
 
FillOrder mFillOrder
 
- Atrybuty chronione dziedziczone z QCPLayoutElement
QCPLayoutmParentLayout
 
QSize mMinimumSize
 
QSize mMaximumSize
 
SizeConstraintRect mSizeConstraintRect
 
QRect mRect
 
QRect mOuterRect
 
QMargins mMargins
 
QMargins mMinimumMargins
 
QCP::MarginSides mAutoMargins
 
QHash< QCP::MarginSide, QCPMarginGroup * > mMarginGroups
 
- Atrybuty chronione dziedziczone z QCPLayerable
bool mVisible
 
QCustomPlotmParentPlot
 
QPointer< QCPLayerablemParentLayerable
 
QCPLayermLayer
 
bool mAntialiased
 

Przyjaciele

class QCustomPlot
 
class QCPAbstractLegendItem
 

Dodatkowe Dziedziczone Składowe

- Statyczne metody chronione dziedziczone z QCPLayout
static QSize getFinalMinimumOuterSize (const QCPLayoutElement *el)
 
static QSize getFinalMaximumOuterSize (const QCPLayoutElement *el)
 

Opis szczegółowy

Manages a legend inside a QCustomPlot.

A legend is a small box somewhere in the plot which lists plottables with their name and icon.

A legend is populated with legend items by calling QCPAbstractPlottable::addToLegend on the plottable, for which a legend item shall be created. In the case of the main legend (QCustomPlot::legend), simply adding plottables to the plot while QCustomPlot::setAutoAddPlottableToLegend is set to true (the default) creates corresponding legend items. The legend item associated with a certain plottable can be removed with QCPAbstractPlottable::removeFromLegend. However, QCPLegend also offers an interface to add and manipulate legend items directly: item, itemWithPlottable, itemCount, addItem, removeItem, etc.

Since QCPLegend derives from QCPLayoutGrid, it can be placed in any position a QCPLayoutElement may be positioned. The legend items are themselves QCPLayoutElements which are placed in the grid layout of the legend. QCPLegend only adds an interface specialized for handling child elements of type QCPAbstractLegendItem, as mentioned above. In principle, any other layout elements may also be added to a legend via the normal QCPLayoutGrid interface. See the special page about The Layout System for examples on how to add other elements to the legend and move it outside the axis rect.

Use the methods setFillOrder and setWrap inherited from QCPLayoutGrid to control in which order (column first or row first) the legend is filled up when calling addItem, and at which column or row wrapping occurs. The default fill order for legends is foRowsFirst.

By default, every QCustomPlot has one legend (QCustomPlot::legend) which is placed in the inset layout of the main axis rect (QCPAxisRect::insetLayout). To move the legend to another position inside the axis rect, use the methods of the QCPLayoutInset. To move the legend outside of the axis rect, place it anywhere else with the QCPLayout/ QCPLayoutElement interface.

Definicja w linii 4807 pliku qcustomplot.h.

Dokumentacja składowych wyliczanych

◆ SelectablePart

Defines the selectable parts of a legend

Zobacz również
setSelectedParts, setSelectableParts
Wartości wyliczeń
spNone 

0x000 None

spLegendBox 

0x001 The legend box (frame)

spItems 

0x002 Legend items individually (see selectedItems)

Definicja w linii 4832 pliku qcustomplot.h.

Dokumentacja konstruktora i destruktora

◆ QCPLegend()

QCPLegend::QCPLegend ( )
explicit

Constructs a new QCPLegend instance with default values.

Note that by default, QCustomPlot already contains a legend ready to be used as QCustomPlot::legend

Definicja w linii 18327 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ ~QCPLegend()

QCPLegend::~QCPLegend ( )
virtual

Definicja w linii 18353 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

Dokumentacja funkcji składowych

◆ addItem()

bool QCPLegend::addItem ( QCPAbstractLegendItem item)

Adds item to the legend, if it's not present already. The element is arranged according to the current fill order (setFillOrder) and wrapping (setWrap).

Returns true on sucess, i.e. if the item wasn't in the list already and has been successfuly added.

The legend takes ownership of the item.

Zobacz również
removeItem, item, hasItem

Definicja w linii 18682 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:
Oto graf wywoływań tej funkcji:

◆ applyDefaultAntialiasingHint()

void QCPLegend::applyDefaultAntialiasingHint ( QCPPainter painter) const
protectedvirtual

Reimplementowana z QCPLayoutElement.

Definicja w linii 18776 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ borderPen()

QPen QCPLegend::borderPen ( ) const
inline

Definicja w linii 4844 pliku qcustomplot.h.

◆ brush()

QBrush QCPLegend::brush ( ) const
inline

Definicja w linii 4845 pliku qcustomplot.h.

Oto graf wywoływań tej funkcji:

◆ clearItems()

void QCPLegend::clearItems ( )

Removes all items from the legend.

Definicja w linii 18735 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:
Oto graf wywoływań tej funkcji:

◆ deselectEvent()

void QCPLegend::deselectEvent ( bool *  selectionStateChanged)
protectedvirtual

Reimplementowana z QCPLayerable.

Definicja w linii 18844 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ draw()

void QCPLegend::draw ( QCPPainter painter)
protectedvirtual

Reimplementowana z QCPLayoutElement.

Definicja w linii 18806 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ font()

QFont QCPLegend::font ( ) const
inline

Definicja w linii 4846 pliku qcustomplot.h.

Oto graf wywoływań tej funkcji:

◆ getBorderPen()

QPen QCPLegend::getBorderPen ( ) const
protected

Definicja w linii 18786 pliku qcustomplot.cpp.

Oto graf wywoływań tej funkcji:

◆ getBrush()

QBrush QCPLegend::getBrush ( ) const
protected

Definicja w linii 18796 pliku qcustomplot.cpp.

Oto graf wywoływań tej funkcji:

◆ hasItem()

bool QCPLegend::hasItem ( QCPAbstractLegendItem item) const

Returns whether the legend contains item.

Zobacz również
hasItemWithPlottable

Definicja w linii 18651 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ hasItemWithPlottable()

bool QCPLegend::hasItemWithPlottable ( const QCPAbstractPlottable plottable) const

Returns whether the legend contains a QCPPlottableLegendItem which is associated with plottable (e.g. a QCPGraph*). If such an item isn't in the legend, returns false.

Zobacz również
itemWithPlottable

Definicja w linii 18667 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:
Oto graf wywoływań tej funkcji:

◆ iconBorderPen()

QPen QCPLegend::iconBorderPen ( ) const
inline

Definicja w linii 4850 pliku qcustomplot.h.

Oto graf wywoływań tej funkcji:

◆ iconSize()

QSize QCPLegend::iconSize ( ) const
inline

Definicja w linii 4848 pliku qcustomplot.h.

Oto graf wywoływań tej funkcji:

◆ iconTextPadding()

int QCPLegend::iconTextPadding ( ) const
inline

Definicja w linii 4849 pliku qcustomplot.h.

Oto graf wywoływań tej funkcji:

◆ item()

QCPAbstractLegendItem * QCPLegend::item ( int  index) const

Returns the item with index i.

Note that the linear index depends on the current fill order (setFillOrder).

Zobacz również
itemCount, addItem, itemWithPlottable

Definicja w linii 18609 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:
Oto graf wywoływań tej funkcji:

◆ itemCount()

int QCPLegend::itemCount ( ) const

Returns the number of items currently in the legend.

Note that if empty cells are in the legend (e.g. by calling methods of the QCPLayoutGrid base class which allows creating empty cells), they are included in the returned count.

Zobacz również
item

Definicja w linii 18641 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:
Oto graf wywoływań tej funkcji:

◆ itemWithPlottable()

QCPPlottableLegendItem * QCPLegend::itemWithPlottable ( const QCPAbstractPlottable plottable) const

Returns the QCPPlottableLegendItem which is associated with plottable (e.g. a QCPGraph*). If such an item isn't in the legend, returns 0.

Zobacz również
hasItemWithPlottable

Definicja w linii 18620 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:
Oto graf wywoływań tej funkcji:

◆ parentPlotInitialized()

void QCPLegend::parentPlotInitialized ( QCustomPlot parentPlot)
protectedvirtual

Reimplementowana z QCPLayoutElement.

Definicja w linii 18869 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ removeItem() [1/2]

bool QCPLegend::removeItem ( int  index)

To jest metoda przeciążona, udostępniona dla wygody. Różni się od powyższej metody tylko zestawem akceptowanych argumentów.

Removes the item with the specified index from the legend and deletes it.

After successful removal, the legend is reordered according to the current fill order (setFillOrder) and wrapping (setWrap), so no empty cell remains where the removed item was. If you don't want this, rather use the raw element interface of QCPLayoutGrid.

Returns true, if successful. Unlike QCPLayoutGrid::removeAt, this method only removes elements derived from QCPAbstractLegendItem.

Zobacz również
itemCount, clearItems

Definicja w linii 18700 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:
Oto graf wywoływań tej funkcji:

◆ removeItem() [2/2]

bool QCPLegend::removeItem ( QCPAbstractLegendItem item)

To jest metoda przeciążona, udostępniona dla wygody. Różni się od powyższej metody tylko zestawem akceptowanych argumentów.

Removes item from the legend and deletes it.

After successful removal, the legend is reordered according to the current fill order (setFillOrder) and wrapping (setWrap), so no empty cell remains where the removed item was. If you don't want this, rather use the raw element interface of QCPLayoutGrid.

Returns true, if successful.

Zobacz również
clearItems

Definicja w linii 18724 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ selectableChanged

void QCPLegend::selectableChanged ( QCPLegend::SelectableParts  parts)
signal
Oto graf wywoływań tej funkcji:

◆ selectableParts()

SelectableParts QCPLegend::selectableParts ( ) const
inline

Definicja w linii 4851 pliku qcustomplot.h.

Oto graf wywoływań tej funkcji:

◆ selectedBorderPen()

QPen QCPLegend::selectedBorderPen ( ) const
inline

Definicja w linii 4853 pliku qcustomplot.h.

◆ selectedBrush()

QBrush QCPLegend::selectedBrush ( ) const
inline

Definicja w linii 4855 pliku qcustomplot.h.

◆ selectedFont()

QFont QCPLegend::selectedFont ( ) const
inline

Definicja w linii 4856 pliku qcustomplot.h.

◆ selectedIconBorderPen()

QPen QCPLegend::selectedIconBorderPen ( ) const
inline

Definicja w linii 4854 pliku qcustomplot.h.

Oto graf wywoływań tej funkcji:

◆ selectedItems()

QList< QCPAbstractLegendItem * > QCPLegend::selectedItems ( ) const

Returns the legend items that are currently selected. If no items are selected, the list is empty.

Zobacz również
QCPAbstractLegendItem::setSelected, setSelectable

Definicja w linii 18747 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ selectedParts()

QCPLegend::SelectableParts QCPLegend::selectedParts ( ) const

Definicja w linii 18361 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:
Oto graf wywoływań tej funkcji:

◆ selectedTextColor()

QColor QCPLegend::selectedTextColor ( ) const
inline

Definicja w linii 4857 pliku qcustomplot.h.

◆ selectEvent()

void QCPLegend::selectEvent ( QMouseEvent *  event,
bool  additive,
const QVariant &  details,
bool *  selectionStateChanged 
)
protectedvirtual

Reimplementowana z QCPLayerable.

Definicja w linii 18830 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ selectionCategory()

QCP::Interaction QCPLegend::selectionCategory ( ) const
protectedvirtual

Reimplementowana z QCPLayerable.

Definicja w linii 18857 pliku qcustomplot.cpp.

◆ selectionChanged

void QCPLegend::selectionChanged ( QCPLegend::SelectableParts  selection)
signal

This signal is emitted when the selection state of this legend has changed.

Zobacz również
setSelectedParts, setSelectableParts
Oto graf wywoływań tej funkcji:

◆ selectTest()

double QCPLegend::selectTest ( const QPointF &  pos,
bool  onlySelectable,
QVariant *  details = 0 
) const
virtual

Layout elements are sensitive to events inside their outer rect. If pos is within the outer rect, this method returns a value corresponding to 0.99 times the parent plot's selection tolerance. However, layout elements are not selectable by default. So if onlySelectable is true, -1.0 is returned.

See QCPLayerable::selectTest for a general explanation of this virtual method.

QCPLayoutElement subclasses may reimplement this method to provide more specific selection test behaviour.

Reimplementowana z QCPLayoutElement.

Definicja w linii 18815 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ setBorderPen()

void QCPLegend::setBorderPen ( const QPen &  pen)

Sets the pen, the border of the entire legend is drawn with.

Definicja w linii 18382 pliku qcustomplot.cpp.

Oto graf wywoływań tej funkcji:

◆ setBrush()

void QCPLegend::setBrush ( const QBrush &  brush)

Sets the brush of the legend background.

Definicja w linii 18390 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:
Oto graf wywoływań tej funkcji:

◆ setFont()

void QCPLegend::setFont ( const QFont &  font)

Sets the default font of legend text. Legend items that draw text (e.g. the name of a graph) will use this font by default. However, a different font can be specified on a per-item-basis by accessing the specific legend item.

This function will also set font on all already existing legend items.

Zobacz również
QCPAbstractLegendItem::setFont

Definicja w linii 18404 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ setIconBorderPen()

void QCPLegend::setIconBorderPen ( const QPen &  pen)

Sets the pen used to draw a border around each legend icon. Legend items that draw an icon (e.g. a visual representation of the graph) will use this pen by default.

If no border is wanted, set this to Qt::NoPen.

Definicja w linii 18466 pliku qcustomplot.cpp.

Oto graf wywoływań tej funkcji:

◆ setIconSize() [1/2]

void QCPLegend::setIconSize ( const QSize &  size)

Sets the size of legend icons. Legend items that draw an icon (e.g. a visual representation of the graph) will use this size by default.

Definicja w linii 18437 pliku qcustomplot.cpp.

Oto graf wywoływań tej funkcji:

◆ setIconSize() [2/2]

void QCPLegend::setIconSize ( int  width,
int  height 
)

To jest metoda przeciążona, udostępniona dla wygody. Różni się od powyższej metody tylko zestawem akceptowanych argumentów.

Definicja w linii 18444 pliku qcustomplot.cpp.

◆ setIconTextPadding()

void QCPLegend::setIconTextPadding ( int  padding)

Sets the horizontal space in pixels between the legend icon and the text next to it. Legend items that draw an icon (e.g. a visual representation of the graph) and text (e.g. the name of the graph) will use this space by default.

Definicja w linii 18455 pliku qcustomplot.cpp.

Oto graf wywoływań tej funkcji:

◆ setSelectableParts()

void QCPLegend::setSelectableParts ( const SelectableParts &  selectable)

Sets whether the user can (de-)select the parts in selectable by clicking on the QCustomPlot surface. (When QCustomPlot::setInteractions contains QCP::iSelectLegend.)

However, even when selectable is set to a value not allowing the selection of a specific part, it is still possible to set the selection of this part manually, by calling setSelectedParts directly.

Zobacz również
SelectablePart, setSelectedParts

Definicja w linii 18481 pliku qcustomplot.cpp.

Oto graf wywoływań tej funkcji:

◆ setSelectedBorderPen()

void QCPLegend::setSelectedBorderPen ( const QPen &  pen)

When the legend box is selected, this pen is used to draw the border instead of the normal pen set via setBorderPen.

Zobacz również
setSelectedParts, setSelectableParts, setSelectedBrush

Definicja w linii 18542 pliku qcustomplot.cpp.

Oto graf wywoływań tej funkcji:

◆ setSelectedBrush()

void QCPLegend::setSelectedBrush ( const QBrush &  brush)

When the legend box is selected, this brush is used to draw the legend background instead of the normal brush set via setBrush.

Zobacz również
setSelectedParts, setSelectableParts, setSelectedBorderPen

Definicja w linii 18563 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:
Oto graf wywoływań tej funkcji:

◆ setSelectedFont()

void QCPLegend::setSelectedFont ( const QFont &  font)

Sets the default font that is used by legend items when they are selected.

This function will also set font on all already existing legend items.

Zobacz również
setFont, QCPAbstractLegendItem::setSelectedFont

Definicja w linii 18575 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ setSelectedIconBorderPen()

void QCPLegend::setSelectedIconBorderPen ( const QPen &  pen)

Sets the pen legend items will use to draw their icon borders, when they are selected.

Zobacz również
setSelectedParts, setSelectableParts, setSelectedFont

Definicja w linii 18552 pliku qcustomplot.cpp.

Oto graf wywoływań tej funkcji:

◆ setSelectedParts()

void QCPLegend::setSelectedParts ( const SelectableParts &  selected)

Sets the selected state of the respective legend parts described by SelectablePart. When a part is selected, it uses a different pen/font and brush. If some legend items are selected and selected doesn't contain spItems, those items become deselected.

The entire selection mechanism is handled automatically when QCustomPlot::setInteractions contains iSelectLegend. You only need to call this function when you wish to change the selection state manually.

This function can change the selection state of a part even when setSelectableParts was set to a value that actually excludes the part.

emits the selectionChanged signal when selected is different from the previous selection state.

Note that it doesn't make sense to set the selected state spItems here when it wasn't set before, because there's no way to specify which exact items to newly select. Do this by calling QCPAbstractLegendItem::setSelected directly on the legend item you wish to select.

Zobacz również
SelectablePart, setSelectableParts, selectTest, setSelectedBorderPen, setSelectedIconBorderPen, setSelectedBrush, setSelectedFont

Definicja w linii 18511 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:
Oto graf wywoływań tej funkcji:

◆ setSelectedTextColor()

void QCPLegend::setSelectedTextColor ( const QColor &  color)

Sets the default text color that is used by legend items when they are selected.

This function will also set color on all already existing legend items.

Zobacz również
setTextColor, QCPAbstractLegendItem::setSelectedTextColor

Definicja w linii 18592 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:
Oto graf wywoływań tej funkcji:

◆ setTextColor()

void QCPLegend::setTextColor ( const QColor &  color)

Sets the default color of legend text. Legend items that draw text (e.g. the name of a graph) will use this color by default. However, a different colors can be specified on a per-item-basis by accessing the specific legend item.

This function will also set color on all already existing legend items.

Zobacz również
QCPAbstractLegendItem::setTextColor

Definicja w linii 18423 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:
Oto graf wywoływań tej funkcji:

◆ textColor()

QColor QCPLegend::textColor ( ) const
inline

Definicja w linii 4847 pliku qcustomplot.h.

Dokumentacja przyjaciół i funkcji związanych

◆ QCPAbstractLegendItem

friend class QCPAbstractLegendItem
friend

Definicja w linii 4926 pliku qcustomplot.h.

◆ QCustomPlot

friend class QCustomPlot
friend

Definicja w linii 4925 pliku qcustomplot.h.

Dokumentacja atrybutów składowych

◆ mBorderPen

QPen QCPLegend::mBorderPen
protected

Definicja w linii 4897 pliku qcustomplot.h.

◆ mBrush

QBrush QCPLegend::mBrush
protected

Definicja w linii 4898 pliku qcustomplot.h.

◆ mFont

QFont QCPLegend::mFont
protected

Definicja w linii 4899 pliku qcustomplot.h.

◆ mIconBorderPen

QPen QCPLegend::mIconBorderPen
protected

Definicja w linii 4897 pliku qcustomplot.h.

◆ mIconSize

QSize QCPLegend::mIconSize
protected

Definicja w linii 4901 pliku qcustomplot.h.

◆ mIconTextPadding

int QCPLegend::mIconTextPadding
protected

Definicja w linii 4902 pliku qcustomplot.h.

◆ mSelectableParts

SelectableParts QCPLegend::mSelectableParts
protected

Definicja w linii 4903 pliku qcustomplot.h.

◆ mSelectedBorderPen

QPen QCPLegend::mSelectedBorderPen
protected

Definicja w linii 4904 pliku qcustomplot.h.

◆ mSelectedBrush

QBrush QCPLegend::mSelectedBrush
protected

Definicja w linii 4905 pliku qcustomplot.h.

◆ mSelectedFont

QFont QCPLegend::mSelectedFont
protected

Definicja w linii 4906 pliku qcustomplot.h.

◆ mSelectedIconBorderPen

QPen QCPLegend::mSelectedIconBorderPen
protected

Definicja w linii 4904 pliku qcustomplot.h.

◆ mSelectedParts

SelectableParts QCPLegend::mSelectedParts
protected

Definicja w linii 4903 pliku qcustomplot.h.

◆ mSelectedTextColor

QColor QCPLegend::mSelectedTextColor
protected

Definicja w linii 4907 pliku qcustomplot.h.

◆ mTextColor

QColor QCPLegend::mTextColor
protected

Definicja w linii 4900 pliku qcustomplot.h.


Dokumentacja dla tej klasy została wygenerowana z plików: