QGIS/python/core/composer/qgscomposerpicture.sip

52 lines
1.7 KiB
Plaintext
Raw Normal View History

/** \ingroup MapComposer
* A composer class that displays svg files or raster format (jpg, png, ...)
* */
class QgsComposerPicture: QgsComposerItem
{
%TypeHeaderCode
#include "qgscomposerpicture.h"
%End
public:
QgsComposerPicture( QgsComposition *composition /TransferThis/);
~QgsComposerPicture();
/** return correct graphics item type. Added in v1.7 */
virtual int type() const;
/**Reimplementation of QCanvasItem::paint*/
void paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget );
/**Sets the source file of the image (may be svg or a raster format)*/
void setPictureFile( const QString& path );
QString pictureFile() const;
/**Sets this items bound in scene coordinates such that 1 item size units
corresponds to 1 scene size unit and resizes the svg symbol / image*/
void setSceneRect( const QRectF& rectangle );
/** stores state in Dom element
* @param elem is Dom element corresponding to 'Composer' tag
* @param doc is Dom document
*/
bool writeXML( QDomElement& elem, QDomDocument & doc ) const;
/** sets state from Dom document
* @param itemElem is Dom node corresponding to item tag
* @param doc is Dom document
*/
bool readXML( const QDomElement& itemElem, const QDomDocument& doc );
/**Sets the map object for rotation (by id). A value of -1 disables the map rotation*/
void setRotationMap( int composerMapId );
/**Returns the id of the rotation map*/
int rotationMap() const;
/**True if the rotation is taken from a map item*/
bool useRotationMap() const;
public slots:
/**Sets the rotation and adapts the item rect*/
virtual void setRotation( double r );
};