diff options
author | Nico Vertriest <nico.vertriest@qt.io> | 2018-03-05 16:19:40 +0100 |
---|---|---|
committer | Nico Vertriest <nico.vertriest@qt.io> | 2018-04-09 06:50:21 +0000 |
commit | 23b2d2ada5b1b66ad65eda10d70b5b48d32ef9c5 (patch) | |
tree | 2027ba9a574a2a5db4cc907ac353eba00e5691e3 | |
parent | 335754d0a329bc2ad845b68b40833bbd8428084a (diff) |
Doc: Update Event Transitions Example
- added screenshot
- some modifications to the text
Task-number QTBUG-60635
Change-Id: I57b269f93cdba696b424b5ba008d0f46ac612cda
Reviewed-by: Martin Smith <martin.smith@qt.io>
-rw-r--r-- | doc/src/images/transitions.png | bin | 0 -> 4314 bytes | |||
-rw-r--r-- | examples/widgets/doc/src/eventtransitions.qdoc | 27 |
2 files changed, 20 insertions, 7 deletions
diff --git a/doc/src/images/transitions.png b/doc/src/images/transitions.png Binary files differnew file mode 100644 index 0000000000..b29466f5ab --- /dev/null +++ b/doc/src/images/transitions.png diff --git a/examples/widgets/doc/src/eventtransitions.qdoc b/examples/widgets/doc/src/eventtransitions.qdoc index 2c59d0863d..4d332c0e00 100644 --- a/examples/widgets/doc/src/eventtransitions.qdoc +++ b/examples/widgets/doc/src/eventtransitions.qdoc @@ -29,17 +29,29 @@ \example statemachine/eventtransitions \title Event Transitions Example - \brief The Event Transitions example shows how to use event transitions, a - feature of \l{The State Machine Framework}. + \brief The Event Transitions example shows how to use event transitions, + a feature of \l{The State Machine Framework}. + + The Event Transitions Example illustrates how states change when a + user enters or leaves the area of a button. The states are handled by + a QStateMachine object. The screen consists of a QVBoxLayout with a + central button. + + When the mouse is outside the button, the text in the button displays + "Outside". When the mouse enters the button, it displays "Inside". + + \borderedimage transitions.png \snippet statemachine/eventtransitions/main.cpp 0 The \c Window class's constructors begins by creating a button. + This button is added to \c layout, which is a QVBoxLayout object. + Then two states are created: \s1 is the state + "Outside", and \c s2 is the state "Inside". \snippet statemachine/eventtransitions/main.cpp 1 - Two states, \c s1 and \c s2, are created; upon entry they will assign - "Outside" and "Inside" to the button's text, respectively. + State \c s1 is the state "Outside" and state \c s2 is state "Inside". \snippet statemachine/eventtransitions/main.cpp 2 @@ -54,11 +66,11 @@ \snippet statemachine/eventtransitions/main.cpp 4 - Next, the state \c s3 is created. \c s3 will be entered when the button + Next, state \c s3 is created. \c s3 will be entered when the button receives an event of type QEvent::MouseButtonPress and the state machine is in state \c s2. When the button receives an event of type QEvent::MouseButtonRelease and the state machine is in state \c s3, the - machine will transition back to state \c s2. + machine will revert to state \c s2. \snippet statemachine/eventtransitions/main.cpp 5 @@ -67,6 +79,7 @@ \snippet statemachine/eventtransitions/main.cpp 6 - The main() function constructs a Window object and shows it. + The main() function constructs a Window object that displays the QVBoxLayout + object \c layout with its \c button. */ |