QGIS API Documentation
3.2.0-Bonn (bc43194)
|
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 } |
Flags for controlling how a layout is rendered. More... | |
Signals | |
void | dpiChanged () |
Emitted when the context's DPI is changed. More... | |
void | flagsChanged (QgsLayoutRenderContext::Flags flags) |
Emitted whenever the context's flags change. More... | |
Public Member Functions | |
QgsLayoutRenderContext (QgsLayout *layout) | |
Constructor for QgsLayoutRenderContext. More... | |
bool | boundingBoxesVisible () const |
Returns true if the item bounding boxes should be drawn. More... | |
int | currentExportLayer () const |
Returns the current item layer to draw while exporting. More... | |
double | dpi () const |
Returns the dpi for outputting the layout. More... | |
QgsLayoutRenderContext::Flags | flags () const |
Returns the current combination of flags used for rendering the layout. More... | |
bool | gridVisible () const |
Returns true if the page grid should be drawn. More... | |
bool | isPreviewRender () const |
Returns true if the render current being conducted is a preview render, i.e. More... | |
const QgsLayoutMeasurementConverter & | measurementConverter () const |
Returns the layout measurement converter to be used in the layout. More... | |
QgsLayoutMeasurementConverter & | measurementConverter () |
Returns the layout measurement converter to be used in the layout. More... | |
bool | pagesVisible () const |
Returns whether the page items are be visible in the layout. More... | |
QgsRenderContext::Flags | renderContextFlags () const |
Returns the combination of render context flags matched to the layout context's settings. More... | |
void | setBoundingBoxesVisible (bool visible) |
Sets whether the item bounding boxes should be visible. More... | |
void | setCurrentExportLayer (int layer=-1) |
Sets the current item layer to draw while exporting. More... | |
void | setDpi (double dpi) |
Sets the dpi for outputting the layout. More... | |
void | setFlag (QgsLayoutRenderContext::Flag flag, bool on=true) |
Enables or disables a particular rendering flag for the layout. More... | |
void | setFlags (QgsLayoutRenderContext::Flags flags) |
Sets the combination of flags that will be used for rendering the layout. More... | |
void | setGridVisible (bool visible) |
Sets whether the page grid should be visible. More... | |
void | setPagesVisible (bool visible) |
Sets whether the page items should be visible in the layout. More... | |
bool | testFlag (Flag flag) const |
Check whether a particular rendering flag is enabled for the layout. More... | |
Friends | |
class | LayoutContextPreviewSettingRestorer |
class | QgsLayoutExporter |
class | TestQgsLayout |
Stores information relating to the current rendering settings for a layout.
Definition at line 32 of file qgslayoutrendercontext.h.
Flags for controlling how a layout is rendered.
Definition at line 40 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 98 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 186 of file qgslayoutrendercontext.h.
double QgsLayoutRenderContext::dpi | ( | ) | const |
Returns the dpi for outputting the layout.
Definition at line 83 of file qgslayoutrendercontext.cpp.
|
signal |
Emitted when the context's DPI is changed.
QgsLayoutRenderContext::Flags QgsLayoutRenderContext::flags | ( | ) | const |
Returns the current combination of flags used for rendering the layout.
Definition at line 51 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 88 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 124 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 111 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 117 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 164 of file qgslayoutrendercontext.h.
QgsRenderContext::Flags QgsLayoutRenderContext::renderContextFlags | ( | ) | const |
Returns the combination of render context flags matched to the layout context's settings.
Definition at line 61 of file qgslayoutrendercontext.cpp.
void QgsLayoutRenderContext::setBoundingBoxesVisible | ( | bool | visible | ) |
Sets whether the item bounding boxes should be visible.
Definition at line 103 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 175 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 74 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 36 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 27 of file qgslayoutrendercontext.cpp.
void QgsLayoutRenderContext::setGridVisible | ( | bool | visible | ) |
Sets whether the page grid should be visible.
Definition at line 93 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 108 of file qgslayoutrendercontext.cpp.
bool QgsLayoutRenderContext::testFlag | ( | const QgsLayoutRenderContext::Flag | flag | ) | const |
Check whether a particular rendering flag is enabled for the layout.
Definition at line 56 of file qgslayoutrendercontext.cpp.
|
friend |
Definition at line 218 of file qgslayoutrendercontext.h.
|
friend |
Definition at line 216 of file qgslayoutrendercontext.h.
|
friend |
Definition at line 217 of file qgslayoutrendercontext.h.