2019-09-29 15:52:35 +08:00
|
|
|
#ifndef GRAPHICSSCENE_H
|
|
|
|
#define GRAPHICSSCENE_H
|
|
|
|
|
|
|
|
#include <QGraphicsScene>
|
|
|
|
|
|
|
|
class GraphicsScene : public QGraphicsScene
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
GraphicsScene(QObject *parent = nullptr);
|
|
|
|
~GraphicsScene();
|
|
|
|
|
|
|
|
void showImage(const QPixmap &pixmap);
|
|
|
|
void showText(const QString &text);
|
2019-09-29 23:53:29 +08:00
|
|
|
void showSvg(const QString &filepath);
|
2021-04-15 00:00:18 +08:00
|
|
|
void showAnimated(const QString &filepath);
|
2019-09-29 15:52:35 +08:00
|
|
|
|
2021-06-20 14:59:44 +08:00
|
|
|
bool trySetTransformationMode(Qt::TransformationMode mode, float scaleHint);
|
2020-02-13 19:45:14 +08:00
|
|
|
|
2020-01-01 14:51:46 +08:00
|
|
|
QPixmap renderToPixmap();
|
|
|
|
|
2019-09-29 15:52:35 +08:00
|
|
|
private:
|
|
|
|
QGraphicsItem * m_theThing;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // GRAPHICSSCENE_H
|