feat: support basic image copy and paste
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user