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; }
92 QPainter *painter =
nullptr;
144 bool mEmbeddedInParent;
148 #include "qgslegendsymbolitem.h" 172 Qt::ItemFlags flags()
const override;
173 QVariant data(
int role )
const override;
174 bool setData(
const QVariant &value,
int role )
override;
178 void setEmbeddedInParent(
bool embedded )
override;
180 void setUserLabel(
const QString &userLabel )
override { mUserLabel = userLabel; updateLabel(); }
182 bool isScaleOK(
double scale )
const override {
return mItem.isScaleOK( scale ); }
184 void invalidateMapBasedData()
override;
201 QSize minimumIconSize()
const;
259 void checkAllItems();
267 void uncheckAllItems();
275 void toggleAllItems();
282 mutable QPixmap mPixmap;
284 bool mSymbolUsesMapUnits;
287 QString mTextOnSymbolLabel;
291 static const int INDENT_SIZE = 20;
297 void checkAll(
bool state );
323 QVariant data(
int role )
const override;
353 QVariant data(
int role )
const override;
382 QVariant data(
int role )
const override;
412 QVariant data(
int role )
const override;
416 void invalidateMapBasedData()
override;
420 void getLegendGraphicFinished(
const QImage & );
421 void getLegendGraphicErrored(
const QString & );
422 void getLegendGraphicProgress( qint64, qint64 );
427 QImage getLegendGraphic()
const;
429 QImage renderMessage(
const QString &msg )
const;
435 mutable std::unique_ptr<QgsImageFetcher> mFetcher;
453 QVariant data(
int role )
const override;
458 void cacheImage()
const;
460 mutable QImage mImage;
463 #endif // QGSLAYERTREEMODELLEGENDNODE_H Implementation of legend node interface for displaying arbitrary raster image.
virtual bool isEmbeddedInParent() const
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.
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...
QgsLayerTreeLayer * layerNode() const
Returns pointer to the parent layer node.
void setUserLabel(const QString &userLabel) override
Implementation of legend node interface for displaying WMS legend entries.
virtual QString userLabel() const
The QgsMapSettings class contains configuration for rendering of the map.
The QgsLayerTreeModel class is model implementation for Qt item views framework.
virtual bool isScaleOK(double scale) const
The QgsLegendSettings class stores the appearance and layout settings for legend drawing with QgsLege...
QString textOnSymbolLabel() const
Returns label of text to be shown on top of the symbol.
Implementation of legend node interface for displaying arbitrary label with icon. ...
QgsTextFormat textOnSymbolTextFormat() const
Returns text format of the label to be shown on top of the symbol.
void setTextOnSymbolTextFormat(const QgsTextFormat &format)
Sets format of text to be shown on top of the symbol.
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
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...
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.