KDStateMachineEditor API Documentation 2.1
Loading...
Searching...
No Matches
Functions
KDSME::LayoutImportExport Namespace Reference

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

Functions

KDSME_CORE_EXPORT QJsonObject exportLayout (const State *state)
 Export layout of state into a machine-parsable JSON format.
 
KDSME_CORE_EXPORT void importLayout (const QJsonObject &data, State *state)
 Import layout data to set properties of state and its children.
 
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.
 

Detailed Description

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

Function Documentation

◆ exportLayout()

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()

Definition at line 149 of file layoutimportexport.cpp.

References KDSME::State::childStates(), exportLayout(), and KDSME::State::transitions().

Referenced by exportLayout().

◆ importLayout()

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()

Definition at line 132 of file layoutimportexport.cpp.

References KDSME::State::childStates(), importLayout(), and KDSME::State::transitions().

Referenced by importLayout().

◆ matches()

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

Definition at line 170 of file layoutimportexport.cpp.

References KDSME::State::childStates(), matches(), and KDSME::State::transitions().

Referenced by matches().


© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDStateMachineEditor
Create Qt State Machine metacode using a graphical user interface
https://github.com/KDAB/KDStateMachineEditor
Generated on Tue Jul 15 2025 15:21:47 for KDStateMachineEditor API Documentation by doxygen 1.9.8