summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
...
* Reduce repeating codeJarek Kobus2016-07-262-94/+65
| | | | | | Change-Id: I53f3357af4070a9a5b1e964e6ed657923c0939d0 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Auto-include qscxmlc in module configUlf Hermann2016-07-1512-24/+0
| | | | | | | | This enables us to drop all the load(qscxmlc) declarations in the various .pro files. Change-Id: I37e0ddba76be1c4c79dea1302634f62a22032ee2 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Better connection mechanism for eventsUlf Hermann2016-07-143-16/+8
| | | | | | | | | The connectToEvent() mechanism is analogous to connectToState() and allows arbitrary event specifications, with '.' and '*'. In addition a QML component is provided to make event connections available in QML. Change-Id: Ie45422481a794b1b350347c383318857e5dc3f6d Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Provide Qt5-style syntax for connectToStateUlf Hermann2016-07-132-6/+6
| | | | | | | | | We should not force people to use the string-based connection syntax. Using modern C++ we can add more convenience here. Unfortunately we have to duplicate some code from QMetaObject, but this is worth it. Change-Id: I4daa1f7cfea9feb3de0159636a508ee64a849f55 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Fix examples install pathsUlf Hermann2016-06-093-3/+3
| | | | | | | qmake will throw an error for unexpected paths. Change-Id: I976269af19d132461dd6b9daaadd01c05181feab Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Doc: Edit Pinball example docsLeena Miettinen2016-05-178-296/+256
| | | | | | | | | | - Edit for grammar and style. - Add state chart images to improve readability. - Add subtitles to improve readability. Change-Id: I1429adf098e868388489f361caa5265b32c33a45 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Topi Reiniƶ <topi.reinio@theqtcompany.com>
* Improve QtScxml module conformity to other Qt modulesAlex Blasche2016-05-173-3/+3
| | | | | | | | | | The other QML modules use a versioning based on the Qt modules version. In addition the QML plugin name is always libdeclarative_<module_name>.so. Therefore the target for the QML project has to be adjusted accordingly. Change-Id: I218836bc01a7cb4ab8d8c3edde1d3d6deeaffd75 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Cleanup and rename QML scxmlstatemachine pluginAlex Blasche2016-05-125-5/+5
| | | | | | | | | The Qt modules use the Qt prefix and the project file should rely on qmake's qml_plugin logic. Change-Id: I9a13109d6307679c1e7362680eaf9c33e2bdda3b Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Adjust style of calculator exampleUlf Hermann2016-04-062-3/+15
| | | | | | | Change-Id: If3dfab3d0ec1faaa7cbeb5d4da34a24f6da288c7 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Diana de Sousa <diana.desousa@theqtcompany.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* Fix use of context property in invoke example.Erik Verbruggen2016-04-011-2/+3
| | | | | Change-Id: I559e41c22ab55a076ebc4ead7e23df0aea99de13 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* Doc: Add docs for Calculator QML exampleLeena Miettinen2016-04-014-25/+103
| | | | | | | | | - Use a .qdocinc include file for compilation instructions - Add screenshot - Fix related issues in the widget version docs Change-Id: Ia1de27f81a45e23ab37158cb66b537c95810c28b Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* Add calculator QML exampleUlf Hermann2016-03-3114-15/+341
| | | | | Change-Id: I225ace405a9afc62ba68079a53856a2567f678bd Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Change examples to follow best practicesUlf Hermann2016-03-3013-28/+31
| | | | | | | | | | Adding QObjects as context properties to QML engines is not the best way to interoperate between QML and C++. This change exposes all state machines as proper QML components and instantiates them from QML. Also, it drops all the now unnecessary init() calls. Change-Id: Id44b4038542dd9469e02831c1bb54f096af1b6ff Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Automatically initialize state machines when startingUlf Hermann2016-03-301-1/+1
| | | | | | | | | | This removes the need to call init() before start(), making the API much more intuitive. We also expose the initial values as a Q_PROPERTY so that they can be set in a declarative way from QML. Change-Id: If3c995c956764018bcab7b6caa8485e32bba6f1a Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
* Drop the stateMachine parameter from data model constructorsUlf Hermann2016-03-303-9/+2
| | | | | | | | | | Instead, make the data model a Q_PROPERTY of state machines. This makes it much easier to independently instantiate state machines and data models from QML and connect them via properties. Change-Id: I62d712dd0ad7817c39432204ced431b8041e442d Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
* Make data models QObjects, and rename some members to avoid clashesUlf Hermann2016-03-303-5/+7
| | | | | | | | | | We will have one data model per state machine, so the overhead of creating a QObject won't be significant. However, we can expose the data model to QML this way. Also, by using QObjectPrivate, we can actually drop a few d-pointers. Change-Id: I8a73dde017e8fd38032f4948e2946590456b4cc9 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Polish traffic light exampleUlf Hermann2016-03-2222-151/+145
| | | | | | | Change-Id: I85f56f87b985ff966b975c571a399fa8f1f6e86f Reviewed-by: Diana de Sousa <diana.desousa@theqtcompany.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Doc: Fix pinball example documentationUlf Hermann2016-03-211-2/+2
| | | | | Change-Id: I2e704c144cba0b7e530d651eb8dd31dc9db51adc Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
* Doc: Add docs for the Traffic Light exampleLeena Miettinen2016-03-177-8/+169
| | | | | Change-Id: Id51e2cb7eaf04179efe5379ac82f596ede3f6b04 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Doc: Add docs for Mediaplayer example versionsLeena Miettinen2016-03-159-10/+200
| | | | | | | | | | | - Add screenshot - Use include files for info common to several app versions - Add examples directory to sourcedirs in the .qdocconf file to be able to put the include files to the mediaplayer-common folder Change-Id: I411d74d51d17b9ed5d906e23ede3b64e3b6b2dac Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* Doc: Add docs for Invoke examplesLeena Miettinen2016-03-075-8/+84
| | | | | | | | | - Explain invoking and loading or compiling the state machine. - Remove the unnecessary load command from invoke-static.pro. - Add screenshots. Change-Id: I79ae7b656bcc350c3cd96b17716a432135d9697e Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Doc: add docs for Calculator exampleLeena Miettinen2016-03-031-0/+49
| | | | | Change-Id: I1a8c3407cec865ca9684e18896a89f73a9cde016 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Doc: corrections according to the current API state.Jarek Kobus2016-03-036-78/+63
| | | | | | Change-Id: Id38eb2b75e5205b74238151b20a279ba71442713 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Examples: Return on QML load error.Friedemann Kleint2016-02-256-0/+14
| | | | | | | | Prevents hanging processes should an error while loading QML occur. Change-Id: I35f68ef170755f075fe95e2e535e363a49c598ee Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* Move examples into module based subdirAlex Blasche2016-02-1285-20/+24
| | | | | | | | | The release process puts all examples based on their module name into the same directory. Therefore each module has to group its examples based on their module name. Change-Id: I3695297ff0489fbbb2c4f4aa13e0c4baa7f011b7 Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* Reorganize the calculator example.Jarek Kobus2016-02-1110-26/+35
| | | | | Change-Id: I6696fcc426296a5d17180edfbdaee7842429e0c9 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Rename connect -> connectToState, remove "signal" argument.Jarek Kobus2016-02-102-7/+6
| | | | | | Change-Id: I79f4e2f91eabfbf224d4b6acd4c78b77fd80b577 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Change staticMetaObject generation.Erik Verbruggen2016-02-057-27/+25
| | | | | | | | | The full meta-object generation is replaced with the moc generator. This gives a fully functional meta-object without any overhead during object instantiation. Change-Id: Ibf62a6f1bfc0873cd00dd2e4bbad38c8d165005a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* Remove event_ prefix from event signals and slots.Erik Verbruggen2016-02-046-17/+17
| | | | | | | | Also only generate the C++ declarations and definitions when in "qt mode". Change-Id: I799ce3efe23e046d26180d1a6e690755523dbed1 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Change state properties to be booleans and add notify signals.Erik Verbruggen2016-02-044-11/+11
| | | | | | | The state properties now indicate whether a state is active or not. Change-Id: I1b9029056e38debf7cb46411bfe9e7c8ff4eefb7 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Introducing Qt mode: the cutest mode since vi mode.Erik Verbruggen2016-02-044-10/+14
| | | | | | | | In qt-mode, event names and state id's are expected to be valid C++ identifiers. Change-Id: If238a6836602bc77b44dc0240b866f717d43c4e7 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Remove spurious identifier.Erik Verbruggen2016-01-291-1/+1
| | | | | | Change-Id: Ic33698484fd3654d64c60c455d5c6f5c2955d793 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* Update license headersJarek Kobus2016-01-2655-282/+821
| | | | | Change-Id: If100cc6cfeccc9ec4f13e03d69edfb7fad6bc2f6 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Build fix.Erik Verbruggen2016-01-211-2/+2
| | | | | Change-Id: I51fe97d08238f3ead432783db5f31de5fd5d4233 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* Reorganize pinball exampleJarek Kobus2015-12-1817-1198/+41
| | | | | Change-Id: I61cd8f4309c0fc8cd0ca34722ad30e6133eeb4fc Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* More work on a documentation for pinball exampleJarek Kobus2015-12-183-44/+101
| | | | | Change-Id: I4f6bec3d992a15f7ad3d905f8fff632da8c1f25b Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Add a documentation for pinball exampleJarek Kobus2015-12-164-139/+589
| | | | | Change-Id: I80fa42ccaf2204f5663199a69fa010e3944337fa Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Remove QScxmlStateMachine::setDataModel.Erik Verbruggen2015-12-033-2/+7
| | | | | | | The data-model constructor will now do the work. Change-Id: I32dfaf95b39a4e9dcd0b6f3598fe89fdf150c909 Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* Even more documentation.Erik Verbruggen2015-12-011-2/+2
| | | | | Change-Id: Iac3a36a61b883ef9fa80a9b37fdc53a73f2b0e27 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Temporarily disable building tests/examples with msvc.Erik Verbruggen2015-11-201-0/+2
| | | | | | | The CI has an issue due to which these can't be build. Change-Id: Iba2ff0ac7b41bbe52b7a838eb3f1cc44f068ed3b Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* More license fixes.Erik Verbruggen2015-11-1714-238/+280
| | | | | Change-Id: Ie048b867b34a05f23b491c4149fc5e1cd0dbe67b Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Add a short description to the examples overview doc.Erik Verbruggen2015-11-1711-11/+13
| | | | | Change-Id: I036bc1e6e73427a7678b14dbaf51169be0471f92 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Doc: Create structure for example documentationTopi Reinio2015-11-1714-0/+350
| | | | | | | | | Create skeleton structure for example documentation, and add each example to examples-qtscxml group, so that they'll be listed on the group page. Change-Id: I55ee0530704c484a1012b0bd9fbd59336ffb0b6e Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Fix logging.Erik Verbruggen2015-11-044-7/+0
| | | | | Change-Id: Iae6d7f93b9f257e2c2cd56b2cdd4d13447ce9a8e Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Fix build with Qt in a namespace.Erik Verbruggen2015-11-041-1/+1
| | | | | Change-Id: Ic9622b0090e47fb3ef88b3718fa2106929b417f8 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Add a calculator example, taken from w3c document.Jarek Kobus2015-10-307-0/+617
| | | | | | | | The example got slightly modified. Not working perfectly (due to internal logic of the example). Change-Id: I4698688dd724497518aadbe5155a280329074615 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Add more advanced version of Pinball with ecmascriptJarek Kobus2015-10-307-0/+1294
| | | | | | | It uses ecmascript to count score / highscore. Change-Id: Idf0953e42d613cac95dc8b82027f61cac0ff890f Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Fix example build.Erik Verbruggen2015-10-301-1/+1
| | | | | Change-Id: I1739e41327eba2e405bd4a825ca9d1a6a2c034b3 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Add a pinball exampleJarek Kobus2015-10-307-0/+1132
| | | | | Change-Id: Ibe8d31fa3b70b862dfb74606f5e4cd5435b25878 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Fix building with MSVC2012.Erik Verbruggen2015-10-281-4/+6
| | | | | | | No initializer lists.... Change-Id: I3a86992cd7412cde9967d57d9ad68d7f6424c404 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>