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;}
131 bool writeXML( QDomElement& elem, QDomDocument & doc )
const;
137 bool readXML(
const QDomElement& itemElem,
const QDomDocument& doc );
141 void synchronizeWithModel();
143 void invalidateCurrentMap();
226 QList<Atom> createAtomList( QStandardItem* rootItem,
bool splitLayer );
229 void setColumns( QList<Atom>& atomList );
236 QSizeF drawTitle( QPainter* painter = 0, QPointF point = QPointF(), Qt::AlignmentFlag halignment = Qt::AlignLeft );
241 QSizeF drawGroupItemTitle(
QgsComposerGroupItem* groupItem, QPainter* painter = 0, QPointF point = QPointF() );
243 QSizeF drawLayerItemTitle(
QgsComposerLayerItem* layerItem, QPainter* painter = 0, QPointF point = QPointF() );
245 Nucleon drawSymbolItem(
QgsComposerLegendItem* symbolItem, QPainter* painter = 0, QPointF point = QPointF(),
double labelXOffset = 0. );
249 void drawSymbolV2( QPainter* p,
QgsSymbolV2* s,
double currentYCoord,
double& currentXPosition,
double& symbolHeight,
int opacity = 255 )
const;
254 QSizeF drawAtom(
Atom atom, QPainter* painter = 0, QPointF point = QPointF() );
256 double spaceAboveAtom(
Atom atom );
259 QStringList layerIdList()
const;
263 QStringList splitStringForWrapping( QString stringToSplt );
265 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.
Qt::AlignmentFlag mTitleAlignment
Title alignment, one of Qt::AlignLeft, Qt::AlignHCenter, Qt::AlignRight)
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)
Qt::AlignmentFlag titleAlignment() const
Returns the alignment of the legend title.
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)
void setTitleAlignment(Qt::AlignmentFlag alignment)
Sets the alignment of the legend title.
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