17 #ifndef QGSCOMPOSERPICTURE_H
18 #define QGSCOMPOSERPICTURE_H
23 #include <QSvgRenderer>
72 Q_DECL_DEPRECATED
void setPictureFile(
const QString& path );
81 Q_DECL_DEPRECATED
QString pictureFile()
const;
91 void setPicturePath(
const QString& path );
122 Q_DECL_DEPRECATED
double rotation()
const {
return mPictureRotation; }
140 void setRotationMap(
int composerMapId );
149 int rotationMap()
const;
191 Q_DECL_DEPRECATED
bool usePictureExpression()
const;
201 Q_DECL_DEPRECATED
QString pictureExpression()
const;
240 virtual void setPictureRotation(
double r );
247 virtual void setResizeMode( ResizeMode mode );
258 virtual void setUsePictureExpression(
bool useExpression );
268 virtual void setPictureExpression(
const QString& expression );
287 void recalculateSize();
293 void pictureRotationChanged(
double newRotation );
300 QRectF boundedSVGRect(
double deviceWidth,
double deviceHeight );
302 QRectF boundedImageRect(
double deviceWidth,
double deviceHeight );
312 QSize mDefaultSvgSize;
315 double mPictureRotation;
319 double mPictureWidth;
321 double mPictureHeight;
323 ResizeMode mResizeMode;
326 bool mHasExpressionError;
330 void loadPicture(
const QString &path );
338 QRect clippedImageRect(
double &boundRectWidthMM,
double &boundRectHeightMM,
QSize imageRectPixels );
342 void loadRemotePicture(
const QString &url );
346 void loadLocalPicture(
const QString &path );
350 void remotePictureLoaded();
Class for parsing and evaluation of expressions (formerly called "search strings").
Q_DECL_DEPRECATED 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 writeXML(QDomElement &elem, QDomDocument &doc) const
Stores item state in DOM element.
virtual void refreshDataDefinedProperty(const QgsComposerObject::DataDefinedProperty property=QgsComposerObject::AllProperties, const QgsExpressionContext *context=0) override
Refreshes a data defined property for the item by reevaluating the property's value and redrawing the...
virtual void setRotation(double r)
Sets the item rotation.
Q_DECL_DEPRECATED double rotation() const
Returns the rotation used for drawing the picture within the composer item.
Mode mode() const
Returns the current picture mode (image format).
A item that forms part of a map composition.
Q_DECL_DEPRECATED void updatePictureExpression()
Prepares the picture's source expression after it is altered or the compositions atlas coverage layer...
DataDefinedProperty
Data defined properties for different item types.
ResizeMode
Controls how pictures are scaled within the item's frame.
A composer class that displays svg files or raster format (jpg, png, ...)
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
ResizeMode resizeMode() const
Returns the resize mode used for drawing the picture within the composer item's frame.
Mode
Format of source image.
ItemPositionMode pictureAnchor() const
Returns the picture's current anchor, which controls how it is placed within the picture item's frame...
virtual int type() const override
Return correct graphics item type.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
bool useRotationMap() const
True if the picture rotation is matched to a map item.
Graphics scene for map printing.
Object representing map window.
Q_DECL_DEPRECATED bool cornerPointOnRotatedAndScaledRect(double &x, double &y, double width, double height, double rotation) const
Calculates corner point after rotation and scaling.
virtual bool readXML(const QDomElement &itemElem, const QDomDocument &doc)
Sets item state from DOM element.
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 pictureRotation() const
Returns the rotation used for drawing the picture within the item's frame.
Q_DECL_DEPRECATED void sizeChangedByRotation(double &width, double &height, double rotation)
Calculates width / height of the bounding box of a rotated rectangle.