QGIS API Documentation
2.6.0-Brighton
|
The QgsLegendRenderer class handles automatic layout and rendering of legend. More...
#include <qgslegendrenderer.h>
Classes | |
class | Atom |
Atom is indivisible set (indivisible into more columns). | |
class | Nucleon |
Nucleon is either group title, layer title or layer child item. |
Public Member Functions | |
QgsLegendRenderer (QgsLayerTreeModel *legendModel, const QgsLegendSettings &settings) | |
Construct legend renderer. | |
QSizeF | minimumSize () |
Run the layout algorithm and determine the size required for legend. | |
void | setLegendSize (QSizeF s) |
Set the preferred resulting legend size. | |
QSizeF | legendSize () const |
Find out preferred legend size set by the client. | |
void | drawLegend (QPainter *painter) |
Draw the legend with given painter. |
Static Public Member Functions | |
static void | setNodeLegendStyle (QgsLayerTreeNode *node, QgsComposerLegendStyle::Style style) |
static QgsComposerLegendStyle::Style | nodeLegendStyle (QgsLayerTreeNode *node, QgsLayerTreeModel *model) |
The QgsLegendRenderer class handles automatic layout and rendering of legend.
The content is given by QgsLegendModel instance. Various layout properties can be configured within QgsLegendRenderer.
All spacing and sizes are in millimeters.
QgsLegendRenderer::QgsLegendRenderer | ( | QgsLayerTreeModel * | legendModel, |
const QgsLegendSettings & | settings | ||
) |
Construct legend renderer.
The ownership of legend model does not change
void QgsLegendRenderer::drawLegend | ( | QPainter * | painter | ) |
Draw the legend with given painter.
It will occupy the area reported in legendSize(). Painter should be scaled beforehand so that units correspond to millimeters.
|
inline |
Find out preferred legend size set by the client.
If null, the legend will be drawn with the minimum size
QSizeF QgsLegendRenderer::minimumSize | ( | ) |
Run the layout algorithm and determine the size required for legend.
|
static |
|
inline |
Set the preferred resulting legend size.
|
static |