Skip to content
Permalink
Browse files

Adding QgsRenderContext support

  • Loading branch information
roya0045 authored and nyalldawson committed Jan 2, 2019
1 parent 99837cf commit 8b3744331afbe00e2347dc534088492bfae089c3
Showing with 21 additions and 2 deletions.
  1. +21 −2 src/core/qgslegendrenderer.h
@@ -61,7 +61,8 @@ class CORE_EXPORT QgsLegendRenderer
* Painter should be scaled beforehand so that units correspond to millimeters.
*/
void drawLegend( QPainter *painter );


void drawLegend( QgsRenderContext *rendercontext );

static void setNodeLegendStyle( QgsLayerTreeNode *node, QgsLegendStyle::Style style );
static QgsLegendStyle::Style nodeLegendStyle( QgsLayerTreeNode *node, QgsLayerTreeModel *model );
@@ -112,7 +113,7 @@ class CORE_EXPORT QgsLegendRenderer
int column = 0;
};

QSizeF paintAndDetermineSize( QPainter *painter );
QSizeF paintAndDetermineSize( QPainter *painter = nullptr );

//! Create list of atoms according to current layer splitting mode
QList<Atom> createAtomList( QgsLayerTreeGroup *parentGroup, bool splitLayer );
@@ -145,6 +146,24 @@ class CORE_EXPORT QgsLegendRenderer
*/
QSizeF drawGroupTitle( QgsLayerTreeGroup *nodeGroup, QPainter *painter = nullptr, QPointF point = QPointF() );


QSizeF paintAndDetermineSize( QgsRenderContext *rendercontext );

QSizeF drawTitle( QgsRenderContext *rendercontext , QPointF point = QPointF(), Qt::AlignmentFlag halignment = Qt::AlignLeft, double legendWidth = 0 );

QSizeF drawAtom( const Atom &atom, QgsRenderContext *rendercontext , QPointF point = QPointF() );

Nucleon drawSymbolItem( QgsLayerTreeModelLegendNode *symbolItem, QgsRenderContext *rendercontext , QPointF point = QPointF(), double labelXOffset = 0 );

//! Draws a layer item
QSizeF drawLayerTitle( QgsLayerTreeLayer *nodeLayer, QgsRenderContext *rendercontext , QPointF point = QPointF() );

/**
* Draws a group item.
* Returns list of sizes of layers and groups including this group.
*/
QSizeF drawGroupTitle( QgsLayerTreeGroup *nodeGroup, QgsRenderContext *rendercontext , QPointF point = QPointF() );

QgsLegendStyle::Style nodeLegendStyle( QgsLayerTreeNode *node );

private:

0 comments on commit 8b37443

Please sign in to comment.
You can’t perform that action at this time.