[TD]allow loading SVG item from file
This commit is contained in:
@@ -71,6 +71,14 @@ bool QGCustomSvg::load(QByteArray *svgBytes)
|
||||
return(success);
|
||||
}
|
||||
|
||||
bool QGCustomSvg::load(QString filename)
|
||||
{
|
||||
bool success = m_svgRender->load(filename);
|
||||
prepareGeometryChange();
|
||||
setSharedRenderer(m_svgRender);
|
||||
return(success);
|
||||
}
|
||||
|
||||
void QGCustomSvg::paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget) {
|
||||
QStyleOptionGraphicsItem myOption(*option);
|
||||
myOption.state &= ~QStyle::State_Selected;
|
||||
|
||||
@@ -55,6 +55,7 @@ public:
|
||||
virtual void centerAt(QPointF centerPos);
|
||||
virtual void centerAt(double cX, double cY);
|
||||
virtual bool load(QByteArray *svgString);
|
||||
virtual bool load(QString filename);
|
||||
|
||||
protected:
|
||||
QSvgRenderer *m_svgRender;
|
||||
|
||||
Reference in New Issue
Block a user