8#include <dtkgui_global.h>
20class DSvgRendererPrivate;
21class DSvgRenderer :
public QObject,
public DTK_CORE_NAMESPACE::DObject
23 Q_PROPERTY(QRectF viewBox READ viewBoxF WRITE setViewBox)
26 DSvgRenderer(
const QString &filename, QObject *parent = Q_NULLPTR);
27 DSvgRenderer(
const QByteArray &contents, QObject *parent = Q_NULLPTR);
32 QSize defaultSize()
const;
34 QRect viewBox()
const;
35 QRectF viewBoxF()
const;
36 void setViewBox(
const QRect &viewbox);
37 void setViewBox(
const QRectF &viewbox);
39 QRectF boundsOnElement(
const QString &
id)
const;
40 bool elementExists(
const QString &
id)
const;
42 QImage toImage(
const QSize sz,
const QString &elementId = QString())
const;
45 bool load(
const QString &filename);
46 bool load(
const QByteArray &contents);
47 void render(QPainter *p);
48 void render(QPainter *p,
const QRectF &bounds);
50 void render(QPainter *p,
const QString &elementId,
51 const QRectF &bounds = QRectF());
59#include <QSvgRenderer>