18 #ifndef QGSCOMPOSERLEGEND_H
19 #define QGSCOMPOSERLEGEND_H
46 void paint( QPainter* painter,
const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget );
49 QSizeF paintAndDetermineSize( QPainter* painter );
58 void setTitle(
const QString& t ) {mTitle = t;}
59 QString
title()
const {
return mTitle;}
118 bool writeXML( QDomElement& elem, QDomDocument & doc )
const;
124 bool readXML(
const QDomElement& itemElem,
const QDomDocument& doc );
128 void synchronizeWithModel();
130 void invalidateCurrentMap();
210 QList<Atom> createAtomList( QStandardItem* rootItem,
bool splitLayer );
213 void setColumns( QList<Atom>& atomList );
217 QSizeF drawTitle( QPainter* painter = 0, QPointF point = QPointF(), Qt::AlignmentFlag halignment = Qt::AlignLeft );
222 QSizeF drawGroupItemTitle(
QgsComposerGroupItem* groupItem, QPainter* painter = 0, QPointF point = QPointF() );
224 QSizeF drawLayerItemTitle(
QgsComposerLayerItem* layerItem, QPainter* painter = 0, QPointF point = QPointF() );
226 Nucleon drawSymbolItem(
QgsComposerLegendItem* symbolItem, QPainter* painter = 0, QPointF point = QPointF(),
double labelXOffset = 0. );
230 void drawSymbolV2( QPainter* p,
QgsSymbolV2* s,
double currentYCoord,
double& currentXPosition,
double& symbolHeight )
const;
235 QSizeF drawAtom(
Atom atom, QPainter* painter = 0, QPointF point = QPointF() );
237 double spaceAboveAtom(
Atom atom );
240 QStringList layerIdList()
const;
244 QStringList splitStringForWrapping( QString stringToSplt );
246 QMap<QgsComposerLegendStyle::Style, QgsComposerLegendStyle>
mStyleMap;
QgsComposerLegendStyle style(QgsComposerLegendStyle::Style s) const
Returns style.
A model that provides group, layer and classification items.
double mWmsLegendWidth
Width of WMS legendGraphic pixmap.
virtual bool readXML(const QDomElement &itemElem, const QDomDocument &doc)=0
sets state from Dom document
double mColumnSpace
Space between columns.
double mWmsLegendHeight
Height of WMS legendGraphic pixmap.
void setSplitLayer(bool s)
Nucleon is either group title, layer title or layer child item.
void setColumnSpace(double s)
A item that forms part of a map composition.
double columnSpace() const
QgsLegendModel mLegendModel
double wmsLegendWidth() const
void setTitle(const QString &t)
int mColumnCount
Number of legend columns.
double mlineSpacing
Spacing between lines when wrapped.
void setWmsLegendHeight(double h)
double mSymbolHeight
Height of symbol icon.
const QgsComposerMap * mComposerMap
Reference to map (because symbols are sometimes in map units)
void setSymbolHeight(double h)
Graphics scene for map printing.
QFont styleFont(QgsComposerLegendStyle::Style s) const
Abstract base class for the legend item types.
Object representing map window.
void setSymbolWidth(double w)
double symbolWidth() const
QgsComposerLegendStyle & rstyle(QgsComposerLegendStyle::Style s)
Returns reference to modifiable style.
void setWmsLegendWidth(double w)
Composer legend components style.
void setWrapChar(const QString &t)
qreal mBoxSpace
Space between item box and contents.
double wmsLegendHeight() const
int equalColumnWidth() const
const QgsComposerMap * composerMap() const
void setEqualColumnWidth(bool s)
void setStyle(QgsComposerLegendStyle::Style s, const QgsComposerLegendStyle style)
bool mEqualColumnWidth
Use the same width (maximum) for all columns.
QgsLegendModel * model()
Returns pointer to the legend model.
void setColumnCount(int c)
Atom is indivisible set (indivisible into more columns).
QMap< QgsComposerLegendStyle::Style, QgsComposerLegendStyle > mStyleMap
QgsComposerLegendItem * item
void setFontColor(const QColor &c)
bool mSplitLayer
Allow splitting layers into multiple columns.
A legend that can be placed onto a map composition.
virtual int type() const
return correct graphics item type.
double mSymbolWidth
Width of symbol icon.
QList< Nucleon > nucleons
void setBoxSpace(double s)
virtual bool writeXML(QDomElement &elem, QDomDocument &doc) const =0
stores state in Dom element
double symbolHeight() const