1
0

feat: support basic image copy and paste

This commit is contained in:
Gary Wang
2020-01-01 14:51:46 +08:00
parent 4a5fe4c289
commit c51a603ec9
8 changed files with 183 additions and 32 deletions

View File

@@ -8,6 +8,7 @@
#include <QGraphicsSvgItem>
#include <QMovie>
#include <QLabel>
#include <QPainter>
GraphicsScene::GraphicsScene(QObject *parent)
: QGraphicsScene(parent)
@@ -58,3 +59,12 @@ void GraphicsScene::showGif(const QString &filepath)
QPen(Qt::transparent));
this->setSceneRect(m_theThing->boundingRect());
}
QPixmap GraphicsScene::renderToPixmap()
{
QPixmap pixmap(sceneRect().toRect().size());
QPainter p(&pixmap);
render(&p, sceneRect());
return pixmap;
}