Legend
#include <legend.h>
Public Types | |
enum | LEGEND_ORIENTATION { LO_HORIZONTAL , LO_VERTICAL } |
enum | LEGEND_POSITION { LP_UPPER_LEFT , LP_UPPER_RIGHT , LP_LOWER_LEFT , LP_LOWER_RIGHT , LP_FLOATING } |
enum | LEGEND_TYPE { LT_FULL , LT_SCALE_MAGNITUDES , LT_SCALE_ONLY , LT_MAGNITUDES_ONLY , LT_SYMBOLS_ONLY } |
Detailed Description
Legend class is used for painting legends on class inheriting QPaintDevice.
Its methods enable changing settings of legend such as legend type (scale only/full legend), symbol size, sizes for symbol description's bounding rectangles, symbol spacing etc. Typical use of this class would be to create instance of Legend class, set all properties using appropriate methods and paint it by calling paintLegend() method, passing QPaintDevice or QPainter subclass (useful eg. with QSvgGenerator class, which can't be painted by two QPainter classes).
Member Enumeration Documentation
◆ LEGEND_ORIENTATION
◆ LEGEND_POSITION
◆ LEGEND_TYPE
enum Legend::LEGEND_TYPE |
Constructor & Destructor Documentation
◆ Legend() [1/2]
|
explicit |
Constructor.
Definition at line 28 of file legend.cpp.
◆ Legend() [2/2]
|
explicit |
copy constructor
- Note
- This class needs to be explicitly copied because of the m_Painter pointer
Definition at line 577 of file legend.cpp.
◆ ~Legend()
Legend::~Legend | ( | ) |
Destructor.
Definition at line 38 of file legend.cpp.
Member Function Documentation
◆ calculateSize()
QSize Legend::calculateSize | ( | ) |
Calculates size of legend that will be painted using current settings.
- Returns
- Size of legend.
Definition at line 46 of file legend.cpp.
◆ getBgColor()
|
inline |
◆ getBRectHeight()
|
inline |
◆ getBRectWidth()
|
inline |
◆ getDrawFrame()
|
inline |
◆ getFloatingPosition()
|
inline |
◆ getFont()
|
inline |
◆ getMaxHScalePixels()
|
inline |
◆ getMaxVScalePixels()
|
inline |
◆ getOrientation()
|
inline |
◆ getPosition()
|
inline |
◆ getSymbolSize()
|
inline |
◆ getType()
|
inline |
◆ getXSymbolSpacing()
|
inline |
◆ getYSymbolSpacing()
|
inline |
◆ operator=()
Definition at line 587 of file legend.cpp.
◆ paintLegend() [1/4]
void Legend::paintLegend | ( | QPaintDevice * | pd | ) |
Paint legend on passed QPaintDevice at selected position.
- Parameters
-
pd QPaintDevice on which legend will be painted.
Definition at line 154 of file legend.cpp.
◆ paintLegend() [2/4]
void Legend::paintLegend | ( | QPaintDevice * | pd, |
LEGEND_TYPE | type, | ||
LEGEND_POSITION | pos ) |
Paint legend on passed QPaintDevice at selected position.
- Parameters
-
pd QPaintDevice on which legend will be painted. type the legend type. pos LEGEND_POSITION enum value.
Definition at line 306 of file legend.cpp.
◆ paintLegend() [3/4]
void Legend::paintLegend | ( | SkyQPainter * | painter | ) |
Paint legend using passed SkyQPainter.
This method is used to enable painting on QPaintDevice subclasses that can't be painted by multiple QPainter subclasses (e.g. QSvgGenerator).
- Parameters
-
painter that will be used to paint legend.
- Note
- Passed SkyQPainter should be already set up to paint at specific QPaintDevice subclass and should be initialized by its begin() method. After legend is painted, SkyQPainter instance will not be finished, so it's necessary to call end() method manually.
Definition at line 170 of file legend.cpp.
◆ paintLegend() [4/4]
void Legend::paintLegend | ( | SkyQPainter * | painter, |
LEGEND_TYPE | type, | ||
LEGEND_POSITION | pos ) |
Paint legend using passed SkyQPainter.
This method is used to enable painting on QPaintDevice subclasses that can't be painted by multiple QPainter subclasses (eg. QSvgGenerator).
- Parameters
-
painter that will be used to paint legend. type the legend type. pos LEGEND_POSITION enum value.
- Note
- Passed SkyQPainter should be already set up to paint at specific QPaintDevice subclass and should be initialized by its begin() method. After legend is painted, SkyQPainter instance will not be finished, so it's necessary to call end() method manually.
Definition at line 320 of file legend.cpp.
◆ setBgColor()
|
inline |
◆ setBRectHeight()
|
inline |
◆ setBRectWidth()
|
inline |
◆ setDrawFrame()
|
inline |
◆ setFloatingPosition()
|
inline |
◆ setFont()
|
inline |
◆ setMaxHScalePixels()
|
inline |
◆ setMaxVScalePixels()
|
inline |
◆ setOrientation()
|
inline |
◆ setPosition()
|
inline |
◆ setSymbolSize()
|
inline |
◆ setType()
|
inline |
◆ setXSymbolSpacing()
|
inline |
◆ setYSymbolSpacing()
|
inline |
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 3 2025 11:47:16 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.