This is an example of how to use LayoutImportExport::exportLayout() and the resulting JSON it produces
#include "config-examples.h"
#include <scxmlimporter.h>
#include <state.h>
#include <layoutimportexport.h>
#include <QJsonDocument>
#include <QJsonObject>
#include <QFile>
#include <QScopedPointer>
#include <QTextStream>
int main()
{
const QString fileName = TEST_DATA_DIR
"/scxml/trafficlight_alternative.scxml";
qErr <<
"File does not exist:" << file.
fileName();
return 1;
}
Q_ASSERT(file.
open(QIODevice::ReadOnly));
Q_ASSERT(machine);
qOut << "Layout in JSON format";
return 0;
}