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;
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;
415 double mPictureWidth;
417 double mPictureHeight;
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();
Class for parsing and evaluation of expressions (formerly called "search strings").
Mode
Format of source image.
QColor svgFillColor() const
Returns the fill color used for parameterized SVG files.
virtual void setRotation(double r)
Sets the item rotation.
double svgBorderWidth() const
Returns the border width (in mm) used for parameterized SVG files.
bool useRotationMap() const
True if the picture rotation is matched to a map item.
A item that forms part of a map composition.
double pictureRotation() const
Returns the rotation used for drawing the picture within the item's frame.
NorthMode northMode() const
Returns the mode used to align the picture to a map's North.
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...
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 writeXML(QDomElement &elem, QDomDocument &doc) const
Stores item state in DOM element.
DataDefinedProperty
Data defined properties for different item types.
A composer class that displays svg files or raster format (jpg, png, ...)
Q_DECL_DEPRECATED double rotation() const
Returns the rotation used for drawing the picture within the composer item.
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
ResizeMode
Controls how pictures are scaled within the item's frame.
NorthMode
Method for syncing rotation to a map's North direction.
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...
double northOffset() const
Returns the offset added to the picture's rotation from a map's North.
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...
Graphics scene for map printing.
Object representing map window.
virtual bool readXML(const QDomElement &itemElem, const QDomDocument &doc)
Sets item state from DOM element.
Mode mode() const
Returns the current picture mode (image format).
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...
ResizeMode resizeMode() const
Returns the resize mode used for drawing the picture within the composer item's frame.
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...
Q_DECL_DEPRECATED void sizeChangedByRotation(double &width, double &height, double rotation)
Calculates width / height of the bounding box of a rotated rectangle.