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" 169 Qt::ItemFlags flags()
const override;
170 QVariant data(
int role )
const override;
171 bool setData(
const QVariant &value,
int role )
override;
175 void setEmbeddedInParent(
bool embedded )
override;
177 void setUserLabel(
const QString &userLabel )
override { mUserLabel = userLabel; updateLabel(); }
179 bool isScaleOK(
double scale )
const override {
return mItem.isScaleOK( scale ); }
181 void invalidateMapBasedData()
override;
198 QSize minimumIconSize()
const;
231 void checkAllItems();
238 void uncheckAllItems();
245 mutable QPixmap mPixmap;
247 bool mSymbolUsesMapUnits;
251 static const int INDENT_SIZE = 20;
257 void checkAll(
bool state );
283 QVariant data(
int role )
const override;
313 QVariant data(
int role )
const override;
342 QVariant data(
int role )
const override;
372 QVariant data(
int role )
const override;
376 void invalidateMapBasedData()
override;
380 void getLegendGraphicFinished(
const QImage & );
381 void getLegendGraphicErrored(
const QString & );
382 void getLegendGraphicProgress( qint64, qint64 );
387 QImage getLegendGraphic()
const;
389 QImage renderMessage(
const QString &msg )
const;
395 mutable std::unique_ptr<QgsImageFetcher> mFetcher;
413 QVariant data(
int role )
const override;
418 void cacheImage()
const;
420 mutable QImage mImage;
423 #endif // QGSLAYERTREEMODELLEGENDNODE_H Implementation of legend node interface for displaying arbitrary raster image.
virtual bool isEmbeddedInParent() const
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.
Implementation of legend node interface for displaying preview of vector symbols and their labels and...
QgsLayerTreeLayer * layerNode() const
Return 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...
Implementation of legend node interface for displaying arbitrary label with icon. ...
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...
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.