QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Static Public Member Functions | List of all members
QgsSymbolLayerV2Utils Class Reference

#include <qgssymbollayerv2utils.h>

Static Public Member Functions

static void applyScaleDependency (QDomDocument &doc, QDomElement &ruleElem, const QgsStringMap &props)
 Checks if the properties contain scaleMinDenom and scaleMaxDenom, if available, they are added into the SE Rule element. More...
 
static void blurImageInPlace (QImage &image, QRect rect, int radius, bool alphaOnly)
 Blurs an image in place, e.g. More...
 
static void clearSymbolMap (QgsSymbolV2Map &symbols)
 
static QColor colorFromMimeData (const QMimeData *data, bool &hasAlpha)
 Attempts to parse mime data as a color. More...
 
static QgsNamedColorList colorListFromMimeData (const QMimeData *data)
 Attempts to parse mime data as a list of named colors. More...
 
static QMimeDatacolorListToMimeData (const QgsNamedColorList &colorList, const bool allFormats=true)
 Creates mime data from a list of named colors. More...
 
static QIcon colorRampPreviewIcon (QgsVectorColorRampV2 *ramp, QSize size)
 
static QPixmap colorRampPreviewPixmap (QgsVectorColorRampV2 *ramp, QSize size)
 
static QMimeDatacolorToMimeData (const QColor &color)
 Creates mime data from a color. More...
 
static QString colorToName (const QColor &color)
 Returns a friendly display name for a color. More...
 
static bool convertPolygonSymbolizerToPointMarker (QDomElement &element, QgsSymbolLayerV2List &layerList)
 
static double convertToMapUnits (const QgsRenderContext &c, double size, QgsSymbolV2::OutputUnit unit, const QgsMapUnitScale &scale=QgsMapUnitScale())
 Converts a size from the specied units to map units. More...
 
static double convertToPainterUnits (const QgsRenderContext &c, double size, QgsSymbolV2::OutputUnit unit, const QgsMapUnitScale &scale=QgsMapUnitScale())
 Converts a size from the specied units to painter units. More...
 
static void createDisplacementElement (QDomDocument &doc, QDomElement &element, QPointF offset)
 
static bool createExpressionElement (QDomDocument &doc, QDomElement &element, const QString &function)
 Creates a OGC Expression element based on the provided function expression. More...
 
static QgsSymbolLayerV2createFillLayerFromSld (QDomElement &element)
 
static bool createFunctionElement (QDomDocument &doc, QDomElement &element, const QString &function)
 
static void createGeometryElement (QDomDocument &doc, QDomElement &element, const QString &geomFunc)
 
static QgsSymbolLayerV2createLineLayerFromSld (QDomElement &element)
 
static QgsSymbolLayerV2createMarkerLayerFromSld (QDomElement &element)
 
static void createOnlineResourceElement (QDomDocument &doc, QDomElement &element, const QString &path, const QString &format)
 
static void createOpacityElement (QDomDocument &doc, QDomElement &element, const QString &alphaFunc)
 
static QgsRenderContext createRenderContext (QPainter *p)
 Creates a render context for a pixel based device. More...
 
static void createRotationElement (QDomDocument &doc, QDomElement &element, const QString &rotationFunc)
 
static QDomElement createSvgParameterElement (QDomDocument &doc, const QString &name, const QString &value)
 
static bool createSymbolLayerV2ListFromSld (QDomElement &element, QGis::GeometryType geomType, QgsSymbolLayerV2List &layers)
 
static QDomElement createVendorOptionElement (QDomDocument &doc, const QString &name, const QString &value)
 
static QPainter::CompositionMode decodeBlendMode (const QString &s)
 
static Qt::BrushStyle decodeBrushStyle (const QString &str)
 
static QColor decodeColor (const QString &str)
 
static QgsMapUnitScale decodeMapUnitScale (const QString &str)
 
static QgsSymbolV2::OutputUnit decodeOutputUnit (const QString &str)
 
static Qt::PenCapStyle decodePenCapStyle (const QString &str)
 
static Qt::PenJoinStyle decodePenJoinStyle (const QString &str)
 
static Qt::PenStyle decodePenStyle (const QString &str)
 
static QPointF decodePoint (const QString &str)
 
static QVector< qreal > decodeRealVector (const QString &s)
 
static QgsSymbolV2::ScaleMethod decodeScaleMethod (const QString &str)
 
static int decodeSldAlpha (const QString &str)
 
static Qt::BrushStyle decodeSldBrushStyle (const QString &str)
 
static QFont::Style decodeSldFontStyle (const QString &str)
 
static int decodeSldFontWeight (const QString &str)
 
static Qt::PenCapStyle decodeSldLineCapStyle (const QString &str)
 
static Qt::PenJoinStyle decodeSldLineJoinStyle (const QString &str)
 
static QVector< qreal > decodeSldRealVector (const QString &s)
 
static QgsSymbolV2::OutputUnit decodeSldUom (const QString &str, double *scaleFactor)
 
static bool displacementFromSldElement (QDomElement &element, QPointF &offset)
 
static void drawStippledBackground (QPainter *painter, QRect rect)
 
static QString encodeBrushStyle (Qt::BrushStyle style)
 
static QString encodeColor (const QColor &color)
 
static QString encodeMapUnitScale (const QgsMapUnitScale &mapUnitScale)
 
static QString encodeOutputUnit (QgsSymbolV2::OutputUnit unit)
 
static QString encodePenCapStyle (Qt::PenCapStyle style)
 
static QString encodePenJoinStyle (Qt::PenJoinStyle style)
 
static QString encodePenStyle (Qt::PenStyle style)
 
static QString encodePoint (QPointF point)
 
static QString encodeRealVector (const QVector< qreal > &v)
 
static QString encodeScaleMethod (QgsSymbolV2::ScaleMethod scaleMethod)
 
static QString encodeSldAlpha (int alpha)
 
static QString encodeSldBrushStyle (Qt::BrushStyle style)
 
static QString encodeSldFontStyle (QFont::Style style)
 
static QString encodeSldFontWeight (int weight)
 
static QString encodeSldLineCapStyle (Qt::PenCapStyle style)
 
static QString encodeSldLineJoinStyle (Qt::PenJoinStyle style)
 
static QString encodeSldRealVector (const QVector< qreal > &v)
 
static QString encodeSldUom (QgsSymbolV2::OutputUnit unit, double *scaleFactor)
 
static double estimateMaxSymbolBleed (QgsSymbolV2 *symbol)
 Returns the maximum estimated bleed for the symbol. More...
 
static bool externalGraphicFromSld (QDomElement &element, QString &path, QString &mime, QColor &color, double &size)
 
static void externalGraphicToSld (QDomDocument &doc, QDomElement &element, const QString &path, const QString &mime, const QColor &color, double size=-1)
 
static bool externalMarkerFromSld (QDomElement &element, QString &path, QString &format, int &markIndex, QColor &color, double &size)
 
static void externalMarkerToSld (QDomDocument &doc, QDomElement &element, const QString &path, const QString &format, int *markIndex=nullptr, const QColor &color=QColor(), double size=-1)
 
static QString fieldOrExpressionFromExpression (QgsExpression *expression)
 Return a field name if the whole expression is just a name of the field . More...
 
static QgsExpressionfieldOrExpressionToExpression (const QString &fieldOrExpression)
 Return a new valid expression instance for given field or expression string. More...
 
static bool fillFromSld (QDomElement &element, Qt::BrushStyle &brushStyle, QColor &color)
 
static void fillToSld (QDomDocument &doc, QDomElement &element, Qt::BrushStyle brushStyle, const QColor &color=QColor())
 
static bool functionFromSldElement (QDomElement &element, QString &function)
 
static bool geometryFromSldElement (QDomElement &element, QString &geomFunc)
 
static QgsStringMap getSvgParameterList (QDomElement &element)
 
static QgsStringMap getVendorOptionList (QDomElement &element)
 
static bool hasExternalGraphic (QDomElement &element)
 
static bool hasWellKnownMark (QDomElement &element)
 
static QgsNamedColorList importColorsFromGpl (QFile &file, bool &ok, QString &name)
 Imports colors from a gpl GIMP palette file. More...
 
static void labelTextToSld (QDomDocument &doc, QDomElement &element, const QString &label, const QFont &font, const QColor &color=QColor(), double size=-1)
 
static bool lineFromSld (QDomElement &element, Qt::PenStyle &penStyle, QColor &color, double &width, Qt::PenJoinStyle *penJoinStyle=nullptr, Qt::PenCapStyle *penCapStyle=nullptr, QVector< qreal > *customDashPattern=nullptr, double *dashOffset=nullptr)
 
static void lineToSld (QDomDocument &doc, QDomElement &element, Qt::PenStyle penStyle, const QColor &color, double width=-1, const Qt::PenJoinStyle *penJoinStyle=nullptr, const Qt::PenCapStyle *penCapStyle=nullptr, const QVector< qreal > *customDashPattern=nullptr, double dashOffset=0.0)
 
static double lineWidthScaleFactor (const QgsRenderContext &c, QgsSymbolV2::OutputUnit u, const QgsMapUnitScale &scale=QgsMapUnitScale())
 Returns the line width scale factor depending on the unit and the paint device. More...
 
static QStringList listSvgFiles ()
 Return a list of all available svg files. More...
 
static QStringList listSvgFilesAt (const QString &directory)
 Return a list of svg files at the specified directory. More...
 
static QgsVectorColorRampV2loadColorRamp (QDomElement &element)
 
static QgsSymbolV2loadSymbol (const QDomElement &element)
 Attempts to load a symbol from a DOM element. More...
 
template<class SymbolType >
static SymbolType * loadSymbol (const QDomElement &element)
 Attempts to load a symbol from a DOM element and cast it to a particular symbol type. More...
 
static QgsSymbolLayerV2loadSymbolLayer (QDomElement &element)
 
static QgsSymbolV2Map loadSymbols (QDomElement &element)
 
static double mapUnitScaleFactor (const QgsRenderContext &c, QgsSymbolV2::OutputUnit u, const QgsMapUnitScale &scale=QgsMapUnitScale())
 Returns scale factor painter units -> map units. More...
 
static void mergeScaleDependencies (int mScaleMinDenom, int mScaleMaxDenom, QgsStringMap &props)
 Merges the local scale limits, if any, with the ones already in the map, if any. More...
 
static void multiplyImageOpacity (QImage *image, qreal alpha)
 Multiplies opacity of image pixel values with a (global) transparency value. More...
 
static bool needEllipseMarker (QDomElement &element)
 
static bool needFontMarker (QDomElement &element)
 
static bool needLinePatternFill (QDomElement &element)
 
static bool needMarkerLine (QDomElement &element)
 
static bool needPointPatternFill (QDomElement &element)
 
static bool needSvgFill (QDomElement &element)
 
static bool needSvgMarker (QDomElement &element)
 
static QString ogrFeatureStyleBrush (const QColor &fillColr)
 Create ogr feature style string for brush. More...
 
static QString ogrFeatureStylePen (double width, double mmScaleFactor, double mapUnitsScaleFactor, const QColor &c, Qt::PenJoinStyle joinStyle=Qt::MiterJoin, Qt::PenCapStyle capStyle=Qt::FlatCap, double offset=0.0, const QVector< qreal > *dashPattern=nullptr)
 Create ogr feature style string for pen. More...
 
static bool onlineResourceFromSldElement (QDomElement &element, QString &path, QString &format)
 
static bool opacityFromSldElement (QDomElement &element, QString &alphaFunc)
 
static QColor parseColor (const QString &colorStr, bool strictEval=false)
 Attempts to parse a string as a color using a variety of common formats, including hex codes, rgb and rgba strings. More...
 
static QList< QColorparseColorList (const QString &colorStr)
 Attempts to parse a string as a list of colors using a variety of common formats, including hex codes, rgb and rgba strings. More...
 
static QColor parseColorWithAlpha (const QString &colorStr, bool &containsAlpha, bool strictEval=false)
 Attempts to parse a string as a color using a variety of common formats, including hex codes, rgb and rgba strings. More...
 
static QgsStringMap parseProperties (QDomElement &element)
 
static double pixelSizeScaleFactor (const QgsRenderContext &c, QgsSymbolV2::OutputUnit u, const QgsMapUnitScale &scale=QgsMapUnitScale())
 Returns scale factor painter units -> pixel dimensions. More...
 
static bool pointInPolygon (const QPolygonF &points, QPointF point)
 Calculate whether a point is within of a QPolygonF. More...
 
static QPointF pointOnLineWithDistance (QPointF startPoint, QPointF directionPoint, double distance)
 Returns a point on the line from startPoint to directionPoint that is a certain distance away from the starting point. More...
 
static QPointF polygonCentroid (const QPolygonF &points)
 Calculate the centroid point of a QPolygonF. More...
 
static QPointF polygonPointOnSurface (const QPolygonF &points)
 Calculate a point within of a QPolygonF. More...
 
static void premultiplyColor (QColor &rgb, int alpha)
 Converts a QColor into a premultiplied ARGB QColor value using a specified alpha value. More...
 
static QList< double > prettyBreaks (double minimum, double maximum, int classes)
 Computes a sequence of about 'classes' equally spaced round values which cover the range of values from 'minimum' to 'maximum'. More...
 
static double rescaleUom (double size, QgsSymbolV2::OutputUnit unit, const QgsStringMap &props)
 Rescales the given size based on the uomScale found in the props, if any is found, otherwise returns the value un-modified. More...
 
static QPointF rescaleUom (const QPointF &point, QgsSymbolV2::OutputUnit unit, const QgsStringMap &props)
 Rescales the given point based on the uomScale found in the props, if any is found, otherwise returns a copy of the original point. More...
 
static QVector< qreal > rescaleUom (const QVector< qreal > &array, QgsSymbolV2::OutputUnit unit, const QgsStringMap &props)
 Rescales the given array based on the uomScale found in the props, if any is found, otherwise returns a copy of the original point. More...
 
static bool rotationFromSldElement (QDomElement &element, QString &rotationFunc)
 
static QDomElement saveColorRamp (const QString &name, QgsVectorColorRampV2 *ramp, QDomDocument &doc)
 
static bool saveColorsToGpl (QFile &file, const QString &paletteName, const QgsNamedColorList &colors)
 Exports colors to a gpl GIMP palette file. More...
 
static void saveProperties (QgsStringMap props, QDomDocument &doc, QDomElement &element)
 
static QDomElement saveSymbol (const QString &symbolName, QgsSymbolV2 *symbol, QDomDocument &doc)
 
static QDomElement saveSymbols (QgsSymbolV2Map &symbols, const QString &tagName, QDomDocument &doc)
 
static double sizeInPixelsFromSldUom (const QString &uom, double size)
 Returns the size scaled in pixels according to the uom attribute. More...
 
static void sortVariantList (QList< QVariant > &list, Qt::SortOrder order)
 Sorts the passed list in requested order. More...
 
static QIcon symbolLayerPreviewIcon (QgsSymbolLayerV2 *layer, QgsSymbolV2::OutputUnit u, QSize size, const QgsMapUnitScale &scale=QgsMapUnitScale())
 
static QPicture symbolLayerPreviewPicture (QgsSymbolLayerV2 *layer, QgsSymbolV2::OutputUnit units, QSize size, const QgsMapUnitScale &scale=QgsMapUnitScale())
 Draws a symbol layer preview to a QPicture. More...
 
static QString symbolNameToPath (QString name)
 Get symbol's path from its name. More...
 
static QString symbolPathToName (QString path)
 Get symbols's name from its path. More...
 
static QIcon symbolPreviewIcon (QgsSymbolV2 *symbol, QSize size)
 
static QPixmap symbolPreviewPixmap (QgsSymbolV2 *symbol, QSize size, QgsRenderContext *customContext=nullptr)
 
static QString symbolProperties (QgsSymbolV2 *symbol)
 Returns a string representing the symbol. More...
 
static Q_DECL_DEPRECATED bool wellKnownMarkerFromSld (QDomElement &element, QString &name, QColor &color, QColor &borderColor, double &borderWidth, double &size)
 
static bool wellKnownMarkerFromSld (QDomElement &element, QString &name, QColor &color, QColor &borderColor, Qt::PenStyle &borderStyle, double &borderWidth, double &size)
 
static Q_DECL_DEPRECATED void wellKnownMarkerToSld (QDomDocument &doc, QDomElement &element, const QString &name, const QColor &color, const QColor &borderColor=QColor(), double borderWidth=-1, double size=-1)
 
static void wellKnownMarkerToSld (QDomDocument &doc, QDomElement &element, const QString &name, const QColor &color, const QColor &borderColor, Qt::PenStyle borderStyle, double borderWidth=-1, double size=-1)
 

Detailed Description

Definition at line 48 of file qgssymbollayerv2utils.h.

Member Function Documentation

◆ applyScaleDependency()

void QgsSymbolLayerV2Utils::applyScaleDependency ( QDomDocument doc,
QDomElement ruleElem,
const QgsStringMap props 
)
static

Checks if the properties contain scaleMinDenom and scaleMaxDenom, if available, they are added into the SE Rule element.

Note
added in 2.14

Definition at line 4194 of file qgssymbollayerv2utils.cpp.

◆ blurImageInPlace()

void QgsSymbolLayerV2Utils::blurImageInPlace ( QImage image,
QRect  rect,
int  radius,
bool  alphaOnly 
)
static

Blurs an image in place, e.g.

creating Qt-independent drop shadows

Definition at line 3582 of file qgssymbollayerv2utils.cpp.

◆ clearSymbolMap()

void QgsSymbolLayerV2Utils::clearSymbolMap ( QgsSymbolV2Map symbols)
static

Definition at line 2849 of file qgssymbollayerv2utils.cpp.

◆ colorFromMimeData()

QColor QgsSymbolLayerV2Utils::colorFromMimeData ( const QMimeData data,
bool &  hasAlpha 
)
static

Attempts to parse mime data as a color.

Parameters
datamime data to parse
hasAlphawill be set to true if mime data was interpreted as a color containing an explicit alpha value
Returns
valid color if mimedata could be interpreted as a color, otherwise an invalid color
Note
added in 2.5

Definition at line 2978 of file qgssymbollayerv2utils.cpp.

◆ colorListFromMimeData()

QgsNamedColorList QgsSymbolLayerV2Utils::colorListFromMimeData ( const QMimeData data)
static

Attempts to parse mime data as a list of named colors.

Parameters
datamime data to parse
Returns
list of parsed colors
Note
added in 2.5

Definition at line 3000 of file qgssymbollayerv2utils.cpp.

◆ colorListToMimeData()

QMimeData * QgsSymbolLayerV2Utils::colorListToMimeData ( const QgsNamedColorList colorList,
const bool  allFormats = true 
)
static

Creates mime data from a list of named colors.

Parameters
colorListlist of named colors
allFormatsset to true to include additional mime formats, include text/plain and application/x-color
Returns
mime data containing encoded colors
Note
added in 2.5

Definition at line 3113 of file qgssymbollayerv2utils.cpp.

◆ colorRampPreviewIcon()

QIcon QgsSymbolLayerV2Utils::colorRampPreviewIcon ( QgsVectorColorRampV2 ramp,
QSize  size 
)
static

Definition at line 656 of file qgssymbollayerv2utils.cpp.

◆ colorRampPreviewPixmap()

QPixmap QgsSymbolLayerV2Utils::colorRampPreviewPixmap ( QgsVectorColorRampV2 ramp,
QSize  size 
)
static

Definition at line 661 of file qgssymbollayerv2utils.cpp.

◆ colorToMimeData()

QMimeData * QgsSymbolLayerV2Utils::colorToMimeData ( const QColor color)
static

Creates mime data from a color.

Sets both the mime data's color data, and the mime data's text with the color's hex code.

Parameters
colorcolor to encode as mime data
See also
colorFromMimeData
Note
added in 2.5

Definition at line 2968 of file qgssymbollayerv2utils.cpp.

◆ colorToName()

QString QgsSymbolLayerV2Utils::colorToName ( const QColor color)
static

Returns a friendly display name for a color.

Parameters
colorsource color
Returns
display name for color
Note
added in 2.5

Definition at line 2889 of file qgssymbollayerv2utils.cpp.

◆ convertPolygonSymbolizerToPointMarker()

bool QgsSymbolLayerV2Utils::convertPolygonSymbolizerToPointMarker ( QDomElement element,
QgsSymbolLayerV2List layerList 
)
static

Definition at line 1520 of file qgssymbollayerv2utils.cpp.

◆ convertToMapUnits()

double QgsSymbolLayerV2Utils::convertToMapUnits ( const QgsRenderContext c,
double  size,
QgsSymbolV2::OutputUnit  unit,
const QgsMapUnitScale scale = QgsMapUnitScale() 
)
static

Converts a size from the specied units to map units.

The conversion respects the limits specified by the optional scale parameter.

Parameters
crender context
sizesize to convert
unitunits for specified size
scalemap unit scale
Note
added in QGIS 2.16
See also
convertToPainterUnits()

Definition at line 3438 of file qgssymbollayerv2utils.cpp.

◆ convertToPainterUnits()

double QgsSymbolLayerV2Utils::convertToPainterUnits ( const QgsRenderContext c,
double  size,
QgsSymbolV2::OutputUnit  unit,
const QgsMapUnitScale scale = QgsMapUnitScale() 
)
static

Converts a size from the specied units to painter units.

The conversion respects the limits specified by the optional scale parameter.

Parameters
crender context
sizesize to convert
unitunits for specified size
scalemap unit scale
Note
added in QGIS 2.12
See also
lineWidthScaleFactor()
convertToMapUnits()

Definition at line 3421 of file qgssymbollayerv2utils.cpp.

◆ createDisplacementElement()

void QgsSymbolLayerV2Utils::createDisplacementElement ( QDomDocument doc,
QDomElement element,
QPointF  offset 
)
static

Definition at line 2347 of file qgssymbollayerv2utils.cpp.

◆ createExpressionElement()

bool QgsSymbolLayerV2Utils::createExpressionElement ( QDomDocument doc,
QDomElement element,
const QString function 
)
static

Creates a OGC Expression element based on the provided function expression.

Parameters
docThe document owning the element
elementThe element parent
functionThe expression to be encoded
Returns

Definition at line 2548 of file qgssymbollayerv2utils.cpp.

◆ createFillLayerFromSld()

QgsSymbolLayerV2 * QgsSymbolLayerV2Utils::createFillLayerFromSld ( QDomElement element)
static

Definition at line 1262 of file qgssymbollayerv2utils.cpp.

◆ createFunctionElement()

bool QgsSymbolLayerV2Utils::createFunctionElement ( QDomDocument doc,
QDomElement element,
const QString function 
)
static

Definition at line 2563 of file qgssymbollayerv2utils.cpp.

◆ createGeometryElement()

void QgsSymbolLayerV2Utils::createGeometryElement ( QDomDocument doc,
QDomElement element,
const QString geomFunc 
)
static

Definition at line 2505 of file qgssymbollayerv2utils.cpp.

◆ createLineLayerFromSld()

QgsSymbolLayerV2 * QgsSymbolLayerV2Utils::createLineLayerFromSld ( QDomElement element)
static

Definition at line 1285 of file qgssymbollayerv2utils.cpp.

◆ createMarkerLayerFromSld()

QgsSymbolLayerV2 * QgsSymbolLayerV2Utils::createMarkerLayerFromSld ( QDomElement element)
static

Definition at line 1304 of file qgssymbollayerv2utils.cpp.

◆ createOnlineResourceElement()

void QgsSymbolLayerV2Utils::createOnlineResourceElement ( QDomDocument doc,
QDomElement element,
const QString path,
const QString format 
)
static

Definition at line 2615 of file qgssymbollayerv2utils.cpp.

◆ createOpacityElement()

void QgsSymbolLayerV2Utils::createOpacityElement ( QDomDocument doc,
QDomElement element,
const QString alphaFunc 
)
static

Definition at line 2327 of file qgssymbollayerv2utils.cpp.

◆ createRenderContext()

QgsRenderContext QgsSymbolLayerV2Utils::createRenderContext ( QPainter p)
static

Creates a render context for a pixel based device.

Definition at line 3536 of file qgssymbollayerv2utils.cpp.

◆ createRotationElement()

void QgsSymbolLayerV2Utils::createRotationElement ( QDomDocument doc,
QDomElement element,
const QString rotationFunc 
)
static

Definition at line 2306 of file qgssymbollayerv2utils.cpp.

◆ createSvgParameterElement()

QDomElement QgsSymbolLayerV2Utils::createSvgParameterElement ( QDomDocument doc,
const QString name,
const QString value 
)
static

Definition at line 2649 of file qgssymbollayerv2utils.cpp.

◆ createSymbolLayerV2ListFromSld()

bool QgsSymbolLayerV2Utils::createSymbolLayerV2ListFromSld ( QDomElement element,
QGis::GeometryType  geomType,
QgsSymbolLayerV2List layers 
)
static

Definition at line 1112 of file qgssymbollayerv2utils.cpp.

◆ createVendorOptionElement()

QDomElement QgsSymbolLayerV2Utils::createVendorOptionElement ( QDomDocument doc,
const QString name,
const QString value 
)
static

Definition at line 2696 of file qgssymbollayerv2utils.cpp.

◆ decodeBlendMode()

QPainter::CompositionMode QgsSymbolLayerV2Utils::decodeBlendMode ( const QString s)
static

Definition at line 577 of file qgssymbollayerv2utils.cpp.

◆ decodeBrushStyle()

Qt::BrushStyle QgsSymbolLayerV2Utils::decodeBrushStyle ( const QString str)
static

Definition at line 295 of file qgssymbollayerv2utils.cpp.

◆ decodeColor()

QColor QgsSymbolLayerV2Utils::decodeColor ( const QString str)
static

Definition at line 48 of file qgssymbollayerv2utils.cpp.

◆ decodeMapUnitScale()

QgsMapUnitScale QgsSymbolLayerV2Utils::decodeMapUnitScale ( const QString str)
static

Definition at line 390 of file qgssymbollayerv2utils.cpp.

◆ decodeOutputUnit()

QgsSymbolV2::OutputUnit QgsSymbolLayerV2Utils::decodeOutputUnit ( const QString str)
static

Definition at line 427 of file qgssymbollayerv2utils.cpp.

◆ decodePenCapStyle()

Qt::PenCapStyle QgsSymbolLayerV2Utils::decodePenCapStyle ( const QString str)
static

Definition at line 225 of file qgssymbollayerv2utils.cpp.

◆ decodePenJoinStyle()

Qt::PenJoinStyle QgsSymbolLayerV2Utils::decodePenJoinStyle ( const QString str)
static

Definition at line 179 of file qgssymbollayerv2utils.cpp.

◆ decodePenStyle()

Qt::PenStyle QgsSymbolLayerV2Utils::decodePenStyle ( const QString str)
static

Definition at line 153 of file qgssymbollayerv2utils.cpp.

◆ decodePoint()

QPointF QgsSymbolLayerV2Utils::decodePoint ( const QString str)
static

Definition at line 372 of file qgssymbollayerv2utils.cpp.

◆ decodeRealVector()

QVector< qreal > QgsSymbolLayerV2Utils::decodeRealVector ( const QString s)
static

Definition at line 502 of file qgssymbollayerv2utils.cpp.

◆ decodeScaleMethod()

QgsSymbolV2::ScaleMethod QgsSymbolLayerV2Utils::decodeScaleMethod ( const QString str)
static

Definition at line 561 of file qgssymbollayerv2utils.cpp.

◆ decodeSldAlpha()

int QgsSymbolLayerV2Utils::decodeSldAlpha ( const QString str)
static

Definition at line 72 of file qgssymbollayerv2utils.cpp.

◆ decodeSldBrushStyle()

Qt::BrushStyle QgsSymbolLayerV2Utils::decodeSldBrushStyle ( const QString str)
static

Definition at line 352 of file qgssymbollayerv2utils.cpp.

◆ decodeSldFontStyle()

QFont::Style QgsSymbolLayerV2Utils::decodeSldFontStyle ( const QString str)
static

Definition at line 98 of file qgssymbollayerv2utils.cpp.

◆ decodeSldFontWeight()

int QgsSymbolLayerV2Utils::decodeSldFontWeight ( const QString str)
static

Definition at line 118 of file qgssymbollayerv2utils.cpp.

◆ decodeSldLineCapStyle()

Qt::PenCapStyle QgsSymbolLayerV2Utils::decodeSldLineCapStyle ( const QString str)
static

Definition at line 248 of file qgssymbollayerv2utils.cpp.

◆ decodeSldLineJoinStyle()

Qt::PenJoinStyle QgsSymbolLayerV2Utils::decodeSldLineJoinStyle ( const QString str)
static

Definition at line 202 of file qgssymbollayerv2utils.cpp.

◆ decodeSldRealVector()

QVector< qreal > QgsSymbolLayerV2Utils::decodeSldRealVector ( const QString s)
static

Definition at line 531 of file qgssymbollayerv2utils.cpp.

◆ decodeSldUom()

QgsSymbolV2::OutputUnit QgsSymbolLayerV2Utils::decodeSldUom ( const QString str,
double *  scaleFactor 
)
static

Definition at line 465 of file qgssymbollayerv2utils.cpp.

◆ displacementFromSldElement()

bool QgsSymbolLayerV2Utils::displacementFromSldElement ( QDomElement element,
QPointF offset 
)
static

Definition at line 2365 of file qgssymbollayerv2utils.cpp.

◆ drawStippledBackground()

void QgsSymbolLayerV2Utils::drawStippledBackground ( QPainter painter,
QRect  rect 
)
static

Definition at line 684 of file qgssymbollayerv2utils.cpp.

◆ encodeBrushStyle()

QString QgsSymbolLayerV2Utils::encodeBrushStyle ( Qt::BrushStyle  style)
static

Definition at line 256 of file qgssymbollayerv2utils.cpp.

◆ encodeColor()

QString QgsSymbolLayerV2Utils::encodeColor ( const QColor color)
static

Definition at line 43 of file qgssymbollayerv2utils.cpp.

◆ encodeMapUnitScale()

QString QgsSymbolLayerV2Utils::encodeMapUnitScale ( const QgsMapUnitScale mapUnitScale)
static

Definition at line 380 of file qgssymbollayerv2utils.cpp.

◆ encodeOutputUnit()

QString QgsSymbolLayerV2Utils::encodeOutputUnit ( QgsSymbolV2::OutputUnit  unit)
static

Definition at line 410 of file qgssymbollayerv2utils.cpp.

◆ encodePenCapStyle()

QString QgsSymbolLayerV2Utils::encodePenCapStyle ( Qt::PenCapStyle  style)
static

Definition at line 210 of file qgssymbollayerv2utils.cpp.

◆ encodePenJoinStyle()

QString QgsSymbolLayerV2Utils::encodePenJoinStyle ( Qt::PenJoinStyle  style)
static

Definition at line 164 of file qgssymbollayerv2utils.cpp.

◆ encodePenStyle()

QString QgsSymbolLayerV2Utils::encodePenStyle ( Qt::PenStyle  style)
static

Definition at line 132 of file qgssymbollayerv2utils.cpp.

◆ encodePoint()

QString QgsSymbolLayerV2Utils::encodePoint ( QPointF  point)
static

Definition at line 367 of file qgssymbollayerv2utils.cpp.

◆ encodeRealVector()

QString QgsSymbolLayerV2Utils::encodeRealVector ( const QVector< qreal > &  v)
static

Definition at line 487 of file qgssymbollayerv2utils.cpp.

◆ encodeScaleMethod()

QString QgsSymbolLayerV2Utils::encodeScaleMethod ( QgsSymbolV2::ScaleMethod  scaleMethod)
static

Definition at line 545 of file qgssymbollayerv2utils.cpp.

◆ encodeSldAlpha()

QString QgsSymbolLayerV2Utils::encodeSldAlpha ( int  alpha)
static

Definition at line 67 of file qgssymbollayerv2utils.cpp.

◆ encodeSldBrushStyle()

QString QgsSymbolLayerV2Utils::encodeSldBrushStyle ( Qt::BrushStyle  style)
static

Definition at line 315 of file qgssymbollayerv2utils.cpp.

◆ encodeSldFontStyle()

QString QgsSymbolLayerV2Utils::encodeSldFontStyle ( QFont::Style  style)
static

Definition at line 83 of file qgssymbollayerv2utils.cpp.

◆ encodeSldFontWeight()

QString QgsSymbolLayerV2Utils::encodeSldFontWeight ( int  weight)
static

Definition at line 106 of file qgssymbollayerv2utils.cpp.

◆ encodeSldLineCapStyle()

QString QgsSymbolLayerV2Utils::encodeSldLineCapStyle ( Qt::PenCapStyle  style)
static

Definition at line 233 of file qgssymbollayerv2utils.cpp.

◆ encodeSldLineJoinStyle()

QString QgsSymbolLayerV2Utils::encodeSldLineJoinStyle ( Qt::PenJoinStyle  style)
static

Definition at line 187 of file qgssymbollayerv2utils.cpp.

◆ encodeSldRealVector()

QString QgsSymbolLayerV2Utils::encodeSldRealVector ( const QVector< qreal > &  v)
static

Definition at line 516 of file qgssymbollayerv2utils.cpp.

◆ encodeSldUom()

QString QgsSymbolLayerV2Utils::encodeSldUom ( QgsSymbolV2::OutputUnit  unit,
double *  scaleFactor 
)
static

Definition at line 444 of file qgssymbollayerv2utils.cpp.

◆ estimateMaxSymbolBleed()

double QgsSymbolLayerV2Utils::estimateMaxSymbolBleed ( QgsSymbolV2 symbol)
static

Returns the maximum estimated bleed for the symbol.

Definition at line 615 of file qgssymbollayerv2utils.cpp.

◆ externalGraphicFromSld()

bool QgsSymbolLayerV2Utils::externalGraphicFromSld ( QDomElement element,
QString path,
QString mime,
QColor color,
double &  size 
)
static

Definition at line 2109 of file qgssymbollayerv2utils.cpp.

◆ externalGraphicToSld()

void QgsSymbolLayerV2Utils::externalGraphicToSld ( QDomDocument doc,
QDomElement element,
const QString path,
const QString mime,
const QColor color,
double  size = -1 
)
static

Definition at line 2089 of file qgssymbollayerv2utils.cpp.

◆ externalMarkerFromSld()

bool QgsSymbolLayerV2Utils::externalMarkerFromSld ( QDomElement element,
QString path,
QString format,
int &  markIndex,
QColor color,
double &  size 
)
static

Definition at line 2164 of file qgssymbollayerv2utils.cpp.

◆ externalMarkerToSld()

void QgsSymbolLayerV2Utils::externalMarkerToSld ( QDomDocument doc,
QDomElement element,
const QString path,
const QString format,
int *  markIndex = nullptr,
const QColor color = QColor(),
double  size = -1 
)
static

Definition at line 2134 of file qgssymbollayerv2utils.cpp.

◆ fieldOrExpressionFromExpression()

QString QgsSymbolLayerV2Utils::fieldOrExpressionFromExpression ( QgsExpression expression)
static

Return a field name if the whole expression is just a name of the field .

Returns full expression string if the expression is more complex than just one field. Using just expression->expression() method may return quoted field name, but that is not wanted for saving (due to backward compatibility) or display in GUI.

Note
added in 2.2

Definition at line 3962 of file qgssymbollayerv2utils.cpp.

◆ fieldOrExpressionToExpression()

QgsExpression * QgsSymbolLayerV2Utils::fieldOrExpressionToExpression ( const QString fieldOrExpression)
static

Return a new valid expression instance for given field or expression string.

If the input is not a valid expression, it is assumed that it is a field name and gets properly quoted. If the string is empty, returns null pointer. This is useful when accepting input which could be either a non-quoted field name or expression.

Note
added in 2.2

Definition at line 3946 of file qgssymbollayerv2utils.cpp.

◆ fillFromSld()

bool QgsSymbolLayerV2Utils::fillFromSld ( QDomElement element,
Qt::BrushStyle &  brushStyle,
QColor color 
)
static

Definition at line 1827 of file qgssymbollayerv2utils.cpp.

◆ fillToSld()

void QgsSymbolLayerV2Utils::fillToSld ( QDomDocument doc,
QDomElement element,
Qt::BrushStyle  brushStyle,
const QColor color = QColor() 
)
static

Definition at line 1776 of file qgssymbollayerv2utils.cpp.

◆ functionFromSldElement()

bool QgsSymbolLayerV2Utils::functionFromSldElement ( QDomElement element,
QString function 
)
static

Definition at line 2578 of file qgssymbollayerv2utils.cpp.

◆ geometryFromSldElement()

bool QgsSymbolLayerV2Utils::geometryFromSldElement ( QDomElement element,
QString geomFunc 
)
static

Definition at line 2539 of file qgssymbollayerv2utils.cpp.

◆ getSvgParameterList()

QgsStringMap QgsSymbolLayerV2Utils::getSvgParameterList ( QDomElement element)
static

Definition at line 2657 of file qgssymbollayerv2utils.cpp.

◆ getVendorOptionList()

QgsStringMap QgsSymbolLayerV2Utils::getVendorOptionList ( QDomElement element)
static

Definition at line 2704 of file qgssymbollayerv2utils.cpp.

◆ hasExternalGraphic()

bool QgsSymbolLayerV2Utils::hasExternalGraphic ( QDomElement element)
static

Definition at line 1327 of file qgssymbollayerv2utils.cpp.

◆ hasWellKnownMark()

bool QgsSymbolLayerV2Utils::hasWellKnownMark ( QDomElement element)
static

Definition at line 1368 of file qgssymbollayerv2utils.cpp.

◆ importColorsFromGpl()

QgsNamedColorList QgsSymbolLayerV2Utils::importColorsFromGpl ( QFile file,
bool &  ok,
QString name 
)
static

Imports colors from a gpl GIMP palette file.

Parameters
filesource gpl file
okwill be true if file was successfully read
namewill be set to palette name from gpl file, if present
Returns
list of imported colors
See also
saveColorsToGpl

Definition at line 3189 of file qgssymbollayerv2utils.cpp.

◆ labelTextToSld()

void QgsSymbolLayerV2Utils::labelTextToSld ( QDomDocument doc,
QDomElement element,
const QString label,
const QFont font,
const QColor color = QColor(),
double  size = -1 
)
static

Definition at line 2394 of file qgssymbollayerv2utils.cpp.

◆ lineFromSld()

bool QgsSymbolLayerV2Utils::lineFromSld ( QDomElement element,
Qt::PenStyle &  penStyle,
QColor color,
double &  width,
Qt::PenJoinStyle *  penJoinStyle = nullptr,
Qt::PenCapStyle *  penCapStyle = nullptr,
QVector< qreal > *  customDashPattern = nullptr,
double *  dashOffset = nullptr 
)
static

Definition at line 1958 of file qgssymbollayerv2utils.cpp.

◆ lineToSld()

void QgsSymbolLayerV2Utils::lineToSld ( QDomDocument doc,
QDomElement element,
Qt::PenStyle  penStyle,
const QColor color,
double  width = -1,
const Qt::PenJoinStyle *  penJoinStyle = nullptr,
const Qt::PenCapStyle *  penCapStyle = nullptr,
const QVector< qreal > *  customDashPattern = nullptr,
double  dashOffset = 0.0 
)
static
Note
not available in python bindings

Definition at line 1881 of file qgssymbollayerv2utils.cpp.

◆ lineWidthScaleFactor()

double QgsSymbolLayerV2Utils::lineWidthScaleFactor ( const QgsRenderContext c,
QgsSymbolV2::OutputUnit  u,
const QgsMapUnitScale scale = QgsMapUnitScale() 
)
static

Returns the line width scale factor depending on the unit and the paint device.

Consider using convertToPainterUnits() instead, as convertToPainterUnits() respects the size limits specified by the scale parameter.

Parameters
crender context
uunits to convert from
scalemap unit scale, specifying limits for the map units to convert from
See also
convertToPainterUnits()

Definition at line 3393 of file qgssymbollayerv2utils.cpp.

◆ listSvgFiles()

QStringList QgsSymbolLayerV2Utils::listSvgFiles ( )
static

Return a list of all available svg files.

Definition at line 3703 of file qgssymbollayerv2utils.cpp.

◆ listSvgFilesAt()

QStringList QgsSymbolLayerV2Utils::listSvgFilesAt ( const QString directory)
static

Return a list of svg files at the specified directory.

Definition at line 3727 of file qgssymbollayerv2utils.cpp.

◆ loadColorRamp()

QgsVectorColorRampV2 * QgsSymbolLayerV2Utils::loadColorRamp ( QDomElement element)
static

Definition at line 2856 of file qgssymbollayerv2utils.cpp.

◆ loadSymbol() [1/2]

QgsSymbolV2 * QgsSymbolLayerV2Utils::loadSymbol ( const QDomElement element)
static

Attempts to load a symbol from a DOM element.

Parameters
elementDOM element representing symbol
Returns
decoded symbol, if possible

Definition at line 946 of file qgssymbollayerv2utils.cpp.

◆ loadSymbol() [2/2]

template<class SymbolType >
static SymbolType* QgsSymbolLayerV2Utils::loadSymbol ( const QDomElement element)
inlinestatic

Attempts to load a symbol from a DOM element and cast it to a particular symbol type.

Parameters
elementDOM element representing symbol
Returns
decoded symbol cast to specified type, if possible
Note
not available in python bindings

Definition at line 151 of file qgssymbollayerv2utils.h.

◆ loadSymbolLayer()

QgsSymbolLayerV2 * QgsSymbolLayerV2Utils::loadSymbolLayer ( QDomElement element)
static

Definition at line 1022 of file qgssymbollayerv2utils.cpp.

◆ loadSymbols()

QgsSymbolV2Map QgsSymbolLayerV2Utils::loadSymbols ( QDomElement element)
static

Definition at line 2757 of file qgssymbollayerv2utils.cpp.

◆ mapUnitScaleFactor()

double QgsSymbolLayerV2Utils::mapUnitScaleFactor ( const QgsRenderContext c,
QgsSymbolV2::OutputUnit  u,
const QgsMapUnitScale scale = QgsMapUnitScale() 
)
static

Returns scale factor painter units -> map units.

Definition at line 3516 of file qgssymbollayerv2utils.cpp.

◆ mergeScaleDependencies()

void QgsSymbolLayerV2Utils::mergeScaleDependencies ( int  mScaleMinDenom,
int  mScaleMaxDenom,
QgsStringMap props 
)
static

Merges the local scale limits, if any, with the ones already in the map, if any.

Note
added in 2.14

Definition at line 4211 of file qgssymbollayerv2utils.cpp.

◆ multiplyImageOpacity()

void QgsSymbolLayerV2Utils::multiplyImageOpacity ( QImage image,
qreal  alpha 
)
static

Multiplies opacity of image pixel values with a (global) transparency value.

Definition at line 3552 of file qgssymbollayerv2utils.cpp.

◆ needEllipseMarker()

bool QgsSymbolLayerV2Utils::needEllipseMarker ( QDomElement element)
static

Definition at line 1431 of file qgssymbollayerv2utils.cpp.

◆ needFontMarker()

bool QgsSymbolLayerV2Utils::needFontMarker ( QDomElement element)
static

Definition at line 1386 of file qgssymbollayerv2utils.cpp.

◆ needLinePatternFill()

bool QgsSymbolLayerV2Utils::needLinePatternFill ( QDomElement element)
static

Definition at line 1462 of file qgssymbollayerv2utils.cpp.

◆ needMarkerLine()

bool QgsSymbolLayerV2Utils::needMarkerLine ( QDomElement element)
static

Definition at line 1449 of file qgssymbollayerv2utils.cpp.

◆ needPointPatternFill()

bool QgsSymbolLayerV2Utils::needPointPatternFill ( QDomElement element)
static

Definition at line 1500 of file qgssymbollayerv2utils.cpp.

◆ needSvgFill()

bool QgsSymbolLayerV2Utils::needSvgFill ( QDomElement element)
static

Definition at line 1506 of file qgssymbollayerv2utils.cpp.

◆ needSvgMarker()

bool QgsSymbolLayerV2Utils::needSvgMarker ( QDomElement element)
static

Definition at line 1426 of file qgssymbollayerv2utils.cpp.

◆ ogrFeatureStyleBrush()

QString QgsSymbolLayerV2Utils::ogrFeatureStyleBrush ( const QColor fillColr)
static

Create ogr feature style string for brush.

Parameters
fillColrfill color

Definition at line 2495 of file qgssymbollayerv2utils.cpp.

◆ ogrFeatureStylePen()

QString QgsSymbolLayerV2Utils::ogrFeatureStylePen ( double  width,
double  mmScaleFactor,
double  mapUnitsScaleFactor,
const QColor c,
Qt::PenJoinStyle  joinStyle = Qt::MiterJoin,
Qt::PenCapStyle  capStyle = Qt::FlatCap,
double  offset = 0.0,
const QVector< qreal > *  dashPattern = nullptr 
)
static

Create ogr feature style string for pen.

Definition at line 2421 of file qgssymbollayerv2utils.cpp.

◆ onlineResourceFromSldElement()

bool QgsSymbolLayerV2Utils::onlineResourceFromSldElement ( QDomElement element,
QString path,
QString format 
)
static

Definition at line 2630 of file qgssymbollayerv2utils.cpp.

◆ opacityFromSldElement()

bool QgsSymbolLayerV2Utils::opacityFromSldElement ( QDomElement element,
QString alphaFunc 
)
static

Definition at line 2337 of file qgssymbollayerv2utils.cpp.

◆ parseColor()

QColor QgsSymbolLayerV2Utils::parseColor ( const QString colorStr,
bool  strictEval = false 
)
static

Attempts to parse a string as a color using a variety of common formats, including hex codes, rgb and rgba strings.

Parameters
colorStrstring representing the color
strictEvalset to true for stricter color parsing rules
Returns
parsed color
Note
added in 2.3

Definition at line 3270 of file qgssymbollayerv2utils.cpp.

◆ parseColorList()

QList< QColor > QgsSymbolLayerV2Utils::parseColorList ( const QString colorStr)
static

Attempts to parse a string as a list of colors using a variety of common formats, including hex codes, rgb and rgba strings.

Parameters
colorStrstring representing the color list
Returns
list of parsed colors
Note
added in 2.5

Definition at line 2901 of file qgssymbollayerv2utils.cpp.

◆ parseColorWithAlpha()

QColor QgsSymbolLayerV2Utils::parseColorWithAlpha ( const QString colorStr,
bool &  containsAlpha,
bool  strictEval = false 
)
static

Attempts to parse a string as a color using a variety of common formats, including hex codes, rgb and rgba strings.

Parameters
colorStrstring representing the color
containsAlphaif colorStr contains an explicit alpha value then containsAlpha will be set to true
strictEvalset to true for stricter color parsing rules
Returns
parsed color
Note
added in 2.3

Definition at line 3276 of file qgssymbollayerv2utils.cpp.

◆ parseProperties()

QgsStringMap QgsSymbolLayerV2Utils::parseProperties ( QDomElement element)
static

Definition at line 2724 of file qgssymbollayerv2utils.cpp.

◆ pixelSizeScaleFactor()

double QgsSymbolLayerV2Utils::pixelSizeScaleFactor ( const QgsRenderContext c,
QgsSymbolV2::OutputUnit  u,
const QgsMapUnitScale scale = QgsMapUnitScale() 
)
static

Returns scale factor painter units -> pixel dimensions.

Definition at line 3488 of file qgssymbollayerv2utils.cpp.

◆ pointInPolygon()

bool QgsSymbolLayerV2Utils::pointInPolygon ( const QPolygonF points,
QPointF  point 
)
static

Calculate whether a point is within of a QPolygonF.

Definition at line 3920 of file qgssymbollayerv2utils.cpp.

◆ pointOnLineWithDistance()

QPointF QgsSymbolLayerV2Utils::pointOnLineWithDistance ( QPointF  startPoint,
QPointF  directionPoint,
double  distance 
)
static

Returns a point on the line from startPoint to directionPoint that is a certain distance away from the starting point.

Definition at line 3693 of file qgssymbollayerv2utils.cpp.

◆ polygonCentroid()

QPointF QgsSymbolLayerV2Utils::polygonCentroid ( const QPolygonF points)
static

Calculate the centroid point of a QPolygonF.

Definition at line 3857 of file qgssymbollayerv2utils.cpp.

◆ polygonPointOnSurface()

QPointF QgsSymbolLayerV2Utils::polygonPointOnSurface ( const QPolygonF points)
static

Calculate a point within of a QPolygonF.

Definition at line 3889 of file qgssymbollayerv2utils.cpp.

◆ premultiplyColor()

void QgsSymbolLayerV2Utils::premultiplyColor ( QColor rgb,
int  alpha 
)
static

Converts a QColor into a premultiplied ARGB QColor value using a specified alpha value.

Note
added in 2.3

Definition at line 3658 of file qgssymbollayerv2utils.cpp.

◆ prettyBreaks()

QList< double > QgsSymbolLayerV2Utils::prettyBreaks ( double  minimum,
double  maximum,
int  classes 
)
static

Computes a sequence of about 'classes' equally spaced round values which cover the range of values from 'minimum' to 'maximum'.

The values are chosen so that they are 1, 2 or 5 times a power of 10.

Note
added in 2.10

Definition at line 3972 of file qgssymbollayerv2utils.cpp.

◆ rescaleUom() [1/3]

double QgsSymbolLayerV2Utils::rescaleUom ( double  size,
QgsSymbolV2::OutputUnit  unit,
const QgsStringMap props 
)
static

Rescales the given size based on the uomScale found in the props, if any is found, otherwise returns the value un-modified.

Note
added in 2.14

Definition at line 4117 of file qgssymbollayerv2utils.cpp.

◆ rescaleUom() [2/3]

QPointF QgsSymbolLayerV2Utils::rescaleUom ( const QPointF point,
QgsSymbolV2::OutputUnit  unit,
const QgsStringMap props 
)
static

Rescales the given point based on the uomScale found in the props, if any is found, otherwise returns a copy of the original point.

Note
added in 2.14

Definition at line 4176 of file qgssymbollayerv2utils.cpp.

◆ rescaleUom() [3/3]

QVector< qreal > QgsSymbolLayerV2Utils::rescaleUom ( const QVector< qreal > &  array,
QgsSymbolV2::OutputUnit  unit,
const QgsStringMap props 
)
static

Rescales the given array based on the uomScale found in the props, if any is found, otherwise returns a copy of the original point.

Note
added in 2.14

Definition at line 4183 of file qgssymbollayerv2utils.cpp.

◆ rotationFromSldElement()

bool QgsSymbolLayerV2Utils::rotationFromSldElement ( QDomElement element,
QString rotationFunc 
)
static

Definition at line 2316 of file qgssymbollayerv2utils.cpp.

◆ saveColorRamp()

QDomElement QgsSymbolLayerV2Utils::saveColorRamp ( const QString name,
QgsVectorColorRampV2 ramp,
QDomDocument doc 
)
static

Definition at line 2879 of file qgssymbollayerv2utils.cpp.

◆ saveColorsToGpl()

bool QgsSymbolLayerV2Utils::saveColorsToGpl ( QFile file,
const QString paletteName,
const QgsNamedColorList colors 
)
static

Exports colors to a gpl GIMP palette file.

Parameters
filedestination file
paletteNamename of palette, which is stored in gpl file
colorscolors to export
Returns
true if export was successful
See also
importColorsFromGpl

Definition at line 3154 of file qgssymbollayerv2utils.cpp.

◆ saveProperties()

void QgsSymbolLayerV2Utils::saveProperties ( QgsStringMap  props,
QDomDocument doc,
QDomElement element 
)
static

Definition at line 2746 of file qgssymbollayerv2utils.cpp.

◆ saveSymbol()

QDomElement QgsSymbolLayerV2Utils::saveSymbol ( const QString symbolName,
QgsSymbolV2 symbol,
QDomDocument doc 
)
static

Definition at line 1068 of file qgssymbollayerv2utils.cpp.

◆ saveSymbols()

QDomElement QgsSymbolLayerV2Utils::saveSymbols ( QgsSymbolV2Map symbols,
const QString tagName,
QDomDocument doc 
)
static

Definition at line 2835 of file qgssymbollayerv2utils.cpp.

◆ sizeInPixelsFromSldUom()

double QgsSymbolLayerV2Utils::sizeInPixelsFromSldUom ( const QString uom,
double  size 
)
static

Returns the size scaled in pixels according to the uom attribute.

Parameters
uomThe uom attribute from SLD 1.1 version
sizeThe original size
Returns
the size in pixels
Note
added in QGIS 2.18 and 3.0

Definition at line 4234 of file qgssymbollayerv2utils.cpp.

◆ sortVariantList()

void QgsSymbolLayerV2Utils::sortVariantList ( QList< QVariant > &  list,
Qt::SortOrder  order 
)
static

Sorts the passed list in requested order.

Definition at line 3679 of file qgssymbollayerv2utils.cpp.

◆ symbolLayerPreviewIcon()

QIcon QgsSymbolLayerV2Utils::symbolLayerPreviewIcon ( QgsSymbolLayerV2 layer,
QgsSymbolV2::OutputUnit  u,
QSize  size,
const QgsMapUnitScale scale = QgsMapUnitScale() 
)
static

Definition at line 642 of file qgssymbollayerv2utils.cpp.

◆ symbolLayerPreviewPicture()

QPicture QgsSymbolLayerV2Utils::symbolLayerPreviewPicture ( QgsSymbolLayerV2 layer,
QgsSymbolV2::OutputUnit  units,
QSize  size,
const QgsMapUnitScale scale = QgsMapUnitScale() 
)
static

Draws a symbol layer preview to a QPicture.

Parameters
layersymbol layer to draw
unitssize units
sizetarget size of preview picture
scalemap unit scale for preview
Returns
QPicture containing symbol layer preview
Note
added in QGIS 2.9

Definition at line 628 of file qgssymbollayerv2utils.cpp.

◆ symbolNameToPath()

QString QgsSymbolLayerV2Utils::symbolNameToPath ( QString  name)
static

Get symbol's path from its name.

If the name is not absolute path the file is searched in SVG paths specified in settings svg/searchPathsForSVG.

Definition at line 3752 of file qgssymbollayerv2utils.cpp.

◆ symbolPathToName()

QString QgsSymbolLayerV2Utils::symbolPathToName ( QString  path)
static

Get symbols's name from its path.

Definition at line 3826 of file qgssymbollayerv2utils.cpp.

◆ symbolPreviewIcon()

QIcon QgsSymbolLayerV2Utils::symbolPreviewIcon ( QgsSymbolV2 symbol,
QSize  size 
)
static

Definition at line 594 of file qgssymbollayerv2utils.cpp.

◆ symbolPreviewPixmap()

QPixmap QgsSymbolLayerV2Utils::symbolPreviewPixmap ( QgsSymbolV2 symbol,
QSize  size,
QgsRenderContext customContext = nullptr 
)
static
Note
customContext parameter added in 2.6

Definition at line 599 of file qgssymbollayerv2utils.cpp.

◆ symbolProperties()

QString QgsSymbolLayerV2Utils::symbolProperties ( QgsSymbolV2 symbol)
static

Returns a string representing the symbol.

Can be used to test for equality between symbols.

Note
added in QGIS 2.12

Definition at line 1102 of file qgssymbollayerv2utils.cpp.

◆ wellKnownMarkerFromSld() [1/2]

bool QgsSymbolLayerV2Utils::wellKnownMarkerFromSld ( QDomElement element,
QString name,
QColor color,
QColor borderColor,
double &  borderWidth,
double &  size 
)
static

◆ wellKnownMarkerFromSld() [2/2]

bool QgsSymbolLayerV2Utils::wellKnownMarkerFromSld ( QDomElement element,
QString name,
QColor color,
QColor borderColor,
Qt::PenStyle &  borderStyle,
double &  borderWidth,
double &  size 
)
static
Note
available in python as wellKnownMarkerFromSld2

Definition at line 2259 of file qgssymbollayerv2utils.cpp.

◆ wellKnownMarkerToSld() [1/2]

void QgsSymbolLayerV2Utils::wellKnownMarkerToSld ( QDomDocument doc,
QDomElement element,
const QString name,
const QColor color,
const QColor borderColor = QColor(),
double  borderWidth = -1,
double  size = -1 
)
static
Deprecated:
Use wellKnownMarkerToSld( QDomDocument &doc, QDomElement &element, QString name, QColor color, QColor borderColor, Qt::PenStyle borderStyle, double borderWidth, double size ) instead

Definition at line 2208 of file qgssymbollayerv2utils.cpp.

◆ wellKnownMarkerToSld() [2/2]

void QgsSymbolLayerV2Utils::wellKnownMarkerToSld ( QDomDocument doc,
QDomElement element,
const QString name,
const QColor color,
const QColor borderColor,
Qt::PenStyle  borderStyle,
double  borderWidth = -1,
double  size = -1 
)
static

Definition at line 2215 of file qgssymbollayerv2utils.cpp.


The documentation for this class was generated from the following files: