19 #ifndef QGSLAYERTREEMODELLEGENDNODE_H 20 #define QGSLAYERTREEMODELLEGENDNODE_H 26 #include "qgis_core.h" 55 RuleKeyRole = Qt::UserRole,
66 virtual Qt::ItemFlags flags()
const;
69 virtual QVariant data(
int role )
const = 0;
72 virtual bool setData(
const QVariant &value,
int role );
77 virtual QString
userLabel()
const {
return mUserLabel; }
78 virtual void setUserLabel(
const QString &userLabel ) { mUserLabel = userLabel; }
80 virtual bool isScaleOK(
double scale )
const { Q_UNUSED( scale );
return true; }
90 QPainter *painter =
nullptr;
142 bool mEmbeddedInParent;
146 #include "qgslegendsymbolitem.h" 170 Qt::ItemFlags flags()
const override;
171 QVariant data(
int role )
const override;
172 bool setData(
const QVariant &value,
int role )
override;
176 void setEmbeddedInParent(
bool embedded )
override;
178 void setUserLabel(
const QString &userLabel )
override { mUserLabel = userLabel; updateLabel(); }
180 bool isScaleOK(
double scale )
const override {
return mItem.isScaleOK( scale ); }
182 void invalidateMapBasedData()
override;
199 QSize minimumIconSize()
const;
256 void checkAllItems();
263 void uncheckAllItems();
270 mutable QPixmap mPixmap;
272 bool mSymbolUsesMapUnits;
275 QString mTextOnSymbolLabel;
279 static const int INDENT_SIZE = 20;
285 void checkAll(
bool state );
311 QVariant data(
int role )
const override;
341 QVariant data(
int role )
const override;
370 QVariant data(
int role )
const override;
400 QVariant data(
int role )
const override;
404 void invalidateMapBasedData()
override;
408 void getLegendGraphicFinished(
const QImage & );
409 void getLegendGraphicErrored(
const QString & );
410 void getLegendGraphicProgress( qint64, qint64 );
415 QImage getLegendGraphic()
const;
417 QImage renderMessage(
const QString &msg )
const;
423 mutable std::unique_ptr<QgsImageFetcher> mFetcher;
441 QVariant data(
int role )
const override;
446 void cacheImage()
const;
448 mutable QImage mImage;
451 #endif // QGSLAYERTREEMODELLEGENDNODE_H Implementation of legend node interface for displaying arbitrary raster image.
Abstract base class for all rendered symbols.
Handles asynchronous download of images.
void setIconSize(QSize sz)
Set the icon size.
Produces legend node with a marker symbol.
Implementation of legend node interface for displaying raster legend entries.
QgsTextFormat textOnSymbolTextFormat() const
Returns text format of the label to be shown on top of the symbol.
void setTextOnSymbolLabel(const QString &label)
Sets label of text to be shown on top of the symbol.
Implementation of legend node interface for displaying preview of vector symbols and their labels and...
void setUserLabel(const QString &userLabel) override
Implementation of legend node interface for displaying WMS legend entries.
virtual bool isEmbeddedInParent() const
The QgsMapSettings class contains configuration for rendering of the map.
The QgsLayerTreeModel class is model implementation for Qt item views framework.
The QgsLegendSettings class stores the appearance and layout settings for legend drawing with QgsLege...
QgsLayerTreeLayer * layerNode() const
Returns pointer to the parent layer node.
Implementation of legend node interface for displaying arbitrary label with icon. ...
void setTextOnSymbolTextFormat(const QgsTextFormat &format)
Sets format of text to be shown on top of the symbol.
virtual QString userLabel() const
virtual void setEmbeddedInParent(bool embedded)
The class stores information about one class/rule of a vector layer renderer in a unified way that ca...
Contains information about the context of a rendering operation.
QPointF point
Top-left corner of the legend item.
bool isScaleOK(double scale) const override
virtual bool isScaleOK(double scale) const
The QgsLegendRendererItem class is abstract interface for legend items returned from QgsMapLayerLegen...
Container for all settings relating to text rendering.
double labelXOffset
offset from the left side where label should start
Object that keeps configuration of appearance of marker symbol's data-defined size in legend...
QString textOnSymbolLabel() const
Returns label of text to be shown on top of the symbol.
virtual void invalidateMapBasedData()
Notification from model that information from associated map view has changed.
virtual void setUserLabel(const QString &userLabel)
Layer tree node points to a map layer.