JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
Loading...
Searching...
No Matches

concrete class for drawing the main plot key (or legend). This class reads the key entries from the graphs list of its parent JKQTBasePlotter und references the JKQTPKeyStyle object from JKQTBasePlotterStyle::keyStyle in the parent JKQTBasePlotter. More...

#include <jkqtpkey.h>

Inheritance diagram for JKQTPMainKey:
[legend]
Collaboration diagram for JKQTPMainKey:
[legend]

Public Member Functions

 JKQTPMainKey (JKQTBasePlotter *parent)
 class constructor
 
virtual ~JKQTPMainKey ()
 class destructor
 
- Public Member Functions inherited from JKQTPBaseKey
 JKQTPBaseKey (JKQTBasePlotter *parent)
 class constructor
 
virtual ~JKQTPBaseKey ()
 class destructor
 
virtual void drawKey (JKQTPEnhancedPainter &painter, const QRectF &rect, const KeySizeDescription &layout)
 draw the key
 
const QBrush & getBackgroundBrush () const
 color of the key background
 
QColor getBackgroundColor () const
 color of the key background
 
double getColumnSeparation () const
 distance between two columns of key entries [in units of width of 'X' set in fontName, fontSize]
 
const JKQTPKeyStylegetCurrentKeyStyle () const
 current style properties (JKQTPKeyStyle) for this JKQTPKey
 
double getFontSize () const
 font size for key labels [in points]
 
QColor getFrameColor () const
 color of the key frame line
 
Qt::PenStyle getFrameLineStyle () const
 linestyle for the frame
 
double getFrameRounding () const
 rounding radius of the key frame rectangle (<=0 -> no rounded rectangle) [pt]
 
bool getFrameVisible () const
 indicates whether to plot a frame around the key
 
double getFrameWidth () const
 width of the key frame line [pt]
 
JKQTPKeyLayout getLayout () const
 the key layout, i.e. how the entries are distributed over the available space, see JKQTPKeyLayout for details and examples
 
JKQTBasePlottergetParent ()
 parent plotter class
 
const JKQTBasePlottergetParent () const
 parent plotter class
 
JKQTPKeyPosition getPosition () const
 key position inside or besides the plot area, see JKQTPKeyPositions for details and examples
 
double getSampleLineLength () const
 length of the line samples in the key [in units of width of 'X' set in fontName, fontSize]
 
KeySizeDescription getSize (JKQTPEnhancedPainter &painter)
 calculates the size required for the key
 
QColor getTextColor () const
 color of the key entries' text
 
bool getVisible () const
 indicates whether to plot a key
 
double getXMargin () const
 x-distance between key frame and key content [in units of width of 'X' set in fontName, fontSize]
 
double getXOffset () const
 x-offset of the key from the border of the plot [in units of width of 'X' set in fontName, fontSize]
 
double getXSeparation () const
 distance between key line example and key text [in units of width of 'X' set in fontName, fontSize]
 
double getYMargin () const
 y-distance between key frame and key content [in units of width of 'X' set in fontName, fontSize]
 
double getYOffset () const
 y-offset of the key from the border of the plot [in units of width of 'X' set in fontName, fontSize]
 
double getYSeparation () const
 distance between two key entries [in units of height of fontName, fontSize]
 
virtual void loadSettings (const QSettings &settings, const QString &group=QString("plots/key/"))
 loads the plot properties from a QSettings object
 
virtual void modifySize (JKQTPEnhancedPainter &painter, KeySizeDescription &currentSize, QSizeF preliminaryPlotSize)
 econd stage of size calculation
 
virtual void saveSettings (QSettings &settings, const QString &group=QString("plots/key/")) const
 saves the plot properties into a QSettings object.
 
void setCurrentKeyStyle (const JKQTPKeyStyle &style)
 replace the current style properties for this JKQTPKey
 
virtual void setParent (JKQTBasePlotter *parent)
 

Protected Member Functions

virtual void drawEntrySample (int item, JKQTPEnhancedPainter &painter, const QRectF &rect) override
 draws the sample for legend entry item into the given rect, using the given painter

 
virtual QColor getEntryColor (int item) const override
 returns the label color of legend entry item 's text part
 
virtual int getEntryCount () const override
 returns the number of legend entries
 
virtual QString getEntryText (int item) const override
 returns the label text (my contain markup for a JKQTMathText) of legend entry item 's text part
 
JKQTPPlotElementgetPlotElement (int item)
 returns the graph class from parent JKQTBasePlotter for the given item in the key
 
const JKQTPPlotElementgetPlotElement (int item) const
 returns the graph class from parent JKQTBasePlotter for the given item in the key
 
QList< const JKQTPPlotElement * > getPlotElements () const
 returns all graph classes from parent JKQTBasePlotter for the key
 
virtual JKQTPKeyStylekeyStyle ()
 provides the keyStyle to use for sizing/drawing this object
 
virtual const JKQTPKeyStylekeyStyle () const
 provides the keyStyle to use for sizing/drawing this object (extracted from the parent JKQTBasePlotters's

 
- Protected Member Functions inherited from JKQTPBaseKey
void calcLayoutSize (JKQTPEnhancedPainter &painter, KeySizeDescription &layout) const
 fill KeySizeDescription::requiredSize
 
virtual QSizeF extendLayoutSize (QSizeF rawLayoutSize, JKQTPEnhancedPainter &painter, QPointF *offset=nullptr) const
 takes the size calculated by KeyLayoutDescription::calcOverallWidth() and KeyLayoutDescription::calcOverallHeight() and extends it with margins, line widths, ... optionally returns the one-sided offset
 
virtual KeyLayoutDescription getKeyLayout (JKQTPEnhancedPainter &painter)
 calculates all layout properties of the key/legend,necessary to size and draw it
 
JKQTMathTextgetParentMathText ()
 retun parents JKQTMathText* object
 
const JKQTMathTextgetParentMathText () const
 retun parents JKQTMathText* object
 
void redrawPlot ()
 signals the parent JKQTBasePlotter to redraw
 

Additional Inherited Members

- Public Slots inherited from JKQTPBaseKey
void setBackgroundBrush (const QBrush &__value)
 color of the key background
 
void setBackgroundColor (QColor __value)
 color of the key background
 
void setBackgroundColor (QColor __value, Qt::BrushStyle __style)
 color of the key background
 
void setColumnSeparation (double __value)
 distance between two columns of key entries [in units of width of 'X' set in fontName, fontSize]
 
void setFontSize (double __value)
 font size for key labels [in points]
 
void setFrameColor (QColor __value)
 color of the key frame line
 
void setFrameLineStyle (Qt::PenStyle __value)
 linestyle for the frame
 
void setFrameRounding (double __value)
 rounding radius of the key frame rectangle (<=0 -> no rounded rectangle) [pt]
 
void setFrameVisible (bool __value)
 indicates whether to plot a frame around the key
 
void setFrameWidth (double __value)
 width of the key frame line [pt]
 
void setLayout (JKQTPKeyLayout __value)
 the key layout, i.e. how the entries are distributed over the available space, see JKQTPKeyLayout for details and examples
 
void setPosition (JKQTPKeyPosition __value)
 key position inside or besides the plot area, see JKQTPKeyPositions for details and examples
 
void setSampleLineLength (double __value)
 length of the line samples in the key [in units of width of 'X' set in fontName, fontSize]
 
void setTextColor (QColor __value)
 color of the key entries' text
 
void setVisible (bool __value)
 indicates whether to plot a key
 
void setXMargin (double __value)
 x-distance between key frame and key content [in units of width of 'X' set in fontName, fontSize]
 
void setXOffset (double __value)
 x-offset of the key from the border of the plot [in units of width of 'X' set in fontName, fontSize]
 
void setXSeparation (double __value)
 distance between key line example and key text [in units of width of 'X' set in fontName, fontSize]
 
void setYMargin (double __value)
 y-distance between key frame and key content [in units of width of 'X' set in fontName, fontSize]
 
void setYOffset (double __value)
 y-offset of the key from the border of the plot [in units of width of 'X' set in fontName, fontSize]
 
void setYSeparation (double __value)
 distance between two key entries [in units of height of fontName, fontSize]
 
- Protected Attributes inherited from JKQTPBaseKey
JKQTBasePlotterparent
 parent plotter class
 

Detailed Description

concrete class for drawing the main plot key (or legend). This class reads the key entries from the graphs list of its parent JKQTBasePlotter und references the JKQTPKeyStyle object from JKQTBasePlotterStyle::keyStyle in the parent JKQTBasePlotter.

See also
JKQTPKeyStyle

Constructor & Destructor Documentation

◆ JKQTPMainKey()

JKQTPMainKey::JKQTPMainKey ( JKQTBasePlotter parent)
explicit

class constructor

◆ ~JKQTPMainKey()

virtual JKQTPMainKey::~JKQTPMainKey ( )
virtual

class destructor

Member Function Documentation

◆ drawEntrySample()

virtual void JKQTPMainKey::drawEntrySample ( int  item,
JKQTPEnhancedPainter painter,
const QRectF &  rect 
)
overrideprotectedvirtual

draws the sample for legend entry item into the given rect, using the given painter

Implements JKQTPBaseKey.

◆ getEntryColor()

virtual QColor JKQTPMainKey::getEntryColor ( int  item) const
overrideprotectedvirtual

returns the label color of legend entry item 's text part

Implements JKQTPBaseKey.

◆ getEntryCount()

virtual int JKQTPMainKey::getEntryCount ( ) const
overrideprotectedvirtual

returns the number of legend entries

Implements JKQTPBaseKey.

◆ getEntryText()

virtual QString JKQTPMainKey::getEntryText ( int  item) const
overrideprotectedvirtual

returns the label text (my contain markup for a JKQTMathText) of legend entry item 's text part

Implements JKQTPBaseKey.

◆ getPlotElement() [1/2]

JKQTPPlotElement * JKQTPMainKey::getPlotElement ( int  item)
protected

returns the graph class from parent JKQTBasePlotter for the given item in the key

◆ getPlotElement() [2/2]

const JKQTPPlotElement * JKQTPMainKey::getPlotElement ( int  item) const
protected

returns the graph class from parent JKQTBasePlotter for the given item in the key

◆ getPlotElements()

QList< const JKQTPPlotElement * > JKQTPMainKey::getPlotElements ( ) const
protected

returns all graph classes from parent JKQTBasePlotter for the key

◆ keyStyle() [1/2]

virtual JKQTPKeyStyle & JKQTPMainKey::keyStyle ( )
protectedvirtual

provides the keyStyle to use for sizing/drawing this object

Reimplemented from JKQTPBaseKey.

◆ keyStyle() [2/2]

virtual const JKQTPKeyStyle & JKQTPMainKey::keyStyle ( ) const
protectedvirtual

provides the keyStyle to use for sizing/drawing this object (extracted from the parent JKQTBasePlotters's

Reimplemented from JKQTPBaseKey.


The documentation for this class was generated from the following file: