![]() |
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
|
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>
Public Member Functions | |
JKQTPMainKey (JKQTBasePlotter *parent) | |
class constructor | |
virtual | ~JKQTPMainKey () |
class destructor | |
![]() | |
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 JKQTPKeyStyle & | getCurrentKeyStyle () 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 | |
JKQTBasePlotter * | getParent () |
parent plotter class | |
const JKQTBasePlotter * | getParent () 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 ¤tSize, 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 | |
JKQTPPlotElement * | getPlotElement (int item) |
returns the graph class from parent JKQTBasePlotter for the given item in the key | |
const JKQTPPlotElement * | getPlotElement (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 const JKQTPKeyStyle & | keyStyle () const override |
provides the keyStyle to use for sizing/drawing this object (extracted from the parent JKQTBasePlotters's | |
virtual JKQTPKeyStyle & | keyStyle () override |
provides the keyStyle to use for sizing/drawing this object | |
![]() | |
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 | |
JKQTMathText * | getParentMathText () |
retun parents JKQTMathText* object | |
const JKQTMathText * | getParentMathText () const |
retun parents JKQTMathText* object | |
void | redrawPlot () |
signals the parent JKQTBasePlotter to redraw | |
Additional Inherited Members | |
![]() | |
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] | |
![]() | |
JKQTBasePlotter * | parent |
parent plotter class | |
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.
|
explicit |
class constructor
|
virtual |
class destructor
|
overrideprotectedvirtual |
draws the sample for legend entry item into the given rect, using the given painter
Implements JKQTPBaseKey.
|
overrideprotectedvirtual |
returns the label color of legend entry item 's text part
Implements JKQTPBaseKey.
|
overrideprotectedvirtual |
returns the number of legend entries
Implements JKQTPBaseKey.
|
overrideprotectedvirtual |
returns the label text (my contain markup for a JKQTMathText) of legend entry item 's text part
Implements JKQTPBaseKey.
|
protected |
returns the graph class from parent JKQTBasePlotter for the given item in the key
|
protected |
returns the graph class from parent JKQTBasePlotter for the given item in the key
|
protected |
returns all graph classes from parent JKQTBasePlotter for the key
|
overrideprotectedvirtual |
provides the keyStyle to use for sizing/drawing this object (extracted from the parent JKQTBasePlotters's
Reimplemented from JKQTPBaseKey.
|
overrideprotectedvirtual |
provides the keyStyle to use for sizing/drawing this object
Reimplemented from JKQTPBaseKey.