1
0
This commit is contained in:
Gary Wang
2019-09-29 23:53:29 +08:00
parent a4d8376c20
commit d106d9beee
13 changed files with 477 additions and 56 deletions

View File

@@ -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());
}