|
Maki
Formally verfied low-code orchestration
|
Represents information needed to save and load a canvas state. More...
#include <canvas_info.h>
Public Member Functions | |
| CanvasSaveInfo () | |
| Constructs a new CanvasSaveInfo object with default values. | |
| qreal | scale () const |
| Returns the current scale of the canvas. | |
| QPointF | center () const |
| Returns the center point of the canvas. | |
| void | setScale (qreal scale) |
| Sets the scale of the canvas. | |
| void | setCenter (const QPointF ¢er) |
| Sets the center point of the canvas. | |
| QJsonObject | toJson () const |
| Converts the CanvasSaveInfo object to a JSON object. | |
Static Public Member Functions | |
| static CanvasSaveInfo | fromJson (const QJsonObject &data) |
| Creates a CanvasSaveInfo object from a JSON object. | |
Private Attributes | |
| QPointF | mCenter = {0, 0} |
| The scale of the canvas. | |
Friends | |
| QDataStream & | operator<< (QDataStream &out, const CanvasSaveInfo &info) |
| Overloads the << operator to serialize a CanvasSaveInfo object to a QDataStream. | |
| QDataStream & | operator>> (QDataStream &in, CanvasSaveInfo &info) |
| Overloads the >> operator to deserialize a CanvasSaveInfo object from a QDataStream. | |
Represents information needed to save and load a canvas state.
| QPointF CanvasSaveInfo::center | ( | ) | const |
Returns the center point of the canvas.
|
static |
Creates a CanvasSaveInfo object from a JSON object.
| data | The QJsonObject containing the saved canvas information. |
| qreal CanvasSaveInfo::scale | ( | ) | const |
Returns the current scale of the canvas.
| void CanvasSaveInfo::setCenter | ( | const QPointF & | center | ) |
Sets the center point of the canvas.
| center | The new center point as a QPointF. |
| void CanvasSaveInfo::setScale | ( | qreal | scale | ) |
Sets the scale of the canvas.
| scale | The new scale value. |
| QJsonObject CanvasSaveInfo::toJson | ( | ) | const |
Converts the CanvasSaveInfo object to a JSON object.
|
friend |
Overloads the << operator to serialize a CanvasSaveInfo object to a QDataStream.
| out | The QDataStream to write to. |
| info | The CanvasSaveInfo object to serialize. |
|
friend |
Overloads the >> operator to deserialize a CanvasSaveInfo object from a QDataStream.
| in | The QDataStream to read from. |
| info | The CanvasSaveInfo object to deserialize into. |