[Development] Request for sandbox area: QQSM

Stottlemyer, Brett (B.S.) bstottle at ford.com
Sat May 31 00:14:34 CEST 2014

Hi list,

My name is Brett Stottlemyer.  I work for Ford Motor Company, and Ford has graciously agreed to let us contribute some of the cool stuff we've developed back to Qt.  We aren't quite done with everything yet (still waiting on the Corporate CLA), but I will be at Qt Contributors Summit in a week and a half to discuss this and a 2nd project, and answer (hopefully a bunch) of good questions.

I'd like to officially request a sandbox for: QQSM

What is it?
QQSM is the Qt QML State Machine.  Simply put, it is a QML module to allow you to create Qt State Machine Framework instances via the QML engine.

What need does this module solve?
QQSM makes it a lot easier to create state machines.  You get all of the benefits of the maturity of Qt's State Machine Framework, the ability to introspect/debug the machine with tools like gammaray, but with a simplified syntax and QML's runtime bindings.  An example of the simplification?  A guard condition for a transition can use QML/javascript and use signal parameters in deciding whether to trigger a transition - entirely in QML markup.

Detailed description
QQSM is basically a Domain Specific Language (in QML) for simplified descriptions of State Machines.  While the C++ State Machine Framework is complete, it requires a lot of boilerplate code.  The examples I've seen have created numerous QSignalTransition derived classes, one for each boolean condition required to test for a transition.

While QML already has a State type, this is not a complete, deterministic state machine.  This is an overly simplified state machine, in that it provides little in terms of error checking or nested states.

The proposed QQSM module, on the other hand, provides BasicState (to not conflict with existing State type), HistoryState and FinalState, plus StateMachine, SignalTransition and TimeoutTransition types.  The benefit of QML for State Machines is much more than just having to write less code, though.  Two features of the QML engine are runtime processing of scripted code, and dynamic Signal/Slot connections.  Since all SignalTransition classes provide a boolean result for eventTest(), a single C++ implementation was created that uses a boolean property ("guard") for the eventTest result.  This allows any QML/Javascript expression that resolves to a boolean to be used.  The dynamic connections make is easy to bind onEntry and onExit signals to non-state machine QObjects.

The end result is an environment that allows State Machines to be developed rapidly and succinctly.

Hope you like the idea, and approve the sandbox area.

Looking forward to your thoughts!

Brett Stottlemyer
Ford Motor Company

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20140530/343208e6/attachment.html>

More information about the Development mailing list