17 #ifndef QGSCOMPOSERPICTURE_H
18 #define QGSCOMPOSERPICTURE_H
23 #include <QSvgRenderer>
41 void paint( QPainter* painter,
const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget );
44 void setPictureFile(
const QString& path );
45 QString pictureFile()
const;
55 bool writeXML( QDomElement& elem, QDomDocument & doc )
const;
61 bool readXML(
const QDomElement& itemElem,
const QDomDocument& doc );
66 double rotation()
const {
return mPictureRotation;};
73 void setRotationMap(
int composerMapId );
75 int rotationMap()
const;
105 virtual void setPictureRotation(
double r );
109 void pictureRotationChanged(
double newRotation );
123 QRectF boundedSVGRect(
double deviceWidth,
double deviceHeight );
125 QRectF boundedImageRect(
double deviceWidth,
double deviceHeight );
128 QSizeF pictureSize();
bool imageSizeConsideringRotation(double &width, double &height, double rotation) const
Calculates width and hight of the picture (in mm) such that it fits into the item frame with the give...
virtual bool readXML(const QDomElement &itemElem, const QDomDocument &doc)=0
sets state from Dom document
virtual void setRotation(double r)
Sets the item rotation.
A item that forms part of a map composition.
A composer class that displays svg files or raster format (jpg, png, ...)
const QgsComposerMap * mRotationMap
Map that sets the rotation (or 0 if this picture uses map independent rotation)
double mPictureHeight
Height of the picture (in mm)
bool useRotationMap() const
True if the rotation is taken from a map item.
Graphics scene for map printing.
Object representing map window.
bool cornerPointOnRotatedAndScaledRect(double &x, double &y, double width, double height, double rotation) const
Calculates corner point after rotation and scaling.
virtual void setSceneRect(const QRectF &rectangle)
Sets this items bound in scene coordinates such that 1 item size units corresponds to 1 scene size un...
double rotation() const
Returns the rotation used for drawing the picture within the composer item.
double mPictureWidth
Width of the picture (in mm)
double pictureRotation() const
Returns the rotation used for drawing the picture within the item.
double mPictureRotation
Image rotation.
virtual bool writeXML(QDomElement &elem, QDomDocument &doc) const =0
stores state in Dom element
void sizeChangedByRotation(double &width, double &height, double rotation)
Calculates width / height of the bounding box of a rotated rectangle.
virtual int type() const
return correct graphics item type.