summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* examples: depends on Quick instead of QmlLiang Qi2019-02-131-1/+1
| | | | | Change-Id: I5c824bb2e91b3e7d3a2bb70feb1d8419827482c9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Don't use foreachJarek Kobus2018-05-021-1/+1
| | | | | | Task-number: QTBUG-60649 Change-Id: I28efb8711343196cd89b1edbae455a9e04422e4b Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Wrap examples' code at 80 columnJarek Kobus2018-05-0210-27/+54
| | | | | | | | According to https://wiki.qt.io/Writing_Qt_Examples Task-number: QTBUG-60649 Change-Id: I17073bb3caf32ccd17d93542876a73ed939f12bd Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Fix coding style issuesJarek Kobus2018-05-021-1/+1
| | | | | | Task-number: QTBUG-60649 Change-Id: I080ddb7b6b7021a2597ddc19bc820f1c92abcc41 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Use canonical include style and sort #includeJarek Kobus2018-05-0211-18/+18
| | | | | | | | See also https://wiki.qt.io/Writing_Qt_Examples Task-number: QTBUG-60649 Change-Id: I3a5671f39e870f96546e66427cc9434f41777e33 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Give examples a meaningful window titleJarek Kobus2018-05-023-9/+0
| | | | | | | | They will get the app name, like other examples Task-number: QTBUG-60649 Change-Id: Ib66a37e0c1253f12d9fa0ec19a2f1220e7277f05 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* examplesrevamp: Don't include QtWidgetsJarek Kobus2018-05-021-1/+2
| | | | | | | | Include only what's needed. Task-number: QTBUG-60649 Change-Id: I9c1423c56afe85f65a36f7f7982b96e87fade012 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devv5.11.0-alpha1Liang Qi2018-02-013-0/+3
|\ | | | | | | | | | | | | | | Conflicts: .qmake.conf src/scxml/qscxmlcompiler.cpp Change-Id: Ie338e2c6a09e2d885d5f57a80abd386065ac8bc8
| * qtlite: Skip building examples when configured with no-feature-itemviewsRainer Keller2018-01-123-0/+3
| | | | | | | | | | | | | | Task-number: QTBUG-53141 Change-Id: I22a1d247e8debe5b1b700cc810de2f3b4ab7ce23 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | Make the network dependency explicit in the exampleKarsten Heimrich2018-01-231-1/+1
| | | | | | | | | | | | Change-Id: I0c12d9a1eacaf71ea3b061ac1b1cdd3bf4500157 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-202-13/+18
|\| | | | | | | | | | | | | Conflicts: src/scxml/qscxmlcompiler.cpp Change-Id: I4abda984e523cdf2a0810ed7dc1773e055746e18
| * QML code improvements for examplesMichael Winkelmann2017-09-112-13/+18
| | | | | | | | | | Change-Id: I0f7bfc749e41071268d107d3250910de918a2d0a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Replace Q_DECL_OVERRIDE with overrideKevin Funk2017-09-212-6/+6
|/ | | | | Change-Id: I68e08fd214ad3dbf4de9c9e23b1725950925c1fb Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Update examples to C++11Michael Winkelmann2017-07-189-19/+18
| | | | | Change-Id: If23693387da9e5c0a102041298f626a068b26f6d Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Fix the layout of lights in simple trafficlight exampleJarek Kobus2017-07-051-0/+2
| | | | | | Task-number: QTBUG-61313 Change-Id: I15ed8c33a25f1fa06e7635168775249199b0cd52 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Doc: Update screenshots of examples to show Windows 10 styleLeena Miettinen2017-05-243-0/+0
| | | | | | | | | - Calculator - Mediaplayer - Sudoku Change-Id: I4eaa71d178f81f9d317de2f3626b7fb08e5776e1 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Make ftpclient example valid scxmlUlf Hermann2017-02-072-2/+3
| | | | | | | | | | Section 6.2.3 of the standard says "A conformant SCXML document MUST specify exactly one of 'event', 'eventexpr' and <content>." Therefore we cannot use <content> with 'eventexpr', but we can use <param> instead. Change-Id: I64c0ec8a1f08d5b441e5b52a83800800f8a99d03 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* TrafficLight example: prevent resizing past implicit background sizeMitch Curtis2017-01-021-0/+2
| | | | | | | | | | We don't have anything to display since our background image isn't scalable, so just prevent resizing past the implicit size of the background image to avoid a black region being visible. Task-number: QTBUG-57476 Change-Id: I57e55f860b3447c6940c90b04b8b4e1b0f87d484 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Update docs according to recent changesJarek Kobus2016-11-141-2/+2
| | | | | Change-Id: I5b2c8827bbfef749b51b904314ed822fdf150d20 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Fix docJarek Kobus2016-11-141-1/+1
| | | | | Change-Id: I406500e76deb4e0956aa671319bb01319012a7cd Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Add docs for sudoku exampleJarek Kobus2016-11-145-4/+396
| | | | | Change-Id: I956a0c8d030475ff7ec00dabfeffd980918fde2a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add a sudoku exampleJarek Kobus2016-10-1710-0/+674
| | | | | Change-Id: I08a0c053a195dd55e6ff796b89a19ee160eb152d Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Use std::function for onEntry and onExit return typesUlf Hermann2016-10-142-7/+0
| | | | | | | | | This allows us to drop the C++14 requirement. As onEntry and onExit are template functions we don't need to care about (not) using the standard library for them. Change-Id: Ie776e04f7e1771914c9f48d2440ef445d87d64c0 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Use QByteArray rather than QString for ftpclient exampleUlf Hermann2016-10-146-24/+23
| | | | | | | | This makes the code simpler and relieves us of the need to assume any specific character encoding for the communication with the server. Change-Id: Icc31e963f95eeff4a13e69c3d25d6f0d400a9d13 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Re-enable building of examples on MSVCUlf Hermann2016-10-041-2/+0
| | | | | | | | Apparently the tests work on MSVC, so we should be able to also revert the examples side of 65964f13e9156b4ec26707d916f6f8e56582a024 . Change-Id: I0c876630b0b722870a141922f0bd5211ee46b5f4 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Update plugins.qmltypesUlf Hermann2016-09-275-9/+9
| | | | | | | | | | | | | | | Also, have the extended state machine type follow the usual naming scheme, and increment the minor version everywhere. Since we don't need to be compatible with 5.7 we don't need to drag the 5.7 version around at all. In addition, we also don't need to namespace QtScxml in any QML context and, using the additional type information, we can easily constrain the types of all state machiens in QML. The fromFile() and fromData() methods don't have to be Q_INVOKABLE and that just confuses qmlplugindump, do drop Q_INVOKABLE there. Change-Id: I7bd3f10ac458d64fcb98caece770b5d4c61abdb5 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Doc: fix code snippet in Mediaplayer QML Dynamic ExampleLeena Miettinen2016-09-271-1/+1
| | | | | | | Apparently, the example code has changed. Change-Id: I69cd7da627a4ac3a3ac41435dd0aeedb1eb0a009 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Doc: Add docs for FTP Client exampleLeena Miettinen2016-09-262-0/+144
| | | | | Change-Id: Ifa1a02d0a36951dec7a956fe3cd2840dc55c8c28 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Replace Q_FOREACH/foreach with ranged-forErik Verbruggen2016-09-251-1/+2
| | | | | Change-Id: I7b4d13a49577a7d984727722ff2ae4458eab2d6e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add a simple FTP client exampleUlf Hermann2016-09-238-0/+629
| | | | | | | With the provided FTP client you can fetch text files via anonymous FTP. Change-Id: I622264d72aac71492bf474dc1936917fdc78d499 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Doc: Fix the snippets in Traffic Light QML example docsLeena Miettinen2016-09-082-8/+6
| | | | | Change-Id: I8ddb470e61c5a19b8bd673d2b8e8d920e1f47efd Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
* Rename StateMachineLoader.filename to "source"Ulf Hermann2016-09-064-4/+4
| | | | | | | | | It's a URL, so it shouldn't be called filename. Otherwise people will try to use it with plain filenames, omitting the qrc:// or file:// prefix. Change-Id: I01be8515ba03c58c0dd1fce6b0e1e5fa413b9839 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Example: Final cleanup of trafficlightsThomas Hartmann2016-09-022-24/+3
| | | | | | | | | * The color for Window is not visible * The MouseArea to quit the application is not required * Removing unused alias properties Change-Id: Id7647e1a588581f238b2554b0c9d1c955757acdd Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Examples: Using when in statesThomas Hartmann2016-09-022-13/+11
| | | | | | | | We have to make the state machine available in the ui file, but now the syntax is declarative. Change-Id: I67fafa05c6c43eeb11d0788fc6ece66c3f853f95 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Examples: Use a proper type for the stateMachine propertyThomas Hartmann2016-09-022-1/+11
| | | | | | | | This is required to get auto completion working in TrafficLight.qml. (At least for the static case) Change-Id: I9fd3ca64ff92b62cb30e0c66eab20c60995ff911 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Examples: Use QML states for trafficlightsThomas Hartmann2016-09-022-3/+53
| | | | | | | | | | | | | | This allows checking the traffic ui states in the designer and makes the redGoingGreen explicit also in the ui. While this is more code for the states I think this is nice pattern to improve maintainabilty. The button.source property shows that QML states are not required and that properties can directly use the state machine. Change-Id: I38d74f8320e27bf1bc5e8125395d907fafa44723 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Examples: Use .ui file for trafficlightThomas Hartmann2016-09-024-40/+112
| | | | | | | | This decouples the logic/implementation from the declarative ui definition. Change-Id: I039b754df2b9ca86279fe8e9fb9bba23e9c49bf6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Examples: minor cleanupThomas Hartmann2016-09-021-19/+19
| | | | | | | | * Use Column to simplify layout * Changing opacity instead of visible Change-Id: I6468f25a1a4e0c55eb20645147c2a422dd0f2f52 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* TrafficLight example: Use relative image file names in .qml examplesAlessandro Portale2016-09-011-5/+5
| | | | | | | | | It is not just better practice to reduce the absolute source file names to a minimum, but in this case it also enables the Qt Quick Designer to properly display the scene. Change-Id: I0be935584687c5f5099619ffe9c0e356d0b4d56b Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Replace runningSubStateMachines() with invokableServices()Ulf Hermann2016-08-301-3/+4
| | | | | | | | | | | SCXML allows for different kinds of services, not only other state machines. We might add support for them in the future. From invoked state machines you can always get the actual state machine via the respective property. To make this easily accessible, we make the invoked services QObjects. Change-Id: Idd07783730bc98bded404dc2c2c3bd241180c1f4 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Small corrections to examplesJarek Kobus2016-08-266-32/+23
| | | | | | | | Fix docs accordingly. Change-Id: Ib008cc841f7533ff7f32ae134dfd4f6a8b36df15 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Provide a simplified traffic light exampleUlf Hermann2016-08-258-0/+328
| | | | | | | | | | | | The traffic light QML examples are very large for the simple task they perform. Of course we want nicely designed examples that follow all the patterns we recommend for writing QML. However, we also want to show the simplest way to bind states to QML properties. This is why we need a simplified example in addition to the others. Change-Id: I37022db162353c9bac4bfd775571d4afb666b357 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Remove unneeded includesJarek Kobus2016-08-231-1/+0
| | | | | Change-Id: I1c8388b6a912f631affe8bd3752e20bdc8d5eb28 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Get rid of qt modeJarek Kobus2016-08-2322-84/+102
| | | | | Change-Id: Id8cc29a9a27f571f063b1cec51e534a3c762f2c6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Expose sub state machines through a QVariantMapUlf Hermann2016-08-181-1/+8
| | | | | | | | | We define a separate SubStateMachines component with a "children" property that provides the parent state machine's children indexed by name. Change-Id: Ic30ca8fadee6bd608e61307b2ca32474effe580f Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Add a QML default property for QScxmlStateMachineUlf Hermann2016-08-181-1/+1
| | | | | | | | | The extension object will be injected into any state machine constructed from QML. This way child QML objects can be added to a state machine without explicitly declaring properties. Change-Id: If8ec048137cbfb88c3317dee6f626a1cb74248dc Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Remove misleading qt:signal declarationsUlf Hermann2016-08-092-2/+2
| | | | | | | If the document isn't parsed in Qt mode they have no effect. Change-Id: I3c58380b903f33cffc9958e18b009abf9ca5e7d3 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Doc: Remove references to the load option from example docsLeena Miettinen2016-07-263-16/+9
| | | | | | | The Qt SCXML Compiler is now run automatically. Change-Id: Iefa55bd3b915cbce5733f85badaf06ee1b48cb40 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Doc: Update Calculator example docs after API changesLeena Miettinen2016-07-262-10/+14
| | | | | | | | | | - The load option was removed from the pro file. - eventOccurred was replaced with connectToEvent. - Added a code snippet that shows the DISPLAY.UPDATE event in the SCXML file. Change-Id: I41d29657f734a342393fcc25f83ca1e22514d53e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* 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>