2009-02-27 13:57:26 +00:00
|
|
|
/** \ingroup MapComposer
|
|
|
|
* A composer class that displays svg files or raster format (jpg, png, ...)
|
|
|
|
* */
|
2009-11-19 09:04:33 +00:00
|
|
|
class QgsComposerPicture: QgsComposerItem
|
2009-02-27 13:57:26 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgscomposerpicture.h"
|
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
2009-02-28 14:35:45 +00:00
|
|
|
QgsComposerPicture( QgsComposition *composition /TransferThis/);
|
2009-02-27 13:57:26 +00:00
|
|
|
~QgsComposerPicture();
|
|
|
|
|
2010-11-25 21:45:52 +00:00
|
|
|
/** return correct graphics item type. Added in v1.7 */
|
|
|
|
virtual int type() const;
|
|
|
|
|
2009-02-27 13:57:26 +00:00
|
|
|
/**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
|
2012-09-24 02:28:15 +02:00
|
|
|
corresponds to 1 scene size unit and resizes the svg symbol / image*/
|
2009-02-27 13:57:26 +00:00
|
|
|
void setSceneRect( const QRectF& rectangle );
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
/** stores state in Dom element
|
|
|
|
* @param elem is Dom element corresponding to 'Composer' tag
|
|
|
|
* @param doc is Dom document
|
2009-02-27 13:57:26 +00:00
|
|
|
*/
|
|
|
|
bool writeXML( QDomElement& elem, QDomDocument & doc ) const;
|
|
|
|
|
|
|
|
/** sets state from Dom document
|
|
|
|
* @param itemElem is Dom node corresponding to item tag
|
2012-09-24 02:28:15 +02:00
|
|
|
* @param doc is Dom document
|
2009-02-27 13:57:26 +00:00
|
|
|
*/
|
|
|
|
bool readXML( const QDomElement& itemElem, const QDomDocument& doc );
|
|
|
|
|
2009-11-02 17:27:13 +00:00
|
|
|
/**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;
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
public slots:
|
|
|
|
/**Sets the rotation and adapts the item rect*/
|
2009-11-26 13:56:08 +00:00
|
|
|
virtual void setRotation( double r );
|
2009-02-28 14:35:45 +00:00
|
|
|
};
|