Plasma
Plasma::Svg Class Reference
A theme aware image-centric SVG class. More...
#include <Plasma/Svg>

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, int x, int y, int width, int height, const QString &elementID=QString()) |
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 QPixmap | pixmap (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 | imagePath |
bool | multipleImages |
QSize | size |
Related Functions | |
(Note that these are not member functions.) | |
Svg (QObject *parent=0) |
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.
- See also:
- Plasma::FrameSvg
Definition at line 55 of file svg.h.
Constructor & Destructor Documentation
Member Function Documentation
bool Plasma::Svg::containsMultipleImages | ( | ) | const |
bool Plasma::Svg::hasElement | ( | const QString & | elementId | ) | const |
QString Plasma::Svg::imagePath | ( | ) | const |
Convenience method to get the svg filepath and name of svg.
- Returns:
- the svg's filepath including name of the svg.
bool Plasma::Svg::isValid | ( | ) | const |
void Plasma::Svg::paint | ( | QPainter * | painter, | |
int | x, | |||
int | y, | |||
int | width, | |||
int | height, | |||
const QString & | elementID = QString() | |||
) |
Paints the SVG represented by this object.
- painter the QPainter to use
- x the horizontal coordinate to start painting from
- y the vertical coordinate to start painting from
- width the width of the element to draw
- height the height of the element do draw
- elelementId the ID string of the element to render, or an empty string for the whole SVG (the default)
void Plasma::Svg::paint | ( | QPainter * | painter, | |
const QRectF & | rect, | |||
const QString & | elementID = QString() | |||
) |
Paints the SVG represented by this object.
- painter the QPainter to use
- rect the rect to draw into; if smaller than the current size the drawing is starting at this point.
- elelementId the ID string of the element to render, or an empty string for the whole SVG (the default)
Paints the SVG represented by this object.
- painter the QPainter to use
- x the horizontal coordinate to start painting from
- y the vertical coordinate to start painting from
- elelementId the ID string of the element to render, or an empty string for the whole SVG (the default)
void Plasma::Svg::paint | ( | QPainter * | painter, | |
const QPointF & | point, | |||
const QString & | elementID = QString() | |||
) |
Paints the SVG represented by this object.
- painter the QPainter to use
- point the position to start drawing; the entire svg will be drawn starting at this point.
- elelementId the ID string of the element to render, or an empty string for the whole SVG (the default)
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::FrameSvg.
QSize Plasma::Svg::size | ( | ) | const |
Currently set size of the SVG.
- Returns:
- the current size of the SVG
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: