/************************************************************************ * This file has been generated automatically from * * * * src/core/qgslegendsettings.h * * * * Do not edit manually ! Edit header and run scripts/sipify.pl again * ************************************************************************/ class QgsLegendSettings { %Docstring The QgsLegendSettings class stores the appearance and layout settings for legend drawing with QgsLegendRenderer. The content of the legend is given in QgsLegendModel class. .. versionadded:: 2.6 %End %TypeHeaderCode #include "qgslegendsettings.h" %End public: QgsLegendSettings(); void setTitle( const QString &t ); %Docstring Sets the title for the legend, which will be rendered above all legend items. .. seealso:: :py:func:`title` %End QString title() const; %Docstring Returns the title for the legend, which will be rendered above all legend items. .. seealso:: :py:func:`setTitle` %End Qt::AlignmentFlag titleAlignment() const; %Docstring Returns the alignment of the legend title. .. seealso:: :py:func:`setTitleAlignment` %End void setTitleAlignment( Qt::AlignmentFlag alignment ); %Docstring Sets the ``alignment`` of the legend title. .. seealso:: :py:func:`titleAlignment` %End QgsLegendStyle style( QgsLegendStyle::Style s ) const; %Docstring Returns the style for a legend component. .. seealso:: :py:func:`setStyle` %End void setStyle( QgsLegendStyle::Style s, const QgsLegendStyle &style ); %Docstring Sets the ``style`` for a legend component. .. seealso:: :py:func:`style` %End double boxSpace() const; %Docstring Returns the legend box space (in millimeters), which is the empty margin around the inside of the legend's rectangle. .. seealso:: :py:func:`setBoxSpace` %End void setBoxSpace( double s ); %Docstring Sets the legend box space (in millimeters), which is the empty margin around the inside of the legend's rectangle. .. seealso:: :py:func:`boxSpace` %End void setWrapChar( const QString &t ); %Docstring Sets a string to use as a wrapping character. Whenever this string is encountered inside legend component text it will be automatically replaced with a new line character. .. seealso:: :py:func:`wrapChar` %End QString wrapChar() const; %Docstring Returns the string used as a wrapping character. Whenever this string is encountered inside legend component text it will be automatically replaced with a new line character. .. seealso:: :py:func:`setWrapChar` %End double columnSpace() const; %Docstring Returns the margin space between adjacent columns (in millimeters). .. seealso:: :py:func:`setColumnSpace` %End void setColumnSpace( double s ); %Docstring Sets the margin space between adjacent columns (in millimeters). .. seealso:: :py:func:`columnSpace` %End int columnCount() const; %Docstring Returns the desired minimum number of columns to show in the legend. If legend components have forced column breaks then the actual number of columns in the rendered legend may be larger than this value. .. seealso:: :py:func:`setColumnCount` %End void setColumnCount( int c ); %Docstring Sets the desired minimum number of columns to show in the legend. If legend components have forced column breaks then the actual number of columns in the rendered legend may be larger than this value. .. seealso:: :py:func:`columnCount` %End bool splitLayer() const; %Docstring Returns ``True`` if layer components can be split over multiple columns. .. seealso:: :py:func:`setSplitLayer` %End void setSplitLayer( bool s ); %Docstring Sets whether layer components can be split over multiple columns. .. seealso:: :py:func:`splitLayer` %End bool equalColumnWidth() const; %Docstring Returns ``True`` if all columns should have equal widths. If ``False`` is returned then columns will be individually resized to their minimum possible width. .. seealso:: :py:func:`setEqualColumnWidth` %End void setEqualColumnWidth( bool s ); %Docstring Sets whether all columns should have equal widths. If ``False``, then then columns will be individually resized to their minimum possible width. .. seealso:: :py:func:`equalColumnWidth` %End QColor fontColor() const; %Docstring Returns the font color used for legend items. .. seealso:: :py:func:`setFontColor` %End void setFontColor( const QColor &c ); %Docstring Sets the font color used for legend items. .. seealso:: :py:func:`fontColor` %End QColor layerFontColor() const; %Docstring Returns layer font color, defaults to :py:func:`~QgsLegendSettings.fontColor` .. seealso:: :py:func:`setLayerFontColor` .. seealso:: :py:func:`fontColor` .. versionadded:: 3.4.7 %End void setLayerFontColor( const QColor &fontColor ); %Docstring Sets layer font color to ``fontColor`` Overrides :py:func:`~QgsLegendSettings.fontColor` .. seealso:: :py:func:`layerFontColor` .. seealso:: :py:func:`fontColor` .. versionadded:: 3.4.7 %End QSizeF symbolSize() const; %Docstring Returns the default symbol size (in millimeters) used for legend items. .. seealso:: :py:func:`setSymbolSize` %End void setSymbolSize( QSizeF s ); %Docstring Sets the default symbol size (in millimeters) used for legend items. .. seealso:: :py:func:`symbolSize` %End void setSymbolAlignment( Qt::AlignmentFlag alignment ); %Docstring Sets the ``alignment`` for placement of legend symbols. Only Qt.AlignLeft or Qt.AlignRight are supported values. .. seealso:: :py:func:`symbolAlignment` .. versionadded:: 3.10 %End Qt::AlignmentFlag symbolAlignment() const; %Docstring Returns the alignment for placement of legend symbols. Only Qt.AlignLeft or Qt.AlignRight are supported values. .. seealso:: :py:func:`setSymbolAlignment` .. versionadded:: 3.10 %End bool drawRasterStroke() const; %Docstring Returns whether a stroke will be drawn around raster symbol items. .. seealso:: :py:func:`setDrawRasterStroke` .. seealso:: :py:func:`rasterStrokeColor` .. seealso:: :py:func:`rasterStrokeWidth` .. versionadded:: 2.12 %End void setDrawRasterStroke( bool enabled ); %Docstring Sets whether a stroke will be drawn around raster symbol items. :param enabled: set to ``True`` to draw borders .. seealso:: :py:func:`drawRasterStroke` .. seealso:: :py:func:`setRasterStrokeColor` .. seealso:: :py:func:`setRasterStrokeWidth` .. versionadded:: 2.12 %End QColor rasterStrokeColor() const; %Docstring Returns the stroke color for the stroke drawn around raster symbol items. The stroke is only drawn if :py:func:`~QgsLegendSettings.drawRasterStroke` is ``True``. .. seealso:: :py:func:`setRasterStrokeColor` .. seealso:: :py:func:`drawRasterStroke` .. seealso:: :py:func:`rasterStrokeWidth` .. versionadded:: 2.12 %End void setRasterStrokeColor( const QColor &color ); %Docstring Sets the stroke color for the stroke drawn around raster symbol items. The stroke is only drawn if :py:func:`~QgsLegendSettings.drawRasterStroke` is ``True``. :param color: stroke color .. seealso:: :py:func:`rasterStrokeColor` .. seealso:: :py:func:`setDrawRasterStroke` .. seealso:: :py:func:`setRasterStrokeWidth` .. versionadded:: 2.12 %End double rasterStrokeWidth() const; %Docstring Returns the stroke width (in millimeters) for the stroke drawn around raster symbol items. The stroke is only drawn if :py:func:`~QgsLegendSettings.drawRasterStroke` is ``True``. .. seealso:: :py:func:`setRasterStrokeWidth` .. seealso:: :py:func:`drawRasterStroke` .. seealso:: :py:func:`rasterStrokeColor` .. versionadded:: 2.12 %End void setRasterStrokeWidth( double width ); %Docstring Sets the stroke width for the stroke drawn around raster symbol items. The stroke is only drawn if :py:func:`~QgsLegendSettings.drawRasterStroke` is ``True``. :param width: stroke width in millimeters .. seealso:: :py:func:`rasterStrokeWidth` .. seealso:: :py:func:`setDrawRasterStroke` .. seealso:: :py:func:`setRasterStrokeColor` .. versionadded:: 2.12 %End QSizeF wmsLegendSize() const; %Docstring Returns the size (in millimeters) of WMS legend graphics shown in the legend. .. seealso:: :py:func:`setWmsLegendSize` %End void setWmsLegendSize( QSizeF s ); %Docstring Sets the desired size (in millimeters) of WMS legend graphics shown in the legend. .. seealso:: :py:func:`wmsLegendSize` %End double lineSpacing() const; %Docstring Returns the line spacing to use between lines of legend text. .. seealso:: :py:func:`setLineSpacing` %End void setLineSpacing( double s ); %Docstring Sets the line spacing to use between lines of legend text. .. seealso:: :py:func:`lineSpacing` %End double mmPerMapUnit() const /Deprecated/; %Docstring .. deprecated:: Use scale factor from render contexts instead. %End void setMmPerMapUnit( double mmPerMapUnit ) /Deprecated/; %Docstring .. deprecated:: Set scale factor on render contexts instead. %End bool useAdvancedEffects() const /Deprecated/; %Docstring .. deprecated:: Use flags from render contexts instead. %End void setUseAdvancedEffects( bool use ) /Deprecated/; %Docstring .. deprecated:: Set flag on render contexts instead. %End double mapScale() const /Deprecated/; %Docstring Returns the legend map scale. The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map. .. seealso:: :py:func:`setMapScale` .. deprecated:: take this property from the render context instead %End void setMapScale( double scale ) /Deprecated/; %Docstring Sets the legend map ``scale``. The ``scale`` value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map. .. seealso:: :py:func:`mapScale` .. deprecated:: set this property on the render context instead %End double mapUnitsPerPixel() const /Deprecated/; %Docstring Returns the factor of map units per pixel for symbols with size given in map units calculated by dpi and mmPerMapUnit .. seealso:: :py:func:`setMapUnitsPerPixel` .. deprecated:: take these properties on render contexts instead %End void setMapUnitsPerPixel( double mapUnitsPerPixel ) /Deprecated/; %Docstring Sets the mmPerMapUnit calculated by ``mapUnitsPerPixel`` mostly taken from the map settings. .. seealso:: :py:func:`mapUnitsPerPixel` .. deprecated:: set these properties on render contexts instead %End int dpi() const /Deprecated/; %Docstring .. deprecated:: Take dpi from render contexts instead. %End void setDpi( int dpi ) /Deprecated/; %Docstring .. deprecated:: Set dpi on render contexts instead. %End QStringList evaluateItemText( const QString &text, const QgsExpressionContext &context ) const; %Docstring Returns the actual text to render for a legend item, split into separate lines. The expression ``context`` argument is used to correctly evaluated expressions contained within legend item text. .. versionadded:: 3.6 %End QStringList splitStringForWrapping( const QString &stringToSplt ) const; %Docstring Splits a string using the wrap char taking into account handling empty wrap char which means no wrapping %End void drawText( QPainter *p, double x, double y, const QString &text, const QFont &font ) const; %Docstring Draws Text. Takes care about all the composer specific issues (calculation to pixel, scaling of font and painter to work around the Qt font bug) %End void drawText( QPainter *p, const QRectF &rect, const QString &text, const QFont &font, Qt::AlignmentFlag halignment = Qt::AlignLeft, Qt::AlignmentFlag valignment = Qt::AlignTop, int flags = Qt::TextWordWrap ) const; %Docstring Like the above, but with a rectangle for multiline text :param p: painter to use :param rect: rectangle to draw into :param text: text to draw :param font: font to use :param halignment: optional horizontal alignment :param valignment: optional vertical alignment :param flags: allows for passing Qt.TextFlags to control appearance of rendered text %End QFont scaledFontPixelSize( const QFont &font ) const; %Docstring Returns a font where size is in pixel and font size is upscaled with FONT_WORKAROUND_SCALE %End double pixelFontSize( double pointSize ) const; %Docstring Calculates font to from point size to pixel size %End double textWidthMillimeters( const QFont &font, const QString &text ) const; %Docstring Returns the font width in millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE %End double fontHeightCharacterMM( const QFont &font, QChar c ) const; %Docstring Returns the font height of a character in millimeters %End double fontAscentMillimeters( const QFont &font ) const; %Docstring Returns the font ascent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE %End double fontDescentMillimeters( const QFont &font ) const; %Docstring Returns the font descent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE %End }; /************************************************************************ * This file has been generated automatically from * * * * src/core/qgslegendsettings.h * * * * Do not edit manually ! Edit header and run scripts/sipify.pl again * ************************************************************************/