QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
QgsLegendSettings Class Reference

The QgsLegendSettings class stores the appearance and layout settings for legend drawing with QgsLegendRenderer. More...

#include <qgslegendsettings.h>

Public Member Functions

 QgsLegendSettings ()
 
void setTitle (const QString &t)
 
QString title () const
 
Qt::AlignmentFlag titleAlignment () const
 Returns the alignment of the legend title. More...
 
void setTitleAlignment (Qt::AlignmentFlag alignment)
 Sets the alignment of the legend title. More...
 
QgsComposerLegendStylerstyle (QgsComposerLegendStyle::Style s)
 Returns reference to modifiable style. More...
 
QgsComposerLegendStyle style (QgsComposerLegendStyle::Style s) const
 Returns style. More...
 
void setStyle (QgsComposerLegendStyle::Style s, const QgsComposerLegendStyle style)
 
double boxSpace () const
 
void setBoxSpace (double s)
 
void setWrapChar (const QString &t)
 
QString wrapChar () const
 
double columnSpace () const
 
void setColumnSpace (double s)
 
int columnCount () const
 
void setColumnCount (int c)
 
int splitLayer () const
 
void setSplitLayer (bool s)
 
int equalColumnWidth () const
 
void setEqualColumnWidth (bool s)
 
QColor fontColor () const
 
void setFontColor (const QColor &c)
 
QSizeF symbolSize () const
 
void setSymbolSize (QSizeF s)
 
QSizeF wmsLegendSize () const
 
void setWmsLegendSize (QSizeF s)
 
double lineSpacing () const
 
void setLineSpacing (double s)
 
double mmPerMapUnit () const
 
void setMmPerMapUnit (double mmPerMapUnit)
 
bool useAdvancedEffects () const
 
void setUseAdvancedEffects (bool use)
 

Private Attributes

QString mTitle
 
Qt::AlignmentFlag mTitleAlignment
 Title alignment, one of Qt::AlignLeft, Qt::AlignHCenter, Qt::AlignRight) More...
 
QString mWrapChar
 
QColor mFontColor
 
qreal mBoxSpace
 Space between item box and contents. More...
 
QSizeF mSymbolSize
 Width and height of symbol icon. More...
 
QSizeF mWmsLegendSize
 Width and height of WMS legendGraphic pixmap. More...
 
double mLineSpacing
 Spacing between lines when wrapped. More...
 
double mColumnSpace
 Space between columns. More...
 
int mColumnCount
 Number of legend columns. More...
 
bool mSplitLayer
 Allow splitting layers into multiple columns. More...
 
bool mEqualColumnWidth
 Use the same width (maximum) for all columns. More...
 
QMap
< QgsComposerLegendStyle::Style,
QgsComposerLegendStyle
mStyleMap
 
double mMmPerMapUnit
 Conversion ratio between millimeters and map units - for symbols with size given in map units. More...
 
bool mUseAdvancedEffects
 Whether to use advanced effects like transparency for symbols - may require their rasterization. More...
 

Detailed Description

The QgsLegendSettings class stores the appearance and layout settings for legend drawing with QgsLegendRenderer.

The content of the legend is given in QgsLegendModel class.

Note
added in 2.6

Definition at line 16 of file qgslegendsettings.h.

Constructor & Destructor Documentation

QgsLegendSettings::QgsLegendSettings ( )

Member Function Documentation

double QgsLegendSettings::boxSpace ( ) const
inline
int QgsLegendSettings::columnCount ( ) const
inline
double QgsLegendSettings::columnSpace ( ) const
inline
int QgsLegendSettings::equalColumnWidth ( ) const
inline
QColor QgsLegendSettings::fontColor ( ) const
inline
double QgsLegendSettings::lineSpacing ( ) const
inline
double QgsLegendSettings::mmPerMapUnit ( ) const
inline

Definition at line 71 of file qgslegendsettings.h.

Referenced by QgsLegendRenderer::drawSymbolV2().

QgsComposerLegendStyle& QgsLegendSettings::rstyle ( QgsComposerLegendStyle::Style  s)
inline

Returns reference to modifiable style.

Definition at line 36 of file qgslegendsettings.h.

Referenced by QgsLegendSettings(), and QgsComposerLegend::rstyle().

void QgsLegendSettings::setBoxSpace ( double  s)
inline
void QgsLegendSettings::setColumnCount ( int  c)
inline
void QgsLegendSettings::setColumnSpace ( double  s)
inline
void QgsLegendSettings::setEqualColumnWidth ( bool  s)
inline
void QgsLegendSettings::setFontColor ( const QColor &  c)
inline
void QgsLegendSettings::setLineSpacing ( double  s)
inline

Definition at line 69 of file qgslegendsettings.h.

void QgsLegendSettings::setMmPerMapUnit ( double  mmPerMapUnit)
inline

Definition at line 72 of file qgslegendsettings.h.

Referenced by QgsComposerLegend::paint().

void QgsLegendSettings::setSplitLayer ( bool  s)
inline
void QgsLegendSettings::setStyle ( QgsComposerLegendStyle::Style  s,
const QgsComposerLegendStyle  style 
)
inline

Definition at line 39 of file qgslegendsettings.h.

Referenced by QgsComposerLegend::setStyle().

void QgsLegendSettings::setSymbolSize ( QSizeF  s)
inline
void QgsLegendSettings::setTitle ( const QString &  t)
inline

Definition at line 21 of file qgslegendsettings.h.

Referenced by QgsComposerLegend::readXML(), and QgsComposerLegend::setTitle().

void QgsLegendSettings::setTitleAlignment ( Qt::AlignmentFlag  alignment)
inline

Sets the alignment of the legend title.

Parameters
alignmentText alignment for drawing the legend title
See also
titleAlignment

Definition at line 33 of file qgslegendsettings.h.

Referenced by QgsComposerLegend::readXML(), and QgsComposerLegend::setTitleAlignment().

void QgsLegendSettings::setUseAdvancedEffects ( bool  use)
inline

Definition at line 75 of file qgslegendsettings.h.

Referenced by QgsComposerLegend::paint().

void QgsLegendSettings::setWmsLegendSize ( QSizeF  s)
inline
void QgsLegendSettings::setWrapChar ( const QString &  t)
inline
int QgsLegendSettings::splitLayer ( ) const
inline
QgsComposerLegendStyle QgsLegendSettings::style ( QgsComposerLegendStyle::Style  s) const
inline
QSizeF QgsLegendSettings::symbolSize ( ) const
inline
QString QgsLegendSettings::title ( ) const
inline
Qt::AlignmentFlag QgsLegendSettings::titleAlignment ( ) const
inline

Returns the alignment of the legend title.

Returns
Qt::AlignmentFlag for the legend title
See also
setTitleAlignment

Definition at line 28 of file qgslegendsettings.h.

Referenced by QgsLegendRenderer::paintAndDetermineSize(), QgsComposerLegend::titleAlignment(), and QgsComposerLegend::writeXML().

bool QgsLegendSettings::useAdvancedEffects ( ) const
inline

Definition at line 74 of file qgslegendsettings.h.

Referenced by QgsLegendRenderer::drawSymbolV2().

QSizeF QgsLegendSettings::wmsLegendSize ( ) const
inline
QString QgsLegendSettings::wrapChar ( ) const
inline

Member Data Documentation

qreal QgsLegendSettings::mBoxSpace
private

Space between item box and contents.

Definition at line 89 of file qgslegendsettings.h.

int QgsLegendSettings::mColumnCount
private

Number of legend columns.

Definition at line 104 of file qgslegendsettings.h.

double QgsLegendSettings::mColumnSpace
private

Space between columns.

Definition at line 101 of file qgslegendsettings.h.

bool QgsLegendSettings::mEqualColumnWidth
private

Use the same width (maximum) for all columns.

Definition at line 110 of file qgslegendsettings.h.

QColor QgsLegendSettings::mFontColor
private

Definition at line 86 of file qgslegendsettings.h.

double QgsLegendSettings::mLineSpacing
private

Spacing between lines when wrapped.

Definition at line 98 of file qgslegendsettings.h.

double QgsLegendSettings::mMmPerMapUnit
private

Conversion ratio between millimeters and map units - for symbols with size given in map units.

Definition at line 115 of file qgslegendsettings.h.

bool QgsLegendSettings::mSplitLayer
private

Allow splitting layers into multiple columns.

Definition at line 107 of file qgslegendsettings.h.

QMap<QgsComposerLegendStyle::Style, QgsComposerLegendStyle> QgsLegendSettings::mStyleMap
private

Definition at line 112 of file qgslegendsettings.h.

QSizeF QgsLegendSettings::mSymbolSize
private

Width and height of symbol icon.

Definition at line 92 of file qgslegendsettings.h.

QString QgsLegendSettings::mTitle
private

Definition at line 79 of file qgslegendsettings.h.

Qt::AlignmentFlag QgsLegendSettings::mTitleAlignment
private

Title alignment, one of Qt::AlignLeft, Qt::AlignHCenter, Qt::AlignRight)

Definition at line 82 of file qgslegendsettings.h.

bool QgsLegendSettings::mUseAdvancedEffects
private

Whether to use advanced effects like transparency for symbols - may require their rasterization.

Definition at line 118 of file qgslegendsettings.h.

QSizeF QgsLegendSettings::mWmsLegendSize
private

Width and height of WMS legendGraphic pixmap.

Definition at line 95 of file qgslegendsettings.h.

QString QgsLegendSettings::mWrapChar
private

Definition at line 84 of file qgslegendsettings.h.


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