19 #ifndef QGSLAYERTREEMODELLEGENDNODE_H 20 #define QGSLAYERTREEMODELLEGENDNODE_H 26 #include "qgis_core.h" 54 if ( qobject_cast<QgsSymbolLegendNode *> ( sipCpp ) )
55 sipType = sipType_QgsSymbolLegendNode;
64 RuleKeyRole = Qt::UserRole,
75 virtual Qt::ItemFlags flags()
const;
78 virtual QVariant data(
int role )
const = 0;
81 virtual bool setData(
const QVariant &value,
int role );
86 virtual QString
userLabel()
const {
return mUserLabel; }
87 virtual void setUserLabel(
const QString &userLabel ) { mUserLabel = userLabel; }
89 virtual bool isScaleOK(
double scale )
const { Q_UNUSED( scale )
return true; }
105 QPainter *painter =
nullptr;
117 Q_DECL_DEPRECATED
double labelXOffset = 0.0;
131 double columnLeft = 0.0;
139 double columnRight = 0.0;
146 double maxSiblingSymbolWidth = 0.0;
207 void exportSymbolTextToJson(
const QgsLegendSettings &settings, QJsonObject &json )
const;
222 bool mEmbeddedInParent;
226 #include "qgslegendsymbolitem.h" 251 Qt::ItemFlags flags()
const override;
252 QVariant data(
int role )
const override;
253 bool setData(
const QVariant &value,
int role )
override;
259 void setEmbeddedInParent(
bool embedded )
override;
261 void setUserLabel(
const QString &userLabel )
override { mUserLabel = userLabel; updateLabel(); }
263 bool isScaleOK(
double scale )
const override {
return mItem.isScaleOK( scale ); }
265 void invalidateMapBasedData()
override;
282 QSize minimumIconSize()
const;
336 QString symbolLabel()
const;
354 void checkAllItems();
362 void uncheckAllItems();
370 void toggleAllItems();
377 mutable QPixmap mPixmap;
379 bool mSymbolUsesMapUnits;
382 QString mTextOnSymbolLabel;
386 static const int INDENT_SIZE = 20;
398 void checkAll(
bool state );
424 QVariant data(
int role )
const override;
454 QVariant data(
int role )
const override;
485 QVariant data(
int role )
const override;
517 QVariant data(
int role )
const override;
523 void invalidateMapBasedData()
override;
527 void getLegendGraphicFinished(
const QImage & );
528 void getLegendGraphicErrored(
const QString & );
529 void getLegendGraphicProgress( qint64, qint64 );
534 QImage getLegendGraphic()
const;
536 QImage renderMessage(
const QString &msg )
const;
542 mutable std::unique_ptr<QgsImageFetcher> mFetcher;
560 QVariant data(
int role )
const override;
565 void cacheImage()
const;
567 mutable QImage mImage;
570 #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.
#define Q_NOWARN_DEPRECATED_PUSH
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
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
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. ...
Single scope for storing variables and functions for use within a QgsExpressionContext.
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.
#define Q_NOWARN_DEPRECATED_POP
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.
bool isScaleOK(double scale) const override
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
The QgsLegendRendererItem class is abstract interface for legend items returned from QgsMapLayerLegen...
Q_DECL_DEPRECATED QPointF point
Top-left corner of the legend item.
Container for all settings relating to text rendering.
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.