38#include <QCoreApplication>
39#include <QDomDocument>
43#include <QImageReader>
44#include <QNetworkReply>
45#include <QNetworkRequest>
48#include <QSvgRenderer>
51#include "moc_qgslayoutitempicture.cpp"
53using namespace Qt::StringLiterals;
97 const bool prevSmoothTransform = painter->testRenderHint( QPainter::RenderHint::SmoothPixmapTransform );
99 painter->setRenderHint( QPainter::RenderHint::SmoothPixmapTransform,
true );
104 double boundRectWidthMM;
105 double boundRectHeightMM;
109 boundRectWidthMM = mPictureWidth;
110 boundRectHeightMM = mPictureHeight;
111 imageRect = QRect( 0, 0, mImage.width(), mImage.height() );
115 boundRectWidthMM = rect().width();
116 boundRectHeightMM = rect().height();
117 imageRect = QRect( 0, 0, mImage.width(), mImage.height() );
121 boundRectWidthMM = rect().width();
122 boundRectHeightMM = rect().height();
123 const int imageRectWidthPixels = mImage.width();
124 const int imageRectHeightPixels = mImage.height();
125 imageRect = clippedImageRect( boundRectWidthMM, boundRectHeightMM, QSize( imageRectWidthPixels, imageRectHeightPixels ) );
129 boundRectWidthMM = rect().width();
130 boundRectHeightMM = rect().height();
140 if ( mResizeMode ==
Zoom )
146 painter->translate( rect().width() / 2.0, rect().height() / 2.0 );
147 painter->rotate( mPictureRotation );
148 painter->translate( -boundRectWidthMM / 2.0, -boundRectHeightMM / 2.0 );
153 const double diffX = rect().width() - boundRectWidthMM;
154 const double diffY = rect().height() - boundRectHeightMM;
158 switch ( mPictureAnchor )
176 switch ( mPictureAnchor )
194 painter->translate( dX, dY );
201 painter->translate( rect().width() / 2.0, rect().height() / 2.0 );
202 painter->rotate( mPictureRotation );
203 painter->translate( -boundRectWidthMM / 2.0, -boundRectHeightMM / 2.0 );
209 mSVG.render( painter, QRectF( 0, 0, boundRectWidthMM, boundRectHeightMM ) );
213 painter->drawImage( QRectF( 0, 0, boundRectWidthMM, boundRectHeightMM ), mImage, imageRect );
216 painter->setRenderHint( QPainter::RenderHint::SmoothPixmapTransform, prevSmoothTransform );
221 const QSizeF currentPictureSize = pictureSize();
222 QSizeF newSize = targetSize;
225 mPictureWidth = targetSize.width();
226 mPictureHeight = targetSize.height();
230 if ( mResizeMode ==
ZoomResizeFrame && !rect().isEmpty() && !( currentPictureSize.isEmpty() ) )
232 QSizeF targetImageSize;
235 targetImageSize = currentPictureSize;
241 tr.rotate( mPictureRotation );
242 const QRectF rotatedBounds = tr.mapRect( QRectF( 0, 0, currentPictureSize.width(), currentPictureSize.height() ) );
243 targetImageSize = QSizeF( rotatedBounds.width(), rotatedBounds.height() );
248 if ( std::fabs( rect().width() - targetSize.width() ) < std::fabs( rect().height() - targetSize.height() ) )
250 newSize.setHeight( targetImageSize.height() * newSize.width() / targetImageSize.width() );
254 newSize.setWidth( targetImageSize.width() * newSize.height() / targetImageSize.height() );
259 if ( !( currentPictureSize.isEmpty() ) )
262 newSize.setWidth( sizeMM.
width() * 25.4 /
mLayout->renderContext().dpi() );
263 newSize.setHeight( sizeMM.
height() * 25.4 /
mLayout->renderContext().dpi() );
270 const QRectF rotatedImageRect
272 mPictureWidth = rotatedImageRect.width();
273 mPictureHeight = rotatedImageRect.height();
277 mPictureWidth = newSize.width();
278 mPictureHeight = newSize.height();
281 if ( newSize != targetSize )
290QRect QgsLayoutItemPicture::clippedImageRect(
double &boundRectWidthMM,
double &boundRectHeightMM, QSize imageRectPixels )
292 const int boundRectWidthPixels = boundRectWidthMM *
mLayout->renderContext().dpi() / 25.4;
293 const int boundRectHeightPixels = boundRectHeightMM *
mLayout->renderContext().dpi() / 25.4;
296 boundRectWidthMM = boundRectWidthPixels * 25.4 /
mLayout->renderContext().dpi();
297 boundRectHeightMM = boundRectHeightPixels * 25.4 /
mLayout->renderContext().dpi();
304 switch ( mPictureAnchor )
314 leftClip = ( imageRectPixels.width() - boundRectWidthPixels ) / 2;
319 leftClip = imageRectPixels.width() - boundRectWidthPixels;
324 switch ( mPictureAnchor )
334 topClip = ( imageRectPixels.height() - boundRectHeightPixels ) / 2;
339 topClip = imageRectPixels.height() - boundRectHeightPixels;
343 return QRect( leftClip, topClip, boundRectWidthPixels, boundRectHeightPixels );
353 QVariant source( mSourcePath );
356 mHasExpressionError =
false;
362 source = sourceProperty.
value( *evalContext, source, &ok );
363 if ( !ok || !source.canConvert( QMetaType::QString ) )
365 mHasExpressionError =
true;
372 else if ( source.userType() != QMetaType::Type::QByteArray )
374 source = source.toString().trimmed();
375 QgsDebugMsgLevel( u
"exprVal PictureSource:%1"_s.arg( source.toString() ), 2 );
379 loadPicture( source );
382void QgsLayoutItemPicture::loadRemotePicture(
const QString &url )
392 loop.exec( QEventLoop::ExcludeUserInputEvents );
394 QNetworkReply *reply = fetcher.
reply();
397 QImageReader imageReader( reply );
398 imageReader.setAutoTransform(
true );
400 if ( imageReader.format() ==
"pdf" )
409 const QSize sizeAt72Dpi = imageReader.size();
410 const QSize sizeAtTargetDpi = sizeAt72Dpi *
mLayout->renderContext().dpi() / 72;
411 imageReader.setScaledSize( sizeAtTargetDpi );
414 mImage = imageReader.read();
423void QgsLayoutItemPicture::loadLocalPicture(
const QString &path )
426 pic.setFileName( path );
434 const QFileInfo sourceFileInfo( pic );
435 const QString sourceFileSuffix = sourceFileInfo.suffix();
436 if ( sourceFileSuffix.compare(
"svg"_L1, Qt::CaseInsensitive ) == 0 )
445 const QByteArray &svgContent =
QgsApplication::svgCache()->
svgContent( path, rect().width(), fillColor, strokeColor, strokeWidth, 1.0, 0,
false, evaluatedParameters );
446 mSVG.load( svgContent );
447 if ( mSVG.isValid() )
450 const QRect viewBox = mSVG.viewBox();
451 mDefaultSvgSize.setWidth( viewBox.width() );
452 mDefaultSvgSize.setHeight( viewBox.height() );
462 QImageReader imageReader( pic.fileName() );
463 imageReader.setAutoTransform(
true );
465 if ( imageReader.format() ==
"pdf" )
474 const QSize sizeAt72Dpi = imageReader.size();
475 const QSize sizeAtTargetDpi = sizeAt72Dpi *
mLayout->renderContext().dpi() / 72;
476 imageReader.setScaledSize( sizeAtTargetDpi );
479 if ( imageReader.read( &mImage ) )
491void QgsLayoutItemPicture::loadPictureUsingCache(
const QString &path )
493 if ( path.isEmpty() )
496 mSVG.load( QByteArray() );
507 bool fitsInCache =
false;
508 bool isMissing =
false;
510 if ( mImage.isNull() || isMissing )
526 mSVG.load( svgContent );
530 const QRect viewBox = mSVG.viewBox();
531 mDefaultSvgSize.setWidth( viewBox.width() );
532 mDefaultSvgSize.setHeight( viewBox.height() );
543void QgsLayoutItemPicture::updateNorthArrowRotation(
double rotation )
549void QgsLayoutItemPicture::loadPicture(
const QVariant &data )
551 mIsMissingImage =
false;
552 QVariant imageData( data );
553 mEvaluatedPath = data.toString();
557 const QByteArray base64 = mEvaluatedPath.mid( 7 ).toLocal8Bit();
558 imageData = QByteArray::fromBase64( base64, QByteArray::OmitTrailingEquals );
561 if ( imageData.userType() == QMetaType::Type::QByteArray )
563 if ( mImage.loadFromData( imageData.toByteArray() ) )
571 loadRemotePicture( mEvaluatedPath );
576 loadLocalPicture( mEvaluatedPath );
580 loadPictureUsingCache( mEvaluatedPath );
589 else if ( mHasExpressionError || !mEvaluatedPath.isEmpty() )
592 mIsMissingImage =
true;
595 const QString badFile( u
":/images/composer/missing_image.png"_s );
596 QImageReader imageReader( badFile );
597 if ( imageReader.read( &mImage ) )
602 const QString badFile( u
":/images/composer/missing_image.svg"_s );
603 mSVG.load( badFile );
604 if ( mSVG.isValid() )
607 const QRect viewBox = mSVG.viewBox();
608 mDefaultSvgSize.setWidth( viewBox.width() );
609 mDefaultSvgSize.setHeight( viewBox.height() );
619QSizeF QgsLayoutItemPicture::pictureSize()
623 return mDefaultSvgSize;
627 return QSizeF( mImage.width(), mImage.height() );
631 return QSizeF( 0, 0 );
637 return mIsMissingImage;
642 return mEvaluatedPath;
647 const QVariantMap parameters =
mCustomProperties.value( u
"svg-dynamic-parameters"_s, QVariantMap() ).toMap();
658void QgsLayoutItemPicture::shapeChanged()
670 const double oldRotation = mPictureRotation;
671 mPictureRotation = rotation;
672 const QSizeF currentPictureSize = pictureSize();
675 if ( !mLoaded || currentPictureSize == QSizeF( 0, 0 ) )
678 if ( mResizeMode ==
Zoom )
682 mPictureWidth = rotatedImageRect.width();
683 mPictureHeight = rotatedImageRect.height();
688 const QRectF oldRect = QRectF( pos().x(), pos().y(), rect().width(), rect().height() );
695 tr.rotate( mPictureRotation );
696 QRectF newRect = tr.mapRect( QRectF( 0, 0, rotatedImageRect.width(), rotatedImageRect.height() ) );
699 newRect.moveCenter( oldRect.center() );
709 mNorthArrowHandler->setLinkedMap( map );
747 mOriginalMode = format;
760 QString imagePath = mSourcePath;
764 if ( imagePath.endsWith(
".svg"_L1, Qt::CaseInsensitive ) )
767 imagePath = pathResolver.
writePath( imagePath );
769 elem.setAttribute( u
"file"_s, imagePath );
770 elem.setAttribute( u
"pictureWidth"_s, QString::number( mPictureWidth ) );
771 elem.setAttribute( u
"pictureHeight"_s, QString::number( mPictureHeight ) );
772 elem.setAttribute( u
"resizeMode"_s, QString::number(
static_cast< int >( mResizeMode ) ) );
773 elem.setAttribute( u
"anchorPoint"_s, QString::number(
static_cast< int >( mPictureAnchor ) ) );
776 elem.setAttribute( u
"svgBorderWidth"_s, QString::number( mSvgStrokeWidth ) );
777 elem.setAttribute( u
"mode"_s,
static_cast< int >( mOriginalMode ) );
780 elem.setAttribute( u
"pictureRotation"_s, QString::number( mPictureRotation ) );
781 if ( !mNorthArrowHandler->linkedMap() )
783 elem.setAttribute( u
"mapUuid"_s, QString() );
787 elem.setAttribute( u
"mapUuid"_s, mNorthArrowHandler->linkedMap()->uuid() );
789 elem.setAttribute( u
"northMode"_s, mNorthArrowHandler->northMode() );
790 elem.setAttribute( u
"northOffset"_s, mNorthArrowHandler->northOffset() );
796 mPictureWidth = itemElem.attribute( u
"pictureWidth"_s, u
"10"_s ).toDouble();
797 mPictureHeight = itemElem.attribute( u
"pictureHeight"_s, u
"10"_s ).toDouble();
804 mSvgStrokeWidth = itemElem.attribute( u
"svgBorderWidth"_s, u
"0.2"_s ).toDouble();
806 mMode = mOriginalMode;
808 const QDomNodeList composerItemList = itemElem.elementsByTagName( u
"ComposerItem"_s );
809 if ( !composerItemList.isEmpty() )
811 const QDomElement composerItemElem = composerItemList.at( 0 ).toElement();
813 if ( !
qgsDoubleNear( composerItemElem.attribute( u
"rotation"_s, u
"0"_s ).toDouble(), 0.0 ) )
816 mPictureRotation = composerItemElem.attribute( u
"rotation"_s, u
"0"_s ).toDouble();
820 mDefaultSvgSize = QSize( 0, 0 );
822 if ( itemElem.hasAttribute( u
"sourceExpression"_s ) )
825 const QString sourceExpression = itemElem.attribute( u
"sourceExpression"_s, QString() );
826 const QString useExpression = itemElem.attribute( u
"useExpression"_s );
827 bool expressionActive;
828 expressionActive = ( useExpression.compare(
"true"_L1, Qt::CaseInsensitive ) == 0 );
833 QString imagePath = itemElem.attribute( u
"file"_s );
837 if ( imagePath.endsWith(
".svg"_L1, Qt::CaseInsensitive ) )
840 imagePath = pathResolver.
readPath( imagePath );
842 mSourcePath = imagePath;
845 if ( !
qgsDoubleNear( itemElem.attribute( u
"pictureRotation"_s, u
"0"_s ).toDouble(), 0.0 ) )
847 mPictureRotation = itemElem.attribute( u
"pictureRotation"_s, u
"0"_s ).toDouble();
852 mNorthArrowHandler->setNorthOffset( itemElem.attribute( u
"northOffset"_s, u
"0"_s ).toDouble() );
854 mNorthArrowHandler->setLinkedMap(
nullptr );
855 mRotationMapUuid = itemElem.attribute( u
"mapUuid"_s );
862 return mNorthArrowHandler->linkedMap();
877 return mNorthArrowHandler->northOffset();
882 mNorthArrowHandler->setNorthOffset( offset );
887 mPictureAnchor = anchor;
893 mSvgFillColor = color;
899 mSvgStrokeColor = color;
905 mSvgStrokeWidth = width;
911 if ( mOriginalMode ==
mode )
914 mOriginalMode =
mode;
921 if ( !
mLayout || mRotationMapUuid.isEmpty() )
923 mNorthArrowHandler->setLinkedMap(
nullptr );
927 mNorthArrowHandler->setLinkedMap( qobject_cast< QgsLayoutItemMap * >(
mLayout->itemByUuid( mRotationMapUuid,
true ) ) );
@ Millimeters
Millimeters.
PictureFormat
Picture formats.
@ Unknown
Invalid or unknown image type.
@ Antialiasing
Use antialiasing when drawing items.
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
static QgsImageCache * imageCache()
Returns the application's image cache, used for caching resampled versions of raster images.
static QgsSvgCache * svgCache()
Returns the application's SVG cache, used for caching SVG images and handling parameter replacement w...
static QColor colorFromString(const QString &string)
Decodes a string into a color value.
static QString colorToString(const QColor &color)
Encodes a color into a string value.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
QgsFeature feature() const
Convenience function for retrieving the feature for the context, if set.
bool isValid() const
Returns the validity of this feature.
QImage pathAsImage(const QString &path, const QSize size, const bool keepAspectRatio, const double opacity, bool &fitsInCache, bool blocking=false, double targetDpi=96, int frameNumber=-1, bool *isMissing=nullptr)
Returns the specified path rendered as an image.
void setResizeMode(QgsLayoutItemPicture::ResizeMode mode)
Sets the resize mode used for drawing the picture within the item bounds.
void setMode(Qgis::PictureFormat mode)
Sets the current picture mode (image format).
void setSvgDynamicParameters(const QMap< QString, QgsProperty > ¶meters)
Sets the SVG dynamic parameters.
QMap< QString, QgsProperty > svgDynamicParameters() const
Returns the SVG dynamic parameters.
QString picturePath() const
Returns the path of the source image.
void setPictureAnchor(QgsLayoutItem::ReferencePoint anchor)
Sets the picture's anchor point, which controls how it is placed within the picture item's frame.
void setNorthMode(NorthMode mode)
Sets the mode used to align the picture to a map's North.
double northOffset() const
Returns the offset added to the picture's rotation from a map's North.
QgsLayoutItemPicture(QgsLayout *layout)
Constructor for QgsLayoutItemPicture, with the specified parent layout.
void setLinkedMap(QgsLayoutItemMap *map)
Sets the map object for rotation.
void setPicturePath(const QString &path, Qgis::PictureFormat format=Qgis::PictureFormat::Unknown)
Sets the source path of the image (may be svg or a raster format).
void setPictureRotation(double rotation)
Sets the picture rotation within the item bounds, in degrees clockwise.
bool isMissingImage() const
Returns true if the source image is missing and the picture cannot be rendered.
bool writePropertiesToElement(QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const override
Stores item state within an XML DOM element.
bool readPropertiesFromElement(const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context) override
Sets item state from a DOM element.
void setSvgStrokeWidth(double width)
Sets the stroke width (in layout units) used for parametrized SVG files.
QgsLayoutItemMap * linkedMap() const
Returns the linked rotation map, if set.
void pictureRotationChanged(double newRotation)
Emitted on picture rotation change.
void draw(QgsLayoutItemRenderContext &context) override
Draws the item's contents using the specified item render context.
static QgsLayoutItemPicture * create(QgsLayout *layout)
Returns a new picture item for the specified layout.
Qgis::PictureFormat mode() const
Returns the current picture mode (image format), FormatUnknown if given picture format is unknown.
NorthMode
Method for syncing rotation to a map's North direction.
void finalizeRestoreFromXml() override
Called after all pending items have been restored from XML.
QString evaluatedPath() const
Returns the current evaluated picture path, which includes the result of data defined path overrides.
QSizeF applyItemSizeConstraint(QSizeF targetSize) override
Applies any item-specific size constraint handling to a given targetSize in layout units.
void setSvgStrokeColor(const QColor &color)
Sets the stroke color used for parametrized SVG files.
int type() const override
void refreshDataDefinedProperty(QgsLayoutObject::DataDefinedProperty property=QgsLayoutObject::DataDefinedProperty::AllProperties) override
QIcon icon() const override
Returns the item's icon.
void refreshPicture(const QgsExpressionContext *context=nullptr)
Recalculates the source image (if using an expression for picture's source) and reloads and redraws t...
NorthMode northMode() const
Returns the mode used to align the picture to a map's North.
void setSvgFillColor(const QColor &color)
Sets the fill color used for parametrized SVG files.
void recalculateSize()
Forces a recalculation of the picture's frame size.
ResizeMode
Controls how pictures are scaled within the item's frame.
@ FrameToImageSize
Sets size of frame to match original size of image without scaling.
@ ZoomResizeFrame
Enlarges image to fit frame, then resizes frame to fit resultant image.
@ Clip
Draws image at original size and clips any portion which falls outside frame.
@ Stretch
Stretches image to fit frame, ignores aspect ratio.
@ Zoom
Enlarges image to fit frame while maintaining aspect ratio of picture.
void setNorthOffset(double offset)
Sets the offset added to the picture's rotation from a map's North.
@ LayoutPicture
Picture item.
Contains settings and helpers relating to a render of a QgsLayoutItem.
QgsRenderContext & renderContext()
Returns a reference to the context's render context.
virtual void refreshDataDefinedProperty(QgsLayoutObject::DataDefinedProperty property=QgsLayoutObject::DataDefinedProperty::AllProperties)
Refreshes a data defined property for the item by reevaluating the property's value and redrawing the...
QgsLayoutItem(QgsLayout *layout, bool manageZValue=true)
Constructor for QgsLayoutItem, with the specified parent layout.
ReferencePoint
Fixed position reference point.
@ LowerMiddle
Lower center of item.
@ MiddleLeft
Middle left of item.
@ UpperRight
Upper right corner of item.
@ LowerLeft
Lower left corner of item.
@ UpperLeft
Upper left corner of item.
@ UpperMiddle
Upper center of item.
@ MiddleRight
Middle right of item.
@ LowerRight
Lower right corner of item.
friend class QgsLayoutItemMap
QgsExpressionContext createExpressionContext() const override
This method needs to be reimplemented in all classes which implement this interface and return an exp...
void sizePositionChanged()
Emitted when the item's size or position changes.
void attemptSetSceneRect(const QRectF &rect, bool includesFrame=false)
Attempts to update the item's position and size to match the passed rect in layout coordinates.
void setBackgroundEnabled(bool drawBackground)
Sets whether this item has a background drawn under it or not.
An object which handles north-arrow type behavior for layout items.
void arrowRotationChanged(double newRotation)
Emitted on arrow rotation change.
NorthMode
Method for syncing rotation to a map's North direction.
QgsObjectCustomProperties mCustomProperties
Custom properties for object.
QgsPropertyCollection mDataDefinedProperties
const QgsLayout * layout() const
Returns the layout the object is attached to.
void changed()
Emitted when the object's properties change.
QPointer< QgsLayout > mLayout
DataDefinedProperty
Data defined properties for different item types.
@ PictureSvgStrokeColor
SVG stroke color.
@ PictureSvgBackgroundColor
SVG background color.
@ PictureSource
Picture source url.
@ PictureSvgStrokeWidth
SVG stroke width.
@ AllProperties
All properties for item.
void dpiChanged()
Emitted when the context's DPI is changed.
void changed()
Emitted certain settings in the context is changed, e.g.
Provides a method of storing sizes, consisting of a width and height, for use in QGIS layouts.
double height() const
Returns the height of the size.
double width() const
Returns the width of the size.
static QRectF largestRotatedRectWithinBounds(const QRectF &originalRect, const QRectF &boundsRect, double rotation)
Calculates the largest scaled version of originalRect which fits within boundsRect,...
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::MessageLevel::Warning, bool notifyUser=true, const char *file=__builtin_FILE(), const char *function=__builtin_FUNCTION(), int line=__builtin_LINE(), Qgis::StringFormat format=Qgis::StringFormat::PlainText)
Adds a message to the log instance (and creates it if necessary).
HTTP network content fetcher.
void fetchContent(const QUrl &url, const QString &authcfg=QString(), const QgsHttpHeaders &headers=QgsHttpHeaders())
Fetches content from a remote URL and handles redirects.
void finished()
Emitted when content has loaded.
QNetworkReply * reply()
Returns a reference to the network reply.
Resolves relative paths into absolute paths and vice versa.
QString writePath(const QString &filename) const
Prepare a filename to save it to the project file.
QString readPath(const QString &filename) const
Turn filename read from the project file to an absolute path.
A store for object properties.
QString asExpression() const
Returns an expression string representing the state of the property, or an empty string if the proper...
static QVariantMap propertyMapToVariantMap(const QMap< QString, QgsProperty > &propertyMap)
Convert a map of QgsProperty to a map of QVariant This is useful to save a map of properties.
QVariant value(const QgsExpressionContext &context, const QVariant &defaultValue=QVariant(), bool *ok=nullptr) const
Calculates the current value of the property, including any transforms which are set for the property...
static QgsProperty fromExpression(const QString &expression, bool isActive=true)
Returns a new ExpressionBasedProperty created from the specified expression.
static QMap< QString, QgsProperty > variantMapToPropertyMap(const QVariantMap &variantMap)
Convert a map of QVariant to a map of QgsProperty This is useful to restore a map of properties.
A container for the context for various read/write operations on objects.
const QgsPathResolver & pathResolver() const
Returns path resolver for conversion between relative and absolute paths.
double scaleFactor() const
Returns the scaling factor for the render to convert painter units to physical sizes.
QPainter * painter()
Returns the destination QPainter for the render operation.
Scoped object for saving and restoring a QPainter object's state.
QByteArray svgContent(const QString &path, double size, const QColor &fill, const QColor &stroke, double strokeWidth, double widthScaleFactor, double fixedAspectRatio=0, bool blocking=false, const QMap< QString, QString > ¶meters=QMap< QString, QString >(), bool *isMissingImage=nullptr)
Gets the SVG content corresponding to the given path.
static QgsStringMap evaluatePropertiesMap(const QMap< QString, QgsProperty > &propertiesMap, const QgsExpressionContext &context)
Evaluates a map of properties using the given context and returns a variant map with evaluated expres...
static QString svgSymbolPathToName(const QString &path, const QgsPathResolver &pathResolver)
Determines an SVG symbol's name from its path.
static QString svgSymbolNameToPath(const QString &name, const QgsPathResolver &pathResolver)
Determines an SVG symbol's path from its name.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference).
QMap< QString, QString > QgsStringMap
#define QgsDebugMsgLevel(str, level)