QGIS API Documentation 3.41.0-Master (3291e9ff48b)
|
Stores information relating to the current rendering settings for a layout. More...
#include <qgslayoutrendercontext.h>
Public Types | |
enum | Flag { FlagDebug = 1 << 1 , FlagOutlineOnly = 1 << 2 , FlagAntialiasing = 1 << 3 , FlagUseAdvancedEffects = 1 << 4 , FlagForceVectorOutput = 1 << 5 , FlagHideCoverageLayer = 1 << 6 , FlagDrawSelection = 1 << 7 , FlagDisableTiledRasterLayerRenders = 1 << 8 , FlagRenderLabelsByMapLayer = 1 << 9 , FlagLosslessImageRendering = 1 << 10 , FlagSynchronousLegendGraphics = 1 << 11 , FlagAlwaysUseGlobalMasks = 1 << 12 } |
Flags for controlling how a layout is rendered. More... | |
typedef QFlags< Flag > | Flags |
Signals | |
void | dpiChanged () |
Emitted when the context's DPI is changed. | |
void | flagsChanged (QgsLayoutRenderContext::Flags flags) |
Emitted whenever the context's flags change. | |
void | predefinedScalesChanged () |
Emitted when the list of predefined scales changes. | |
Public Member Functions | |
QgsLayoutRenderContext (QgsLayout *layout) | |
Constructor for QgsLayoutRenderContext. | |
bool | boundingBoxesVisible () const |
Returns true if the item bounding boxes should be drawn. | |
Q_DECL_DEPRECATED int | currentExportLayer () const |
Returns the current item layer to draw while exporting. | |
double | dpi () const |
Returns the dpi for outputting the layout. | |
QStringList | exportThemes () const |
Returns a list of map themes to use during the export. | |
QgsFeatureFilterProvider * | featureFilterProvider () const |
Returns the (possibly nullptr ) feature filter provider. | |
QgsLayoutRenderContext::Flags | flags () const |
Returns the current combination of flags used for rendering the layout. | |
bool | gridVisible () const |
Returns true if the page grid should be drawn. | |
bool | isPreviewRender () const |
Returns true if the render current being conducted is a preview render, i.e. | |
QgsMaskRenderSettings & | maskSettings () |
Returns a reference to the mask render settings, which control how masks are drawn and behave during map renders. | |
const QgsMaskRenderSettings & | maskSettings () const |
Returns a reference to the mask render settings, which control how masks are drawn and behave during map renders. | |
QgsLayoutMeasurementConverter & | measurementConverter () |
Returns the layout measurement converter to be used in the layout. | |
const QgsLayoutMeasurementConverter & | measurementConverter () const |
Returns the layout measurement converter to be used in the layout. | |
bool | pagesVisible () const |
Returns whether the page items are be visible in the layout. | |
QVector< qreal > | predefinedScales () const |
Returns the current list of predefined scales for use with the layout. | |
Qgis::RenderContextFlags | renderContextFlags () const |
Returns the combination of render context flags matched to the layout context's settings. | |
QColor | selectionColor () const |
Gets color that is used for drawing of selected vector features. | |
void | setBoundingBoxesVisible (bool visible) |
Sets whether the item bounding boxes should be visible. | |
Q_DECL_DEPRECATED void | setCurrentExportLayer (int layer=-1) |
Sets the current item layer to draw while exporting. | |
void | setDpi (double dpi) |
Sets the dpi for outputting the layout. | |
void | setExportThemes (const QStringList &themes) |
Sets a list of map themes to use during the export. | |
void | setFeatureFilterProvider (QgsFeatureFilterProvider *featureFilterProvider) |
Sets feature filter provider to featureFilterProvider. | |
void | setFlag (QgsLayoutRenderContext::Flag flag, bool on=true) |
Enables or disables a particular rendering flag for the layout. | |
void | setFlags (QgsLayoutRenderContext::Flags flags) |
Sets the combination of flags that will be used for rendering the layout. | |
void | setGridVisible (bool visible) |
Sets whether the page grid should be visible. | |
void | setMaskSettings (const QgsMaskRenderSettings &settings) |
Sets the mask render settings, which control how masks are drawn and behave during map renders. | |
void | setPagesVisible (bool visible) |
Sets whether the page items should be visible in the layout. | |
void | setPredefinedScales (const QVector< qreal > &scales) |
Sets the list of predefined scales to use with the layout. | |
void | setSelectionColor (const QColor &color) |
Sets color that is used for drawing of selected vector features. | |
void | setSimplifyMethod (const QgsVectorSimplifyMethod &method) |
Sets the simplification setting to use when rendering vector layers. | |
void | setTextRenderFormat (Qgis::TextRenderFormat format) |
Sets the text render format, which dictates how text is rendered (e.g. | |
const QgsVectorSimplifyMethod & | simplifyMethod () const |
Returns the simplification settings to use when rendering vector layers. | |
bool | testFlag (Flag flag) const |
Check whether a particular rendering flag is enabled for the layout. | |
Qgis::TextRenderFormat | textRenderFormat () const |
Returns the text render format, which dictates how text is rendered (e.g. | |
Friends | |
class | LayoutContextPreviewSettingRestorer |
class | QgsLayoutExporter |
class | TestQgsLayout |
class | TestQgsLayoutLabel |
class | TestQgsLayoutMap |
Stores information relating to the current rendering settings for a layout.
Definition at line 36 of file qgslayoutrendercontext.h.
typedef QFlags< Flag > QgsLayoutRenderContext::Flags |
Definition at line 59 of file qgslayoutrendercontext.h.
Flags for controlling how a layout is rendered.
Definition at line 44 of file qgslayoutrendercontext.h.
QgsLayoutRenderContext::QgsLayoutRenderContext | ( | QgsLayout * | layout | ) |
Constructor for QgsLayoutRenderContext.
Definition at line 21 of file qgslayoutrendercontext.cpp.
bool QgsLayoutRenderContext::boundingBoxesVisible | ( | ) | const |
Returns true
if the item bounding boxes should be drawn.
Definition at line 105 of file qgslayoutrendercontext.cpp.
|
inline |
Returns the current item layer to draw while exporting.
QgsLayoutItem subclasses which support multi-layer SVG exports must check this and customize their rendering based on the layer.
If layer is -1, all item layers should be rendered.
Definition at line 212 of file qgslayoutrendercontext.h.
double QgsLayoutRenderContext::dpi | ( | ) | const |
Returns the dpi for outputting the layout.
Definition at line 90 of file qgslayoutrendercontext.cpp.
|
signal |
Emitted when the context's DPI is changed.
QStringList QgsLayoutRenderContext::exportThemes | ( | ) | const |
Returns a list of map themes to use during the export.
Items which handle layered exports (e.g. maps) may utilize this list to export different representations of the item as export layers, as they iterate through these included themes.
Definition at line 125 of file qgslayoutrendercontext.cpp.
QgsFeatureFilterProvider * QgsLayoutRenderContext::featureFilterProvider | ( | ) | const |
Returns the (possibly nullptr
) feature filter provider.
A feature filter provider for filtering visible features or attributes. It is currently used by QGIS Server Access Control Plugins.
Definition at line 146 of file qgslayoutrendercontext.cpp.
QgsLayoutRenderContext::Flags QgsLayoutRenderContext::flags | ( | ) | const |
Returns the current combination of flags used for rendering the layout.
Definition at line 53 of file qgslayoutrendercontext.cpp.
|
signal |
Emitted whenever the context's flags change.
bool QgsLayoutRenderContext::gridVisible | ( | ) | const |
Returns true
if the page grid should be drawn.
Definition at line 95 of file qgslayoutrendercontext.cpp.
|
inline |
Returns true
if the render current being conducted is a preview render, i.e.
it is being rendered inside a QGraphicsView widget as opposed to a destination device (such as an image).
Definition at line 148 of file qgslayoutrendercontext.h.
|
inline |
Returns a reference to the mask render settings, which control how masks are drawn and behave during map renders.
Definition at line 285 of file qgslayoutrendercontext.h.
|
inline |
Returns a reference to the mask render settings, which control how masks are drawn and behave during map renders.
Definition at line 276 of file qgslayoutrendercontext.h.
|
inline |
Returns the layout measurement converter to be used in the layout.
This converter is used for translating between other measurement units and the layout's native unit.
Definition at line 141 of file qgslayoutrendercontext.h.
|
inline |
Returns the layout measurement converter to be used in the layout.
This converter is used for translating between other measurement units and the layout's native unit.
Definition at line 135 of file qgslayoutrendercontext.h.
|
inline |
Returns whether the page items are be visible in the layout.
This setting effects both display of the page boundaries in layout views and whether they will be rendered in layout exports.
Definition at line 188 of file qgslayoutrendercontext.h.
|
inline |
Returns the current list of predefined scales for use with the layout.
Definition at line 331 of file qgslayoutrendercontext.h.
|
signal |
Qgis::RenderContextFlags QgsLayoutRenderContext::renderContextFlags | ( | ) | const |
Returns the combination of render context flags matched to the layout context's settings.
Definition at line 63 of file qgslayoutrendercontext.cpp.
|
inline |
Gets color that is used for drawing of selected vector features.
Definition at line 129 of file qgslayoutrendercontext.h.
void QgsLayoutRenderContext::setBoundingBoxesVisible | ( | bool | visible | ) |
Sets whether the item bounding boxes should be visible.
Definition at line 110 of file qgslayoutrendercontext.cpp.
|
inline |
Sets the current item layer to draw while exporting.
QgsLayoutItem subclasses which support multi-layer SVG exports must check the currentExportLayer() and customize their rendering based on the layer.
If layer is -1, all item layers will be rendered.
Definition at line 200 of file qgslayoutrendercontext.h.
void QgsLayoutRenderContext::setDpi | ( | double | dpi | ) |
Sets the dpi for outputting the layout.
This also sets the corresponding DPI for the context's measurementConverter().
Definition at line 81 of file qgslayoutrendercontext.cpp.
void QgsLayoutRenderContext::setExportThemes | ( | const QStringList & | themes | ) |
Sets a list of map themes to use during the export.
Items which handle layered exports (e.g. maps) may utilize this list to export different representations of the item as export layers, as they iterate through these included themes.
Definition at line 130 of file qgslayoutrendercontext.cpp.
void QgsLayoutRenderContext::setFeatureFilterProvider | ( | QgsFeatureFilterProvider * | featureFilterProvider | ) |
Sets feature filter provider to featureFilterProvider.
A feature filter provider for filtering visible features or attributes. It is currently used by QGIS Server Access Control Plugins.
Definition at line 151 of file qgslayoutrendercontext.cpp.
void QgsLayoutRenderContext::setFlag | ( | QgsLayoutRenderContext::Flag | flag, |
bool | on = true |
||
) |
Enables or disables a particular rendering flag for the layout.
Other existing flags are not affected.
Definition at line 38 of file qgslayoutrendercontext.cpp.
void QgsLayoutRenderContext::setFlags | ( | QgsLayoutRenderContext::Flags | flags | ) |
Sets the combination of flags that will be used for rendering the layout.
Definition at line 29 of file qgslayoutrendercontext.cpp.
void QgsLayoutRenderContext::setGridVisible | ( | bool | visible | ) |
Sets whether the page grid should be visible.
Definition at line 100 of file qgslayoutrendercontext.cpp.
void QgsLayoutRenderContext::setMaskSettings | ( | const QgsMaskRenderSettings & | settings | ) |
Sets the mask render settings, which control how masks are drawn and behave during map renders.
Definition at line 120 of file qgslayoutrendercontext.cpp.
void QgsLayoutRenderContext::setPagesVisible | ( | bool | visible | ) |
Sets whether the page items should be visible in the layout.
Removing them will prevent both display of the page boundaries in layout views and will also prevent them from being rendered in layout exports.
Definition at line 115 of file qgslayoutrendercontext.cpp.
void QgsLayoutRenderContext::setPredefinedScales | ( | const QVector< qreal > & | scales | ) |
Sets the list of predefined scales to use with the layout.
This is used for maps which are set to the predefined atlas scaling mode.
Definition at line 135 of file qgslayoutrendercontext.cpp.
|
inline |
Sets color that is used for drawing of selected vector features.
Definition at line 122 of file qgslayoutrendercontext.h.
|
inline |
Sets the simplification setting to use when rendering vector layers.
If the simplify method is enabled, it apply to all vector layers rendered inside map items.
This can be used to specify global simplification methods to apply during map exports, e.g. to allow vector layers to be simplified to an appropriate maximum level of detail during PDF exports (avoiding excessive PDF size due to huge numbers of vertices).
The default is to use no simplification.
Definition at line 253 of file qgslayoutrendercontext.h.
|
inline |
Sets the text render format, which dictates how text is rendered (e.g.
as paths or real text objects).
Definition at line 231 of file qgslayoutrendercontext.h.
|
inline |
Returns the simplification settings to use when rendering vector layers.
If enabled, it will apply to all vector layers rendered for the map.
The default is to use no simplification.
Definition at line 267 of file qgslayoutrendercontext.h.
bool QgsLayoutRenderContext::testFlag | ( | const QgsLayoutRenderContext::Flag | flag | ) | const |
Check whether a particular rendering flag is enabled for the layout.
Definition at line 58 of file qgslayoutrendercontext.cpp.
|
inline |
Returns the text render format, which dictates how text is rendered (e.g.
as paths or real text objects).
Definition at line 220 of file qgslayoutrendercontext.h.
|
friend |
Definition at line 404 of file qgslayoutrendercontext.h.
|
friend |
Definition at line 402 of file qgslayoutrendercontext.h.
|
friend |
Definition at line 403 of file qgslayoutrendercontext.h.
|
friend |
Definition at line 406 of file qgslayoutrendercontext.h.
|
friend |
Definition at line 405 of file qgslayoutrendercontext.h.