svg?
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <QDebug>
|
||||
#include <QGraphicsItem>
|
||||
#include <QUrl>
|
||||
#include <QGraphicsSvgItem>
|
||||
|
||||
GraphicsScene::GraphicsScene(QObject *parent)
|
||||
: QGraphicsScene(parent)
|
||||
@@ -32,3 +33,12 @@ void GraphicsScene::showText(const QString &text)
|
||||
m_theThing = textItem;
|
||||
this->setSceneRect(m_theThing->boundingRect());
|
||||
}
|
||||
|
||||
void GraphicsScene::showSvg(const QString &filepath)
|
||||
{
|
||||
this->clear();
|
||||
QGraphicsSvgItem * svgItem = new QGraphicsSvgItem(filepath);
|
||||
this->addItem(svgItem);
|
||||
m_theThing = svgItem;
|
||||
this->setSceneRect(m_theThing->boundingRect());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user