summaryrefslogtreecommitdiffstats
path: root/src/scxml/qscxmlcompiler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* qtscxml: Error out when no script content givenSemih Yavuz2023-11-071-0/+3
| | | | | | | | | | | | | | | Standard says https://www.w3.org/TR/scxml/#script that there should be either src or some content in the script tag. Compiling should fail with non-conformant .scxml files. Adjust the number of the errors in a few test because of newly added error. Pick-to: 5.15 6.5 6.6 Fixes: QTBUG-118050 Change-Id: Ib72f7cca53e427a5a83a6aaa3a8a197818e8693f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-10/+10
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I4b4548c9d4a13337731159c1e1184e48bb0a328b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Port from container::count() and length() to size()Marc Mutz2022-10-071-7/+7
| | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8: auto QtContainerClass = anyOf( expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o), expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o)); makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container', with the extended set of container classes recognized. Change-Id: Iaf46b2ba54f3b125aee087c2cacb702d8d564201 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-141-38/+2
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: Ic435d3a484be01542f27431068419a2c252bd1f6 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Include missing headersMarc Mutz2022-04-071-0/+2
| | | | | | | | These are no longer transitively included by e.g. qvariant.h. Pick-to: 6.3 6.2 Change-Id: I9018994ec2b1460d59f9602d81a2719a425879bb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Adapt to changed return type for toDynamicMetaObject()Ulf Hermann2021-10-081-1/+1
| | | | | Change-Id: Iebc5ff6b7a8a0966119149b3d7a6d0e6ce564bc3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Mark dynamic state machines' metaobjects as fully dynamicUlf Hermann2021-01-281-5/+27
| | | | | | | | | | | | | | | | | The memory is allocated using malloc() and will be free()'d eventually. Client code cannot expect to keep string data from those metaobjects around. The QML engine will avoid the creation of property caches (which hold string data from the metaobject) if the metaobject is fully dynamic. Therefore, just create a QAbstractDynamicMetaObject that wraps the original metaobject and pass that to QObjectPrivate in order to signal the fully dynamic nature of the metaobject to QML. Fixes: QTBUG-89521 Pick-to: 5.15 Change-Id: I349dcb689be5674679237a551ed8595bd6b5b672 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix deprecation warnings and developer buildFriedemann Kleint2021-01-281-4/+4
| | | | | | | | | - Fix deprecation of QScopedPointer::take() by using std::unique_ptr - Mark QScxmlStateMachinePlugin::registerTypes() as override Task-number: QTBUG-89832 Change-Id: I8d18b87e56d2f1fe26822559172a6c4129faf97e Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi>
* Fix a set of compilation errors against Qt6Juha Vuolle2021-01-211-1/+1
| | | | | | | | | | | | | | | | | | | | Fixes include -qmllistproperty uses qsizetype instead of int -implicit constructor calls that Qt6 marks as explicit -QEnableIf removed => std::enable_if -Replace the removed QCoreApplicationPrivate::cloneEvent() -Conflicting forward declaration for QStringList (comes via qglobal.h) N.B. after this task the generated (by generator.cpp) code won’t still compile, and it likely requires more in-depth study how to fix it => looks like they relate to the Qt6 property system changes. By temporarily disabling the violating generated code all unit tests pass though => needs a followup task to analyze and fix. Task-number: QTBUG-89832 Change-Id: I9f7d1cd5898b549f243a7df464ca124d29074c46 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Qt6: Port QtScxml to QStringViewKarsten Heimrich2020-07-011-15/+15
| | | | | | Task-number: QTBUG-84319 Change-Id: Ibb3af127a50adba9345540ea39c1c8cc17b72d06 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Add ; to Q_UNUSEDLars Schmertmann2020-06-301-1/+1
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I1a30d0d7b3e67588aab45ea326ed3e4be25c0766 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use QList instead of QVectorJarek Kobus2020-06-261-16/+16
| | | | | | Task-number: QTBUG-84469 Change-Id: Ibaf2524e49e75ec660889261347eddbae9ccdbc6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use Qt::SplitBehavior in preference to QString::SplitBehaviorEdward Welbourne2020-03-021-6/+6
| | | | | | | | The Qt version was added in 5.14 "for use as eventual replacement for QString::SplitBehavior." Move another step closer to that goal. Change-Id: I022d0c59b1fce62378a89c8f4087aaf99d3aac8c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix warnings about fall throughFriedemann Kleint2019-05-271-2/+2
| | | | | | | | | Use Q_FALLTHROUGH, fixing: ../../src/scxml/qscxmlcompiler.cpp:1591:9: warning: this statement may fall through [-Wimplicit-fallthrough=] ../../src/scxml/qscxmlcompiler.cpp:1610:9: warning: this statement may fall through [-Wimplicit-fallthrough=] Change-Id: I39fb346f1c5fa3e328ee82aa14675557034439c9 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Make the ECMAScript model a configurable featureSimon Hausmann2018-06-281-1/+0
| | | | | | | | Introducing this feature allows our users to slim down the module. Task-number: QTBUG-61960 Change-Id: I94215fd3c6dee9766a5f7479bec0440cdfe85ac1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devv5.11.0-alpha1Liang Qi2018-02-011-2/+0
|\ | | | | | | | | | | | | | | Conflicts: .qmake.conf src/scxml/qscxmlcompiler.cpp Change-Id: Ie338e2c6a09e2d885d5f57a80abd386065ac8bc8
| * Remove unnecessary Q_OBJECT_CHECK macroThiago Macieira2017-11-221-2/+0
| | | | | | | | | | | | | | It isn't used by qobject_cast anymore since Qt 5.2. Change-Id: I15b62e0f9cec482fbb40fffd1490dbadff4c5e2a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-201-2/+7
|\| | | | | | | | | | | | | Conflicts: src/scxml/qscxmlcompiler.cpp Change-Id: I4abda984e523cdf2a0810ed7dc1773e055746e18
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-11-151-3/+8
| |\ | | | | | | | | | Change-Id: Id4d40ec35ed8f13c7704d737312205f334139129
| | * Output a better warning when runtime-loading malformed SCXMLUlf Hermann2017-11-101-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | The document might technically have a root element. We might not be able to read it, though. Also, output all errors without quotes. Change-Id: I8133e322e452ea0c3d079b5cbe23aed2f2952b3e Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | | Replace Q_NULLPTR with nullptrKevin Funk2017-09-271-17/+17
| | | | | | | | | | | | | | | Change-Id: I6bee476e2f467b57ee8e4bba1e780cf79c7a460e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Replace Q_DECL_FINAL with finalKevin Funk2017-09-221-1/+1
| | | | | | | | | | | | | | | Change-Id: I074b69d728dfb597f4eb68cf516a2591658303ba Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Replace Q_DECL_OVERRIDE with overrideKevin Funk2017-09-211-15/+15
|/ / | | | | | | | | Change-Id: I68e08fd214ad3dbf4de9c9e23b1725950925c1fb Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* / Cleanup JS includes, remove unneeded codev5.10.0-beta3v5.10.0-beta2v5.10.0-beta1v5.10.0-alpha1Jarek Kobus2017-08-181-2/+0
|/ | | | | Change-Id: Ic24fed82ecd57cfee91372915b61e43c2a2dca22 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Reformat include statements in accordance with coding conventionsUlf Hermann2017-02-081-13/+7
| | | | | | | | | Also, drop the QStateMachine includes. We certainly don't need them anymore. Change-Id: I1fe99162c68668858024516f937ee66ca6eff0bc Task-number: QTBUG-58658 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Reduce the public API exposed in qscxmlinvokableservice.hUlf Hermann2016-11-291-8/+14
| | | | | | | | | | | | | | | | | We inline QScxmlInvokableService::finalize into the only place where it is used. Furthermore we construct static SCXML state machines through their metaobjects rather than directly calling the constructor. This way we can drop the template, make all the service factories QObjects, drop the intermediate QScxmlScxmlServiceFactory class, and greatly reduce the API exposed in qscxmlinvokableservice.h. In addition, as some of the structs in QScxmlExecutableContent are fairly large, we return them as const references, rather than by value. Change-Id: Ia9ee61b5668b8af44307787339c08f3c6f23f713 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Further clean up qscxmlinvokableservice.hv5.8.0-beta1Ulf Hermann2016-10-271-28/+8
| | | | | | | | We can group the various parameters passed around between the factories into a struct and we can move some methods into the private interface. Change-Id: I579ced7d501bdb617d4aefd47ced49746c9a5b94 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Rename QScxmlParser to QScxmlCompilerUlf Hermann2016-10-141-0/+2505
It creates an executable representation from an XML description, so it is a compiler and not merely a parser. The name should reflect this. Change-Id: I459445706207b3afae64b3f803c9beae83114bb6 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>