This examples shows how to import a KDSME::StateMachine by importing a SCXML document
#include "config-examples.h"
#include <scxmlimporter.h>
#include <state.h>
#include <statemachinescene.h>
#include <statemachineview.h>
#include <QApplication>
#include <QDebug>
#include <QFile>
#include <QScopedPointer>
int main(int argc, char** argv)
{
QApplication app(argc, argv);
const QString fileName = TEST_DATA_DIR "/scxml/microwave.scxml";
QFile file(fileName);
if (!file.exists()) {
qWarning() << "File does not exist:" << file.fileName();
return 1;
}
Q_ASSERT(file.open(QIODevice::ReadOnly));
QScopedPointer<StateMachine> machine(parser.import());
Q_ASSERT(machine);
view.
scene()->
setRootState(machine.data());
view.resize(800, 600);
view.show();
app.exec();
}