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(
QString expression );
274 void refreshPicture();
286 void recalculateSize();
292 void pictureRotationChanged(
double newRotation );
299 QRectF boundedSVGRect(
double deviceWidth,
double deviceHeight );
301 QRectF boundedImageRect(
double deviceWidth,
double deviceHeight );
311 QSize mDefaultSvgSize;
314 double mPictureRotation;
318 double mPictureWidth;
320 double mPictureHeight;
322 ResizeMode mResizeMode;
325 bool mHasExpressionError;
329 void loadPicture(
const QString &path );
337 QRect clippedImageRect(
double &boundRectWidthMM,
double &boundRectHeightMM,
QSize imageRectPixels );
341 void loadRemotePicture(
const QString &url );
345 void loadLocalPicture(
const QString &path );
349 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 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.
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.
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.
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 void refreshDataDefinedProperty(const QgsComposerObject::DataDefinedProperty property=QgsComposerObject::AllProperties) override
Refreshes a data defined property for the item by reevaluating the property's value and redrawing the...
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.