17 #ifndef QGSCOMPOSERPICTURE_H
18 #define QGSCOMPOSERPICTURE_H
23 #include <QSvgRenderer>
79 Q_DECL_DEPRECATED
void setPictureFile(
const QString& path );
88 Q_DECL_DEPRECATED
QString pictureFile()
const;
98 void setPicturePath(
const QString& path );
129 Q_DECL_DEPRECATED
double rotation()
const {
return mPictureRotation; }
147 void setRotationMap(
int composerMapId );
156 int rotationMap()
const;
179 void setNorthMode( NorthMode mode );
195 void setNorthOffset(
double offset );
236 void setSvgFillColor(
const QColor& color );
253 void setSvgBorderColor(
const QColor& color );
270 void setSvgBorderWidth(
double width );
281 Q_DECL_DEPRECATED
bool usePictureExpression()
const;
291 Q_DECL_DEPRECATED
QString pictureExpression()
const;
330 virtual void setPictureRotation(
double r );
337 virtual void setResizeMode( ResizeMode mode );
348 virtual void setUsePictureExpression(
bool useExpression );
358 virtual void setPictureExpression(
const QString& expression );
377 void recalculateSize();
383 void pictureRotationChanged(
double newRotation );
390 QRectF boundedSVGRect(
double deviceWidth,
double deviceHeight );
392 QRectF boundedImageRect(
double deviceWidth,
double deviceHeight );
402 QSize mDefaultSvgSize;
405 double mPictureRotation;
410 NorthMode mNorthMode;
415 double mPictureWidth;
417 double mPictureHeight;
419 ResizeMode mResizeMode;
424 double mSvgBorderWidth;
426 bool mHasExpressionError;
431 void loadPicture(
const QString &path );
439 QRect clippedImageRect(
double &boundRectWidthMM,
double &boundRectHeightMM,
QSize imageRectPixels );
443 void loadRemotePicture(
const QString &url );
447 void loadLocalPicture(
const QString &path );
451 void remotePictureLoaded();
453 void updateMapRotation();
NorthMode northMode() const
Returns the mode used to align the picture to a map's North.
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.
QColor svgFillColor() const
Returns the fill color used for parameterized SVG files.
Q_DECL_DEPRECATED double rotation() const
Returns the rotation used for drawing the picture within the composer item.
double svgBorderWidth() const
Returns the border width (in mm) used for parameterized SVG files.
NorthMode
Method for syncing rotation to a map's North direction.
Mode mode() const
Returns the current picture mode (image format).
A item that forms part of a map composition.
QColor svgBorderColor() const
Returns the border color used for parameterized SVG files.
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...
virtual void refreshDataDefinedProperty(const QgsComposerObject::DataDefinedProperty property=QgsComposerObject::AllProperties, const QgsExpressionContext *context=nullptr) override
Refreshes a data defined property for the item by reevaluating the property's value and redrawing the...
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.
double northOffset() const
Returns the offset added to the picture's rotation from a map's North.
Q_DECL_DEPRECATED void sizeChangedByRotation(double &width, double &height, double rotation)
Calculates width / height of the bounding box of a rotated rectangle.