28 #include <QDomDocument> 29 #include <QDomElement> 54 for (
int i = 0; i < numRows; ++i )
102 saveSymbolMap.
insert(
"classificationSymbol", mSymbolV2 );
121 if ( !symbolsElem.isNull() )
126 if ( mapIt != loadSymbolMap.
end() )
132 if ( xServerAvailable )
194 if ( xServerAvailable )
197 itemPixmap.
fill( mColor );
205 , mShowFeatureCount( false )
210 , mShowFeatureCount( false )
256 int nChildItems = childList.
count();
257 for (
int i = 0; i < nChildItems; ++i )
259 currentNode = childList.
at( i );
267 if ( elemTag ==
"VectorClassificationItem" )
271 else if ( elemTag ==
"VectorClassificationItemNg" )
275 else if ( elemTag ==
"RasterClassificationItem" )
283 currentChildItem->
readXML( currentElem, xServerAvailable );
298 if ( renderer->
legendSymbolItems( scaleDenominator, rule ).
size() > 1 || !symbolItem.first.isEmpty() )
353 userText = itemElem.
attribute(
"text",
"" );
366 int nChildItems = childList.
count();
367 for (
int i = 0; i < nChildItems; ++i )
369 currentNode = childList.
at( i );
378 if ( elemTag ==
"GroupItem" )
382 else if ( elemTag ==
"LayerItem" )
390 currentChildItem->
readXML( currentElem, xServerAvailable );
static QDomElement saveSymbols(QgsSymbolV2Map &symbols, const QString &tagName, QDomDocument &doc)
virtual void readXML(const QDomElement &itemElem, bool xServerAvailable=true)=0
Read item content from xml.
static Style styleFromName(const QString &styleName)
Get style from name, used in project file.
static QgsSymbolV2Map loadSymbols(QDomElement &element)
bool showFeatureCount() const
QgsComposerRasterSymbolItem()
QgsComposerLegendStyle::Style style() const
void setIcon(const QIcon &icon)
void setLayerID(const QString &id)
virtual QStandardItem * clone() const override
virtual void writeXML(QDomElement &elem, QDomDocument &doc) const override
virtual void writeXML(QDomElement &elem, QDomDocument &doc) const override
QDomNode appendChild(const QDomNode &newChild)
void fill(const QColor &color)
virtual ~QgsComposerSymbolV2Item()
QString attribute(const QString &name, const QString &defValue) const
virtual void readXML(const QDomElement &itemElem, bool xServerAvailable=true) override
Read item content from xml.
virtual QStandardItem * clone() const override
QgsMapLayer * mapLayer(const QString &theLayerId) const
Retrieve a pointer to a registered layer by layer ID.
virtual QgsSymbolV2 * clone() const =0
virtual QStandardItem * clone() const override
virtual ~QgsComposerLegendItem()
virtual ~QgsComposerGroupItem()
QDomNodeList childNodes() const
void setLayerID(const QString &id)
virtual void writeXML(QDomElement &elem, QDomDocument &doc) const override
virtual void setData(const QVariant &value, int role)
void setStyle(QgsComposerLegendStyle::Style style)
QDomElement toElement() const
static QString styleName(Style s)
Get name for style, used in project file.
virtual ~QgsComposerLayerItem()
QgsFeatureRendererV2 * rendererV2()
Return renderer V2.
static QIcon symbolPreviewIcon(QgsSymbolV2 *symbol, QSize size)
virtual QgsLegendSymbolList legendSymbolItems(double scaleDenominator=-1, const QString &rule="")
return a list of item text / symbol
void setAttribute(const QString &name, const QString &value)
void appendRow(const QList< QStandardItem * > &items)
virtual QString userText() const
virtual void writeXML(QDomElement &elem, QDomDocument &doc) const =0
static QString styleLabel(Style s)
Get style label, translated, used in UI.
QgsComposerLegendStyle::Style mStyle
void setSymbolV2(QgsSymbolV2 *s)
Set symbol (takes ownership)
QStandardItem * child(int row, int column) const
QgsComposerLegendItem(QgsComposerLegendStyle::Style s=QgsComposerLegendStyle::Undefined)
virtual void readXML(const QDomElement &itemElem, bool xServerAvailable=true) override
Read item content from xml.
Abstract base class for the legend item types.
void setText(const QString &text)
Composer legend components style.
virtual QStandardItem * clone() const override
static QgsMapLayerRegistry * instance()
Returns the instance pointer, creating the object on the first call.
QDomElement firstChildElement(const QString &tagName) const
void setShowFeatureCount(bool show)
void setColor(const QColor &c)
virtual void writeXML(QDomElement &elem, QDomDocument &doc) const override
virtual void readXML(const QDomElement &itemElem, bool xServerAvailable=true) override
Read item content from xml.
virtual void readXML(const QDomElement &itemElem, bool xServerAvailable=true) override
Read item content from xml.
QgsComposerSymbolV2Item()
iterator insert(const Key &key, const T &value)
void writeXMLChildren(QDomElement &elem, QDomDocument &doc) const
QDomElement createElement(const QString &tagName)
virtual ~QgsComposerRasterSymbolItem()
Represents a vector layer which manages a vector based data sets.
void setDefaultStyle(double scaleDenominator=-1, const QString &rule="")
virtual void setUserText(const QString &text)
QDomNode at(int index) const