KDStateMachineEditor  1.0.0
A framework for creating Qt State Machine metacode using a graphical user interface
Functions
KDSME::LayoutImportExport Namespace Reference

Utils for importing/exporting layout properties of a the object tree representing a state. More...

Functions

KDSME_CORE_EXPORT bool matches (const QJsonObject &data, State *state)
 Check if the ids in data still match the ids from the object tree represented by state. More...
 
KDSME_CORE_EXPORT QJsonObject exportLayout (const State *state)
 Export layout of state into a machine-parsable JSON format. More...
 
KDSME_CORE_EXPORT void importLayout (const QJsonObject &data, State *state)
 Import layout data to set properties of state and its children. More...
 

Detailed Description

Utils for importing/exporting layout properties of a the object tree representing a state.

Function Documentation

QJsonObject KDSME::LayoutImportExport::exportLayout ( const State state)

Export layout of state into a machine-parsable JSON format.

Goes through the object tree representented by state and fetches the layout properties of each element (such as, x/y-position, width/height, shape, ...)

The resulting JSON output can be used to restore the layout of the exact same state hierarchy

See also
importLayout()
Examples:
layoutexport/main.cpp.
void KDSME::LayoutImportExport::importLayout ( const QJsonObject &  data,
State state 
)

Import layout data to set properties of state and its children.

Note
Ids of state and its children must match with the ids stored in data, otherwise the layout cannot be imported
See also
matches()
exportLayout()
bool KDSME::LayoutImportExport::matches ( const QJsonObject &  data,
State state 
)

Check if the ids in data still match the ids from the object tree represented by state.

Returns
True if ids are identical, otherwise false

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/
https://github.com/KDAB/KDStateMachineEditor