1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <QtGui/QApplication> #include "calc.h" #include "qscxml.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); QScxml *sm = QScxml::load(":/calc.scxml"); CalcWidget w; sm->registerObject(&w,"",true); QObject::connect (&w, SIGNAL(command(QString)), sm, SLOT(postNamedEvent(QString))); w.show(); sm->start(); return a.exec(); }