2017-07-07 13:53:14 +10:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/layout/qgslayoutcontext.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-10-11 07:24:25 +10:00
|
|
|
class QgsLayoutContext : QObject
|
2017-07-07 13:53:14 +10:00
|
|
|
{
|
|
|
|
%Docstring
|
|
|
|
Stores information relating to the current context and rendering settings for a layout.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-07-07 13:53:14 +10:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgslayoutcontext.h"
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
|
|
|
enum Flag
|
|
|
|
{
|
|
|
|
FlagDebug,
|
|
|
|
FlagOutlineOnly,
|
|
|
|
FlagAntialiasing,
|
|
|
|
FlagUseAdvancedEffects,
|
2017-12-12 17:08:34 +10:00
|
|
|
FlagForceVectorOutput,
|
2017-07-07 13:53:14 +10:00
|
|
|
};
|
|
|
|
typedef QFlags<QgsLayoutContext::Flag> Flags;
|
|
|
|
|
|
|
|
|
|
|
|
QgsLayoutContext();
|
|
|
|
|
|
|
|
void setFlags( const QgsLayoutContext::Flags flags );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the combination of ``flags`` that will be used for rendering the layout.
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setFlag()`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`flags()`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`testFlag()`
|
2017-07-07 13:53:14 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setFlag( const QgsLayoutContext::Flag flag, const bool on = true );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Enables or disables a particular rendering ``flag`` for the layout. Other existing
|
|
|
|
flags are not affected.
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setFlags()`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`flags()`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`testFlag()`
|
2017-07-07 13:53:14 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QgsLayoutContext::Flags flags() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the current combination of flags used for rendering the layout.
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setFlags()`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setFlag()`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`testFlag()`
|
2017-07-07 13:53:14 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool testFlag( const Flag flag ) const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Check whether a particular rendering ``flag`` is enabled for the layout.
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setFlags()`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setFlag()`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`flags()`
|
2017-07-07 13:53:14 +10:00
|
|
|
%End
|
|
|
|
|
2017-07-25 11:21:10 +10:00
|
|
|
QgsRenderContext::Flags renderContextFlags() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the combination of render context flags matched to the layout context's settings.
|
2017-07-25 11:21:10 +10:00
|
|
|
%End
|
|
|
|
|
2017-07-07 13:53:14 +10:00
|
|
|
void setFeature( const QgsFeature &feature );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the current ``feature`` for evaluating the layout. This feature may
|
|
|
|
be used for altering an item's content and appearance for a report
|
|
|
|
or atlas layout.
|
|
|
|
|
2017-12-19 16:50:12 +10:00
|
|
|
Emits the changed() signal.
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`feature()`
|
2017-07-07 13:53:14 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QgsFeature feature() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the current feature for evaluating the layout. This feature may
|
|
|
|
be used for altering an item's content and appearance for a report
|
|
|
|
or atlas layout.
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setFeature()`
|
2017-07-07 13:53:14 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QgsVectorLayer *layer() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the vector layer associated with the layout's context.
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setLayer()`
|
2017-07-07 13:53:14 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setLayer( QgsVectorLayer *layer );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the vector ``layer`` associated with the layout's context.
|
|
|
|
|
2017-12-19 16:50:12 +10:00
|
|
|
Emits the changed() signal.
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`layer()`
|
2017-07-07 13:53:14 +10:00
|
|
|
%End
|
|
|
|
|
2017-07-07 14:26:02 +10:00
|
|
|
void setDpi( double dpi );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the ``dpi`` for outputting the layout. This also sets the
|
|
|
|
corresponding DPI for the context's measurementConverter().
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`dpi()`
|
2017-07-07 14:26:02 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
double dpi() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the ``dpi`` for outputting the layout.
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setDpi()`
|
2017-07-07 14:26:02 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
|
|
|
|
QgsLayoutMeasurementConverter &measurementConverter();
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
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.
|
2017-07-07 14:26:02 +10:00
|
|
|
%End
|
|
|
|
|
2017-10-16 14:43:29 +10:00
|
|
|
bool isPreviewRender() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
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).
|
2017-10-16 14:43:29 +10:00
|
|
|
%End
|
|
|
|
|
2017-07-24 07:57:25 +10:00
|
|
|
bool gridVisible() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns true if the page grid should be drawn.
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setGridVisible()`
|
2017-07-24 07:57:25 +10:00
|
|
|
%End
|
|
|
|
|
2017-07-24 21:56:13 +10:00
|
|
|
void setGridVisible( bool visible );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets whether the page grid should be ``visible``.
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`gridVisible()`
|
2017-09-29 17:09:32 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool boundingBoxesVisible() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns true if the item bounding boxes should be drawn.
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setBoundingBoxesVisible()`
|
2017-09-29 17:09:32 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setBoundingBoxesVisible( bool visible );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets whether the item bounding boxes should be ``visible``.
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`boundingBoxesVisible()`
|
2017-07-24 21:56:13 +10:00
|
|
|
%End
|
|
|
|
|
2017-10-06 16:40:12 +10:00
|
|
|
void setPagesVisible( bool visible );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
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.
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`pagesVisible()`
|
2017-10-06 16:40:12 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool pagesVisible() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
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.
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setPagesVisible()`
|
2017-10-06 16:40:12 +10:00
|
|
|
%End
|
|
|
|
|
2017-10-20 14:08:03 +10:00
|
|
|
void setCurrentExportLayer( int layer = -1 );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the current item ``layer`` to draw while exporting. QgsLayoutItem subclasses
|
|
|
|
which support multi-layer SVG exports must check the currentExportLayer()
|
|
|
|
and customise their rendering based on the layer.
|
2017-10-20 14:08:03 +10:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
If ``layer`` is -1, all item layers will be rendered.
|
2017-10-20 14:08:03 +10:00
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`currentExportLayer()`
|
2017-10-20 14:08:03 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
int currentExportLayer() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the current item layer to draw while exporting. QgsLayoutItem subclasses
|
|
|
|
which support multi-layer SVG exports must check this
|
|
|
|
and customise their rendering based on the layer.
|
2017-10-20 14:08:03 +10:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
If ``layer`` is -1, all item layers should be rendered.
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setCurrentExportLayer()`
|
2017-10-20 14:08:03 +10:00
|
|
|
%End
|
|
|
|
|
2017-10-11 07:24:25 +10:00
|
|
|
signals:
|
|
|
|
|
|
|
|
void flagsChanged( QgsLayoutContext::Flags flags );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Emitted whenever the context's ``flags`` change.
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setFlags()`
|
2017-12-20 18:36:42 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void layerChanged( QgsVectorLayer *layer );
|
|
|
|
%Docstring
|
|
|
|
Emitted when the context's ``layer`` is changed.
|
2017-12-19 16:50:12 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void changed();
|
|
|
|
%Docstring
|
|
|
|
Emitted certain settings in the context is changed, e.g. by setting a new feature or vector layer
|
|
|
|
for the context.
|
2017-10-11 07:24:25 +10:00
|
|
|
%End
|
|
|
|
|
2017-07-07 13:53:14 +10:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-10-11 07:24:25 +10:00
|
|
|
|
2017-07-07 13:53:14 +10:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/layout/qgslayoutcontext.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|