|
| ~QgsSvgCache () |
|
void | containsParams (const QString &path, bool &hasFillParam, QColor &defaultFillColor, bool &hasOutlineParam, QColor &defaultOutlineColor, bool &hasOutlineWidthParam, double &defaultOutlineWidth) const |
| Tests if an svg file contains parameters for fill, outline color, outline width. More...
|
|
void | containsParams (const QString &path, bool &hasFillParam, bool &hasDefaultFillParam, QColor &defaultFillColor, bool &hasOutlineParam, bool &hasDefaultOutlineColor, QColor &defaultOutlineColor, bool &hasOutlineWidthParam, bool &hasDefaultOutlineWidth, double &defaultOutlineWidth) const |
| Tests if an svg file contains parameters for fill, outline color, outline width. More...
|
|
QByteArray | getImageData (const QString &path) const |
| Get image data. More...
|
|
const QImage & | svgAsImage (const QString &file, double size, const QColor &fill, const QColor &outline, double outlineWidth, double widthScaleFactor, double rasterScaleFactor, bool &fitsInCache) |
| Get SVG as QImage. More...
|
|
const QPicture & | svgAsPicture (const QString &file, double size, const QColor &fill, const QColor &outline, double outlineWidth, double widthScaleFactor, double rasterScaleFactor, bool forceVectorOutput=false) |
| Get SVG as QPicture&. More...
|
|
const QByteArray & | svgContent (const QString &file, double size, const QColor &fill, const QColor &outline, double outlineWidth, double widthScaleFactor, double rasterScaleFactor) |
| Get SVG content. More...
|
|
| QObject (QObject *parent) |
|
| QObject (QObject *parent, const char *name) |
|
virtual | ~QObject () |
|
bool | blockSignals (bool block) |
|
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
|
const QObjectList & | children () const |
|
const char * | className () const |
|
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
|
void | deleteLater () |
|
void | destroyed (QObject *obj) |
|
bool | disconnect (const QObject *receiver, const char *method) |
|
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
|
void | dumpObjectInfo () |
|
void | dumpObjectTree () |
|
QList< QByteArray > | dynamicPropertyNames () const |
|
virtual bool | event (QEvent *e) |
|
virtual bool | eventFilter (QObject *watched, QEvent *event) |
|
T | findChild (const QString &name) const |
|
QList< T > | findChildren (const QRegExp ®Exp) const |
|
QList< T > | findChildren (const QString &name) const |
|
bool | inherits (const char *className) const |
|
void | insertChild (QObject *object) |
|
void | installEventFilter (QObject *filterObj) |
|
bool | isA (const char *className) const |
|
bool | isWidgetType () const |
|
void | killTimer (int id) |
|
virtual const QMetaObject * | metaObject () const |
|
void | moveToThread (QThread *targetThread) |
|
const char * | name () const |
|
const char * | name (const char *defaultName) const |
|
QString | objectName () const |
|
QObject * | parent () const |
|
QVariant | property (const char *name) const |
|
void | removeChild (QObject *object) |
|
void | removeEventFilter (QObject *obj) |
|
void | setName (const char *name) |
|
void | setObjectName (const QString &name) |
|
void | setParent (QObject *parent) |
|
bool | setProperty (const char *name, const QVariant &value) |
|
bool | signalsBlocked () const |
|
int | startTimer (int interval) |
|
QThread * | thread () const |
|
|
static QgsSvgCache * | instance () |
|
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
|
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
|
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
|
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
|
QString | tr (const char *sourceText, const char *disambiguation, int n) |
|
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
|
|
| QgsSvgCache (QObject *parent=0) |
| protected constructor More...
|
|
QgsSvgCacheEntry * | cacheEntry (const QString &file, double size, const QColor &fill, const QColor &outline, double outlineWidth, double widthScaleFactor, double rasterScaleFactor) |
| Returns entry from cache or creates a new entry if it does not exist already. More...
|
|
void | cacheImage (QgsSvgCacheEntry *entry) |
|
void | cachePicture (QgsSvgCacheEntry *entry, bool forceVectorOutput=false) |
|
QgsSvgCacheEntry * | insertSVG (const QString &file, double size, const QColor &fill, const QColor &outline, double outlineWidth, double widthScaleFactor, double rasterScaleFactor) |
| Creates new cache entry and returns pointer to it. More...
|
|
void | replaceParamsAndCacheSvg (QgsSvgCacheEntry *entry) |
|
void | takeEntryFromList (QgsSvgCacheEntry *entry) |
|
void | trimToMaximumSize () |
| Removes the least used items until the maximum size is under the limit. More...
|
|
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
|
virtual void | childEvent (QChildEvent *event) |
|
virtual void | connectNotify (const char *signal) |
|
virtual void | customEvent (QEvent *event) |
|
virtual void | disconnectNotify (const char *signal) |
|
int | receivers (const char *signal) const |
|
QObject * | sender () const |
|
int | senderSignalIndex () const |
|
virtual void | timerEvent (QTimerEvent *event) |
|
A cache for images / pictures derived from svg files.
This class supports parameter replacement in svg files according to the svg params specification (http://www.w3.org/TR/2009/WD-SVGParamPrimer-20090616/). Supported are the parameters 'fill-color', 'pen-color', 'outline-width', 'stroke-width'. E.g. <circle fill="param(fill-color red)" stroke="param(pen-color black)" stroke-width="param(outline-width 1)"
Definition at line 78 of file qgssvgcache.h.
void QgsSvgCache::containsParams |
( |
const QString & |
path, |
|
|
bool & |
hasFillParam, |
|
|
QColor & |
defaultFillColor, |
|
|
bool & |
hasOutlineParam, |
|
|
QColor & |
defaultOutlineColor, |
|
|
bool & |
hasOutlineWidthParam, |
|
|
double & |
defaultOutlineWidth |
|
) |
| const |
Tests if an svg file contains parameters for fill, outline color, outline width.
If yes, possible default values are returned. If there are several default values in the svg file, only the first one is considered
Definition at line 227 of file qgssvgcache.cpp.
void QgsSvgCache::containsParams |
( |
const QString & |
path, |
|
|
bool & |
hasFillParam, |
|
|
bool & |
hasDefaultFillParam, |
|
|
QColor & |
defaultFillColor, |
|
|
bool & |
hasOutlineParam, |
|
|
bool & |
hasDefaultOutlineColor, |
|
|
QColor & |
defaultOutlineColor, |
|
|
bool & |
hasOutlineWidthParam, |
|
|
bool & |
hasDefaultOutlineWidth, |
|
|
double & |
defaultOutlineWidth |
|
) |
| const |
Tests if an svg file contains parameters for fill, outline color, outline width.
If yes, possible default values are returned. If there are several default values in the svg file, only the first one is considered.
- Parameters
-
path | path to SVG file |
hasFillParam | will be true if fill param present in SVG |
hasDefaultFillParam | will be true if fill param has a default value specified |
defaultFillColor | will be set to default fill color specified in SVG, if present |
hasOutlineParam | will be true if outline param present in SVG |
hasDefaultOutlineColor | will be true if outline param has a default value specified |
defaultOutlineColor | will be set to default outline color specified in SVG, if present |
hasOutlineWidthParam | will be true if outline width param present in SVG |
hasDefaultOutlineWidth | will be true if outline width param has a default value specified |
defaultOutlineWidth | will be set to default outline width specified in SVG, if present |
- Note
- available in python bindings as containsParamsV2
-
added in QGIS 2.12
Definition at line 239 of file qgssvgcache.cpp.