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;
171 bool mEmbeddedInParent;
175 #include "qgslegendsymbolitem.h" 199 Qt::ItemFlags flags()
const override;
200 QVariant data(
int role )
const override;
201 bool setData(
const QVariant &value,
int role )
override;
207 void setEmbeddedInParent(
bool embedded )
override;
209 void setUserLabel(
const QString &userLabel )
override { mUserLabel = userLabel; updateLabel(); }
211 bool isScaleOK(
double scale )
const override {
return mItem.isScaleOK( scale ); }
213 void invalidateMapBasedData()
override;
230 QSize minimumIconSize()
const;
288 void checkAllItems();
296 void uncheckAllItems();
304 void toggleAllItems();
311 mutable QPixmap mPixmap;
313 bool mSymbolUsesMapUnits;
316 QString mTextOnSymbolLabel;
320 static const int INDENT_SIZE = 20;
326 void checkAll(
bool state );
352 QVariant data(
int role )
const override;
382 QVariant data(
int role )
const override;
413 QVariant data(
int role )
const override;
445 QVariant data(
int role )
const override;
451 void invalidateMapBasedData()
override;
455 void getLegendGraphicFinished(
const QImage & );
456 void getLegendGraphicErrored(
const QString & );
457 void getLegendGraphicProgress( qint64, qint64 );
462 QImage getLegendGraphic()
const;
464 QImage renderMessage(
const QString &msg )
const;
470 mutable std::unique_ptr<QgsImageFetcher> mFetcher;
488 QVariant data(
int role )
const override;
493 void cacheImage()
const;
495 mutable QImage mImage;
498 #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.