Loading...
Searching...
No Matches
SnapshotAction.hpp
1#pragma once
2#include <score_plugin_scenario_export.h>
3
4#include <QAction>
5#include <QRectF>
6#include <QString>
7class QGraphicsScene;
8namespace Scenario
9{
10// Render a region of a QGraphicsScene to SVG and return the raw SVG bytes.
11// If `path` is non-empty, the SVG is also written there.
12// Returns an empty QByteArray on failure (e.g. QtSvg unavailable).
13// Shared by the F10 SnapshotAction and the JS View.grabScene() API.
14SCORE_PLUGIN_SCENARIO_EXPORT
15QByteArray renderSceneToSvg(
16 QGraphicsScene& scene, const QString& path = {},
17 QRectF rect = QRectF(0, 0, 1920, 1080));
18
19struct SnapshotAction : public QAction
20{
21public:
22 SnapshotAction(QGraphicsScene& scene, QWidget* parent);
23
24private:
25 void takeScreenshot(QGraphicsScene& scene);
26};
27}
Main plug-in of score.
Definition score-plugin-dataflow/Dataflow/PortItem.hpp:13
Definition SnapshotAction.hpp:20