mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-24 00:47:57 -05:00
615 lines
16 KiB
Plaintext
615 lines
16 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/qgslegendsettings.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.py again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsLegendSettings
|
|
{
|
|
%Docstring(signature="appended")
|
|
The :py:class:`QgsLegendSettings` class stores the appearance and layout settings
|
|
for legend drawing with :py:class:`QgsLegendRenderer`.
|
|
|
|
The content of the legend is driven by the :py:class:`QgsLegendModel` class.
|
|
%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 /Deprecated="Since 3.40. Use QgsLegendStyle.textFormat() instead."/;
|
|
%Docstring
|
|
Returns the font color used for legend items.
|
|
|
|
.. seealso:: :py:func:`setFontColor`
|
|
|
|
.. deprecated:: 3.40
|
|
|
|
Use :py:func:`QgsLegendStyle.textFormat()` instead.
|
|
%End
|
|
|
|
void setFontColor( const QColor &c ) /Deprecated="Since 3.40. Use QgsLegendStyle.textFormat() instead."/;
|
|
%Docstring
|
|
Sets the font color used for legend items.
|
|
|
|
.. seealso:: :py:func:`fontColor`
|
|
|
|
.. deprecated:: 3.40
|
|
|
|
Use :py:func:`QgsLegendStyle.textFormat()` instead.
|
|
%End
|
|
|
|
QColor layerFontColor() const /Deprecated="Since 3.40. Use QgsLegendStyle.textFormat() instead."/;
|
|
%Docstring
|
|
Returns layer font color, defaults to :py:func:`~QgsLegendSettings.fontColor`
|
|
|
|
.. seealso:: :py:func:`setLayerFontColor`
|
|
|
|
.. seealso:: :py:func:`fontColor`
|
|
|
|
.. deprecated:: 3.40
|
|
|
|
Use :py:func:`QgsLegendStyle.textFormat()` instead.
|
|
%End
|
|
|
|
void setLayerFontColor( const QColor &fontColor ) /Deprecated="Since 3.40. Use QgsLegendStyle.textFormat() instead."/;
|
|
%Docstring
|
|
Sets layer font color to ``fontColor``
|
|
Overrides :py:func:`~QgsLegendSettings.fontColor`
|
|
|
|
.. seealso:: :py:func:`layerFontColor`
|
|
|
|
.. seealso:: :py:func:`fontColor`
|
|
|
|
.. deprecated:: 3.40
|
|
|
|
Use :py:func:`QgsLegendStyle.textFormat()` instead.
|
|
%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
|
|
|
|
double maximumSymbolSize() const;
|
|
%Docstring
|
|
Returns the maximum symbol size (in mm). 0.0 means there is no maximum set.
|
|
|
|
.. seealso:: :py:func:`setMaximumSymbolSize`
|
|
|
|
.. versionadded:: 3.16
|
|
%End
|
|
|
|
void setMaximumSymbolSize( double size );
|
|
%Docstring
|
|
Set the maximum symbol ``size`` for symbol (in millimeters).
|
|
|
|
A symbol size of 0.0 indicates no maximum is set.
|
|
|
|
.. seealso:: :py:func:`maximumSymbolSize`
|
|
|
|
.. versionadded:: 3.16
|
|
%End
|
|
|
|
double minimumSymbolSize() const;
|
|
%Docstring
|
|
Returns the minimum symbol size (in mm). A value 0.0 means there is no minimum set.
|
|
|
|
.. seealso:: :py:func:`setMinimumSymbolSize`
|
|
|
|
.. versionadded:: 3.16
|
|
%End
|
|
|
|
void setMinimumSymbolSize( double size );
|
|
%Docstring
|
|
Set the minimum symbol ``size`` for symbol (in millimeters).
|
|
|
|
A symbol size of 0.0 indicates no minimum is set.
|
|
|
|
.. seealso:: :py:func:`minimumSymbolSize`
|
|
|
|
.. versionadded:: 3.16
|
|
%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`
|
|
%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`
|
|
%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`
|
|
%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`
|
|
%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`
|
|
%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`
|
|
%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
|
|
|
|
void setSynchronousLegendRequests( bool b );
|
|
%Docstring
|
|
Sets whether to request legend graphics synchronously.
|
|
|
|
.. seealso:: :py:func:`synchronousLegendRequests`
|
|
|
|
.. versionadded:: 3.34
|
|
%End
|
|
|
|
bool synchronousLegendRequests() const;
|
|
%Docstring
|
|
Returns whether to request legend graphics synchronously.
|
|
|
|
.. seealso:: :py:func:`setSynchronousLegendRequests`
|
|
|
|
.. versionadded:: 3.34
|
|
%End
|
|
|
|
double lineSpacing() const /Deprecated="Since 3.40. Use QgsLegendStyle.textFormat() from style() instead."/;
|
|
%Docstring
|
|
Returns the line spacing to use between lines of legend text.
|
|
|
|
.. seealso:: :py:func:`setLineSpacing`
|
|
|
|
.. deprecated:: 3.40
|
|
|
|
Use :py:func:`QgsLegendStyle.textFormat()` from :py:func:`~QgsLegendSettings.style` instead.
|
|
%End
|
|
|
|
void setLineSpacing( double s );
|
|
%Docstring
|
|
Sets the line spacing to use between lines of legend text.
|
|
|
|
.. seealso:: :py:func:`lineSpacing`
|
|
|
|
.. deprecated:: 3.40
|
|
|
|
Use :py:func:`QgsLegendStyle.setTextFormat()` from :py:func:`~QgsLegendSettings.style` instead.
|
|
%End
|
|
|
|
double mmPerMapUnit() const /Deprecated="Since 3.40. Use scale factor from render contexts instead."/;
|
|
%Docstring
|
|
|
|
.. deprecated:: 3.40
|
|
|
|
Use scale factor from render contexts instead.
|
|
%End
|
|
|
|
void setMmPerMapUnit( double mmPerMapUnit ) /Deprecated="Since 3.40. Set scale factor on render contexts instead."/;
|
|
%Docstring
|
|
|
|
.. deprecated:: 3.40
|
|
|
|
Set scale factor on render contexts instead.
|
|
%End
|
|
|
|
bool useAdvancedEffects() const /Deprecated="Since 3.40. Use flags from render contexts instead."/;
|
|
%Docstring
|
|
|
|
.. deprecated:: 3.40
|
|
|
|
Use flags from render contexts instead.
|
|
%End
|
|
|
|
void setUseAdvancedEffects( bool use ) /Deprecated="Since 3.40. Set flag on render contexts instead."/;
|
|
%Docstring
|
|
|
|
.. deprecated:: 3.40
|
|
|
|
Set flag on render contexts instead.
|
|
%End
|
|
|
|
double mapScale() const /Deprecated="Since 3.40. Take this property from the render context instead."/;
|
|
%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:: 3.40
|
|
|
|
Take this property from the render context instead.
|
|
%End
|
|
|
|
void setMapScale( double scale ) /Deprecated="Since 3.40. Set this property on the render context instead."/;
|
|
%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:: 3.40
|
|
|
|
Set this property on the render context instead.
|
|
%End
|
|
|
|
double mapUnitsPerPixel() const /Deprecated="Since 3.40. Take these properties on render contexts instead."/;
|
|
%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:: 3.40
|
|
|
|
Take these properties on render contexts instead.
|
|
%End
|
|
|
|
void setMapUnitsPerPixel( double mapUnitsPerPixel ) /Deprecated="Since 3.40. Set these properties on render contexts instead."/;
|
|
%Docstring
|
|
Sets the mmPerMapUnit calculated by ``mapUnitsPerPixel`` mostly taken from the map settings.
|
|
|
|
.. seealso:: :py:func:`mapUnitsPerPixel`
|
|
|
|
.. deprecated:: 3.40
|
|
|
|
Set these properties on render contexts instead.
|
|
%End
|
|
|
|
int dpi() const /Deprecated="Since 3.40. Take dpi from render contexts instead."/;
|
|
%Docstring
|
|
|
|
.. deprecated:: 3.40
|
|
|
|
Take dpi from render contexts instead.
|
|
%End
|
|
|
|
void setDpi( int dpi ) /Deprecated="Since 3.40. Set dpi on render contexts instead."/;
|
|
%Docstring
|
|
|
|
.. deprecated:: 3.40
|
|
|
|
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
|
|
|
|
Qgis::LegendJsonRenderFlags jsonRenderFlags() const;
|
|
%Docstring
|
|
Returns the JSON export flags.
|
|
|
|
.. versionadded:: 3.36
|
|
%End
|
|
|
|
void setJsonRenderFlags( const Qgis::LegendJsonRenderFlags &jsonRenderFlags );
|
|
%Docstring
|
|
Sets the the JSON export flags to ``jsonRenderFlags``.
|
|
|
|
.. versionadded:: 3.36
|
|
%End
|
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/qgslegendsettings.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.py again *
|
|
************************************************************************/
|