// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
    \example calculator
    \title SCXML Calculator
    \ingroup examples-qtscxml

    \image calculator.png

    \brief An application that implements the Calculator example
    presented in the SCXML Specification.

    \e {Calculator} uses Qt SCXML to implement the
    \l{SCXML Specification - Calculator Example}{Calculator Example}
    presented in the SCXML Specification.

    The state machine is specified in the \e statemachine.scxml file and
    compiled into the \c CalculatorStateMachine class. The user interface is
    created using Qt Quick.

    \include examples-run.qdocinc

    \section1 Instantiating the State Machine

    We make the generated \c CalculatorStateMachine class available to QML by
    registering it as a QML type in the \e calculator.cpp file:

    \quotefromfile calculator/calculator.cpp
    \skipto statemachine.h
    \printuntil }

    To use the CalculatorStateMachine type in a QML file, we import it:

    \quotefromfile calculator/calculator.qml
    \skipto CalculatorStateMachine
    \printline CalculatorStateMachine

    We instantiate a CalculatorStateMachine and listen to the \c updateDisplay
    event. When it occurs, we change the text on the calculator display:

    \skipto  CalculatorStateMachine {
    \printuntil /^ {4}\}/

    When users press the calculator buttons, the buttons submit events to the
    state machine:

    \skipto DIGIT.
    \skipto Button
    \printuntil }
*/
