libplasma
Plasma::Svg Class Reference
#include <svg.h>

Detailed Description
A theme aware image-centric SVG class.Plasma::Svg provides a class for rendering SVG images to a QPainter in a convenient manner. Unless an absolute path to a file is provided, it loads the SVG document using Plasma::Theme. It also provides a number of internal optimizations to help lower the cost of painting SVGs, such as caching.
Definition at line 50 of file svg.h.
Signals | |
void | repaintNeeded () |
Public Member Functions | |
bool | containsMultipleImages () const |
Q_INVOKABLE QString | elementAtPoint (const QPoint &point) const |
Q_INVOKABLE QRectF | elementRect (const QString &elementId) const |
Q_INVOKABLE QSize | elementSize (const QString &elementId) const |
Q_INVOKABLE bool | hasElement (const QString &elementId) const |
QString | imagePath () const |
Q_INVOKABLE bool | isValid () const |
Q_INVOKABLE void | paint (QPainter *painter, const QRectF &rect, const QString &elementID=QString()) |
Q_INVOKABLE void | paint (QPainter *painter, int x, int y, const QString &elementID=QString()) |
Q_INVOKABLE void | paint (QPainter *painter, const QPointF &point, const QString &elementID=QString()) |
Q_INVOKABLE void | resize () |
Q_INVOKABLE void | resize (const QSizeF &size) |
Q_INVOKABLE void | resize (qreal width, qreal height) |
void | setContainsMultipleImages (bool multiple) |
void | setImagePath (const QString &svgFilePath) |
QSize | size () const |
~Svg () | |
Properties | |
QString | filePath |
bool | multipleImages |
QSize | size |
Related Functions | |
(Note that these are not member functions.) | |
Svg (QObject *parent=0) |
Constructor & Destructor Documentation
Member Function Documentation
bool Plasma::Svg::containsMultipleImages | ( | ) | const |
bool Plasma::Svg::hasElement | ( | const QString & | elementId | ) | const |
QString Plasma::Svg::imagePath | ( | ) | const |
bool Plasma::Svg::isValid | ( | ) | const |
void Plasma::Svg::repaintNeeded | ( | ) | [signal] |
void Plasma::Svg::resize | ( | ) |
void Plasma::Svg::resize | ( | const QSizeF & | size | ) |
void Plasma::Svg::resize | ( | qreal | width, | |
qreal | height | |||
) |
void Plasma::Svg::setContainsMultipleImages | ( | bool | multiple | ) |
void Plasma::Svg::setImagePath | ( | const QString & | svgFilePath | ) |
Convenience method for setting the svg file to use for the Svg.
- svgFilePath the filepath including name of the svg.
Reimplemented in Plasma::PanelSvg.
QSize Plasma::Svg::size | ( | ) | const |
Currently set size of the SVG.
- Returns:
- the current size of a given element
Friends And Related Function Documentation
Plasma::Svg::Svg | ( | QObject * | parent = 0 |
) | [related] |
Constructs an SVG object that implicitly shares and caches rendering As opposed to QSvgRenderer, which this class uses internally, Plasma::Svg represents an image generated from an SVG.
As such, it has a related size and transform matrix (the latter being provided by the painter used to paint the image).
The size is initialized to be the SVG's native size.
- parent options QObject to parent this to
Property Documentation
The documentation for this class was generated from the following files: