QGIS/python/core/auto_generated/layout/qgslayoutitempicture.sip.in

316 lines
7.9 KiB
Plaintext
Raw Normal View History

2017-10-23 17:05:46 +10:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgslayoutitempicture.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsLayoutItemPicture: QgsLayoutItem
{
%Docstring
2017-12-15 10:36:55 -04:00
A layout item subclass that displays SVG files or raster format images (jpg, png, ...).
2017-10-23 17:05:46 +10:00
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgslayoutitempicture.h"
%End
public:
enum ResizeMode
{
Zoom,
Stretch,
Clip,
ZoomResizeFrame,
FrameToImageSize
};
enum Format
{
FormatSVG,
FormatRaster,
FormatUnknown,
};
enum NorthMode
{
GridNorth,
TrueNorth,
};
QgsLayoutItemPicture( QgsLayout *layout );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsLayoutItemPicture, with the specified parent ``layout``.
2017-10-23 17:05:46 +10:00
%End
virtual int type() const;
virtual QIcon icon() const;
2017-10-23 17:05:46 +10:00
static QgsLayoutItemPicture *create( QgsLayout *layout ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a new picture item for the specified ``layout``.
The caller takes responsibility for deleting the returned object.
2017-10-23 17:05:46 +10:00
%End
void setPicturePath( const QString &path );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the source ``path`` of the image (may be svg or a raster format). Data defined
picture source may override this value. The path can either be a local path
or a remote (http) path.
.. seealso:: :py:func:`picturePath`
2017-10-23 17:05:46 +10:00
%End
QString picturePath() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the path of the source image. Data defined picture source may override
this value. The path can either be a local path or a remote (http) path.
:return: path for the source image
.. seealso:: :py:func:`setPicturePath`
2017-10-23 17:05:46 +10:00
%End
double pictureRotation() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the rotation used for drawing the picture within the item's frame,
in degrees clockwise.
.. seealso:: :py:func:`setPictureRotation`
2017-12-15 10:36:55 -04:00
2018-05-25 09:00:58 +10:00
.. seealso:: :py:func:`linkedMap`
2017-10-23 17:05:46 +10:00
%End
void setLinkedMap( QgsLayoutItemMap *map );
2017-10-23 17:05:46 +10:00
%Docstring
Sets the ``map`` object for rotation.
If this is set then the picture will be rotated by the same
2017-12-15 10:36:55 -04:00
amount as the specified map object. This is useful especially for
syncing north arrows with a map item.
.. seealso:: :py:func:`setPictureRotation`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`linkedMap`
2017-10-23 17:05:46 +10:00
%End
QgsLayoutItemMap *linkedMap() const;
2017-10-23 17:05:46 +10:00
%Docstring
Returns the linked rotation map, if set. An None means map rotation is
2017-12-15 10:36:55 -04:00
disabled. If this is set then the picture is rotated by the same amount
as the specified map object.
.. seealso:: :py:func:`setLinkedMap`
2017-10-23 17:05:46 +10:00
%End
NorthMode northMode() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the mode used to align the picture to a map's North.
.. seealso:: :py:func:`setNorthMode`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`northOffset`
2017-10-23 17:05:46 +10:00
%End
void setNorthMode( NorthMode mode );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``mode`` used to align the picture to a map's North.
.. seealso:: :py:func:`northMode`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setNorthOffset`
2017-10-23 17:05:46 +10:00
%End
double northOffset() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the offset added to the picture's rotation from a map's North.
.. seealso:: :py:func:`setNorthOffset`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`northMode`
2017-10-23 17:05:46 +10:00
%End
void setNorthOffset( double offset );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``offset`` added to the picture's rotation from a map's North.
.. seealso:: :py:func:`northOffset`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setNorthMode`
2017-10-23 17:05:46 +10:00
%End
ResizeMode resizeMode() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the resize mode used for drawing the picture within the composer
item's frame.
.. seealso:: :py:func:`setResizeMode`
2017-10-23 17:05:46 +10:00
%End
void setPictureAnchor( QgsLayoutItem::ReferencePoint anchor );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the picture's ``anchor`` point, which controls how it is placed
within the picture item's frame.
.. seealso:: :py:func:`pictureAnchor`
2017-10-23 17:05:46 +10:00
%End
QgsLayoutItem::ReferencePoint pictureAnchor() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the picture's current anchor, which controls how it is placed
within the picture item's frame.
.. seealso:: :py:func:`setPictureAnchor`
2017-10-23 17:05:46 +10:00
%End
QColor svgFillColor() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the fill color used for parametrized SVG files.
.. seealso:: :py:func:`setSvgFillColor`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`svgStrokeColor`
2017-10-23 17:05:46 +10:00
%End
void setSvgFillColor( const QColor &color );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the fill ``color`` used for parametrized SVG files.
2017-10-23 17:05:46 +10:00
.. note::
This setting only has an effect on parametrized SVG files, and is ignored for
2018-01-12 20:51:17 -04:00
non-parametrized SVG files.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`svgFillColor`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setSvgStrokeColor`
2017-10-23 17:05:46 +10:00
%End
QColor svgStrokeColor() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the stroke color used for parametrized SVG files.
.. seealso:: :py:func:`setSvgStrokeColor`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`svgFillColor`
2017-10-23 17:05:46 +10:00
%End
void setSvgStrokeColor( const QColor &color );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the stroke ``color`` used for parametrized SVG files.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param color: stroke color.
2017-10-23 17:05:46 +10:00
.. note::
This setting only has an effect on parametrized SVG files, and is ignored for
2018-01-12 20:51:17 -04:00
non-parametrized SVG files.
2017-12-15 10:36:55 -04:00
2018-05-25 09:00:58 +10:00
.. seealso:: :py:func:`svgStrokeColor`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setSvgFillColor`
2017-10-23 17:05:46 +10:00
%End
double svgStrokeWidth() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the stroke width (in layout units) used for parametrized SVG files.
.. seealso:: :py:func:`setSvgStrokeWidth`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`svgStrokeColor`
2017-10-23 17:05:46 +10:00
%End
void setSvgStrokeWidth( double width );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the stroke ``width`` (in layout units) used for parametrized SVG files.
2017-10-23 17:05:46 +10:00
.. note::
This setting only has an effect on parametrized SVG files, and is ignored for
2018-01-12 20:51:17 -04:00
non-parametrized SVG files.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`svgStrokeWidth`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setSvgStrokeColor`
2017-10-23 17:05:46 +10:00
%End
Format mode() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the current picture mode (image format).
2017-10-23 17:05:46 +10:00
%End
virtual void finalizeRestoreFromXml();
2017-10-23 17:05:46 +10:00
public slots:
void setPictureRotation( double rotation );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the picture ``rotation`` within the item bounds, in degrees clockwise. This does not affect
the item's frame, only the way the picture is drawn within the item.
.. seealso:: :py:func:`pictureRotation`
2017-10-23 17:05:46 +10:00
%End
void setResizeMode( QgsLayoutItemPicture::ResizeMode mode );
2017-10-23 17:05:46 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the resize ``mode`` used for drawing the picture within the item bounds.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param mode: ResizeMode to use for image file
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`resizeMode`
2017-10-23 17:05:46 +10:00
%End
void refreshPicture( const QgsExpressionContext *context = 0 );
%Docstring
2017-12-15 10:36:55 -04:00
Recalculates the source image (if using an expression for picture's source)
and reloads and redraws the picture.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param context: expression context for evaluating data defined picture sources
2017-10-23 17:05:46 +10:00
%End
void recalculateSize();
%Docstring
2017-12-15 10:36:55 -04:00
Forces a recalculation of the picture's frame size
2017-10-23 17:05:46 +10:00
%End
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
2017-10-23 17:05:46 +10:00
signals:
void pictureRotationChanged( double newRotation );
%Docstring
Is emitted on picture rotation change
%End
protected:
virtual void draw( QgsLayoutItemRenderContext &context );
2017-10-23 17:05:46 +10:00
2018-08-13 13:00:14 +10:00
virtual QSizeF applyItemSizeConstraint( QSizeF targetSize );
2017-10-23 17:05:46 +10:00
2017-10-23 17:21:18 +10:00
virtual bool writePropertiesToElement( QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context ) const;
virtual bool readPropertiesFromElement( const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context );
2017-10-23 17:05:46 +10:00
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgslayoutitempicture.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/