aboutsummaryrefslogtreecommitdiffstats
path: root/src/tools/ivigenerator/templates_frontend
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.12' into 5.13Dominik Holland2019-12-172-29/+30
|\ | | | | | | Change-Id: I9a2ff22058e273be9334d9ca5a4b86ece7d9626b
| * Fix creation of structs from simulationDataDominik Holland2019-12-092-29/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to a change in QtCore, it is not possible to call QMetaObject::newInstance() on Q_GADGETS anymore. Because of this, creating qface based structs from simulationData resulted in the error: QMetaObject::newInstance: type Contact does not inherit QObject This commit changes the way how the structs are created and is using QMetaType::create() instead and instead of using a constructor taking a QVariant, it invokes a private fromJSON() function, which now gets generated instead of the QVariant constructor. Fixes: AUTOSUITE-1374 Change-Id: Ibef59fcc0a209de3d98f055eaed4e4c04521575f Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* | Replace usage of the QObject keywords with their respective macrosAndy Shaw2019-09-171-11/+11
| | | | | | | | | | | | | | | | | | By using Q_EMIT, Q_SIGNALS and so on, then this ensures that the generated code will work with no_keywords set for a project in a pro file. Change-Id: Id53e2219ac215e5b6bef99f835b2ffd42a59ab4e Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
* | Protect against unused variable warnings when no properties are addedAndy Shaw2019-09-061-2/+6
| | | | | | | | | | Change-Id: Ie41f7d15bdcc3c2bdcf7de299063d016186bd3a1 Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
* | ivigenerator: Support enums and flags as return values of operationsDominik Holland2019-08-281-1/+1
| | | | | | | | | | | | | | | | | | Also add a generation test, as well as as testing the functionality using QtRO. Change-Id: I9a26ca595fdb9e8522fd3cc01d0b7337e86a1dad Fixes: AUTOSUITE-1190 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* | Correctly emit change signals when clearing the ServiceObjectDominik Holland2019-06-111-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | When the serviceObject of a feature is set to null, the feature is responsible to reset its state to the default again. This commit will make sure that not just the state is fixed, but also reflected to the outside by emitting the change signals. Task-number: AUTOSUITE-1000 Change-Id: I4bc696f0179975a2d719ad420718b574010f5a5e Reviewed-by: Kavindra Palaraja <kpalaraja@luxoft.com> Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* | ivigenerator: Only register a flag to int converter if neededDominik Holland2019-05-271-1/+2
| | | | | | | | | | | | | | The user will see warnings otherwise. Change-Id: I3c4c2d67f64e3390f16fdc86a6c4a02af0ddf1f0 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* | Use the same qface test file also for the QtRemotObject based autotestsDominik Holland2019-05-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | This makes sure our templates support all tested types and generates code which works as expected. This already showed a problem when serializing a QFlag property (QTBUG-75676), which gets fixed by registering a conversion function for our flags in the autogenerated code. Change-Id: I48e4c0a3ca5f98bdc45f3d7d6b83d88c1ae56c2c Fixes: AUTOSUITE-794 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* | Don't use the deprecated qVariantFromValue functionDominik Holland2019-05-091-2/+2
| | | | | | | | | | | | | | Replaced by QVariant::fromValue(). Change-Id: Ief2497fd3080ea618541d1061c7ec85d057cfd34 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* | ivigenerator: Specify all common templates with the 'common/' prefixDominik Holland2019-04-0412-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | This makes sure that we load the template file from the 'common' folder and don't load a template file with the same name in the current template folder by accident. This might happen when templates get moved and new QtIvi installations are installed over an old one without using 'make uninstall' Change-Id: I73cf165b03efb2d217aded4049ffb6497ba1046f Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* | ivigenerator: Fix the streaming operator for enums and flagsDominik Holland2019-02-272-5/+15
| | | | | | | | | | | | | | | | | | | | The streaming operator for flags didn't really work as it only accepted one specific enum value, but not a combination. Instead of checking the value, we now use the flags constructor as we cannot verify the whether the flag is valid. Change-Id: Ia4ee9373f3657954357d4b7f34e7e5e749483e17 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* | ivigenerator: Add the generation of a qmltypes for the simulation APIDominik Holland2019-02-152-141/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to the frontend QML API, this adds the generation of a qmltypes file for the simulation API, which can be used in the simulation engine. Because QtCreator cannot handle the same import uris in different folder we always need to generate the frontend qmltypes together with the simulation qmltypes in one combined folder structure. For now the qmltypes are moved into the common folder and generated in the frontend and the backend_simulator template to make it easier to include them. Later the same files can be used for the qml_plugin generator. Task-number: AUTOSUITE-743 Change-Id: I49aecf4d158fc46dbc1eac80c707194440c5763f Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* | ivigenerator: Don't hardcode the QML module versionDominik Holland2019-02-153-4/+4
| | | | | | | | | | | | | | Instead use the module version from the qface file Change-Id: I99f8e571b63149871c5164a4eea90291ce4f4f90 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* | Use the new autogenerated qmltypes in our examplesDominik Holland2019-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of registering the QML types with a custom uri, we now just use the default argument of the type registration and by that make sure that the types are registered with the same uri which was used in the qface file and the same which is used by the autogenerated qml types. Adding the QML_IMPORT_PATH to our autogenerated qmltypes makes sure QtCreator knows the type and can provide a code-completion Change-Id: Ifd4ce8ec32da240ccf0070b737fd02c17f8fe2dc Fixes: AUTOSUITE-743 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* | ivigenerator: Autogenerate the qmltypes files for code-completionDominik Holland2019-02-152-0/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If the generated QML code is used inside QML without using a plugin (e.g. in our examples), QtCreator cannot provide a code- completion for the QML types and also marks the import as an unknown module. To fix this we now generate a qmltypes files as part of the frontend module. This file can be used to provide code-completion information to QtCreator without the need to have a plugin. Fixes: AUTOSUITE-743 Change-Id: Ic40a1aa48a0db3a3f504daede139032d52d8b782 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* | Fix old style cast in the autogenerated frontend codeDominik Holland2019-02-111-1/+1
| | | | | | | | | | Change-Id: Idd88bf369f8def14e9706e881303286e9c6d22b9 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* | ivigenerator: Generate documentation for the QML module singletonDominik Holland2019-02-115-6/+129
| | | | | | | | | | | | | | | | | | | | | | This includes the generation of a module_qml_enum.qdocinc file which contains the QML documentation of the enum. The qdoc include command is used in all functions and properties where the enum is used. Fixes: AUTOSUITE-741 Change-Id: I095147acd20910c8d7d5b85d95bee6c6e4bd3dd3 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* | ivigenerator: Make use of the qml_type filter also for modulesDominik Holland2019-02-112-4/+3
|/ | | | | | | | | | | | | | | | The qml_type tries to read both annotations now, qml_name and qml_type For modules the filter returns the module_name or the new name from the annotation. As before this can be used to register all types under a specific QML uri. The last section of the uri is now also used as the QML name for the module singleton holding all enums and factory functions. E.g. a module named "com.example.climate" will now make all its enums available from the "Climate" object (Climate.AutoRecirculation) Change-Id: I6481a34876d6c47bd8f34c946c7638e34cc857f1 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* Show a meaningful error message debug and release libraries mixedDominik Holland2019-01-111-2/+2
| | | | | | | | | | | | | | On mac it can easily happen that debug and release libraries are mixed when building an application. E.g. using one of the qface examples. In general qtivicore tries to load the correct plugin version if available, but if the wrong one was loaded or the appropriate one was not available it can happen that plugin interfaces can't be casted to the correct types and thus the class doesn't work. When this happens a more descriptive error message is now shown and the backend is not used. Change-Id: I4ae63ac87509ec3feb1ae65750d8e0ee71ad6520 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* Fix code style issues in the autogenerated codeDominik Holland2019-01-106-10/+16
| | | | | Change-Id: I27646c536069820c3fa952d1f34b9461fe63c356 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* Update copyright statementsRobert Griebl2018-12-179-0/+9
| | | | | | | | - added 2019 - everything is (c) Luxoft instead of Pelagicore from now on Change-Id: I4a6dbd46aaffbb90cea57626bd75e3972cea2cfc Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
* Clang-tidy and Clazy fixesDominik Holland2018-12-054-8/+9
| | | | | Change-Id: Id88db48e0e18761a9bc1b1014628bf0099c4e5cf Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* Rename and document the qtivi_convertFromJSON methodDominik Holland2018-12-041-1/+1
| | | | | Change-Id: I77530cc0cc66589a923c7dae44f9ffc734ac222b Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* Add a way to load and parse the data to the QIviSimulationEngineDominik Holland2018-10-292-3/+31
| | | | | | | | | | | | The new loadSimulationData() function can load a JSON file and store it's content in the IviSimulator singelton. The IviSimulator singleton provides functions to interpret the JSON values and other helpers e.g. checking for min/max/domain values. Task-number: AUTOSUITE-629 Change-Id: I2832cc0b29379144845a8ed295fc2d988273ff0c Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* Update the generator templates to use the new QIviSimulationEngineDominik Holland2018-10-151-1/+1
| | | | | | Task-number: AUTOSUITE-627 Change-Id: I0bd49c420c3b60ba70a67f509cb819d9c116d599 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* Merge remote-tracking branch 'origin/5.11' into devDominik Holland2018-09-276-6/+6
|\ | | | | | | Change-Id: If48055bb577b4b59a836b2c4a00d940401b97c6a
| * Use the full module uri for the class export macroDominik Holland2018-06-087-7/+7
| | | | | | | | | | | | | | | | | | Using the full uri makes it more unlikely that the export macro names clash with the export macro of an library with the same name. Task-number: AUTOSUITE-509 Change-Id: If5d66f7dc4d7e3e8edc4cbede1d2dfcbaad3b1d7 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* | Refactor the backend() method in the autogenerated interface classesDominik Holland2018-09-252-9/+15
| | | | | | | | | | | | | | | | | | | | | | Previously we used some old-style casts. These has been replaced by reinterpret_casts. To get rid of some more casts which where all over the place, a new backend() function is now generated which does the cast to the interface class only once. Change-Id: Idf3deecbeda753f6fe61ec023044f1a096aa4736 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* | Fix missing override warnings in autogenerated codeDominik Holland2018-09-251-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | As all autogenerated structs derive from QIviStandardItem which defines already some properties, setting these properties in a qface file will result in properties which are overridden. This change makes sure that the override keyword is added to the functions when needed. Change-Id: I8b3706f67ab7aa10155c23bf04482e60a75daeb4 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* | Fix qdoc errors and some broken linksDominik Holland2018-09-141-1/+2
| | | | | | | | | | Change-Id: Ibc5b81bc622c871884d3c7ab5fac467deabe0340 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* | Remove the need for some annotationsDominik Holland2018-07-232-2/+2
| | | | | | | | | | | | | | | | | | The intention is to have a sane default for all needed annotations and only use the annotation when the default is not good enough or details like the QML type name or the backend iid should be fixed. Change-Id: I73745b296c7d4227d79034ce4da31b0fff9cd4f8 Reviewed-by: Antti Hölttä <ahoelttae@luxoft.com>
* | Use the new QIviPagingModel for the model type in qface filesDominik Holland2018-07-1611-427/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This extends the templates to return a QIviPagingModel for all model types and also generate the backend interface for all the models in the backend_simulator template. The test template is extended to also generate a test for the model where an item is fetched from the frontend and the data provided by the backend. Task-number: AUTOSUITE-421 Change-Id: I1eb26ddcf6d448559221925dd69701e137e5f8a0 Reviewed-by: Antti Hölttä <ahoelttae@luxoft.com>
* | Rewrite the autogenerated structs to use QIviStandardItemDominik Holland2018-07-092-15/+70
|/ | | | | | | | | | | | Using QIviStandardItem as a base class helps to make all the autogenerated structs usable within QIviPagingModel and all derived classes. In addition changed the autogenerated code to use QSharedData to use COW and implicit sharing. Task-number: AUTOSUITE-584 Change-Id: I45c8932046d36776091459c333b29d33acffc2e0 Reviewed-by: Antti Hölttä <ahoelttae@luxoft.com>
* ivigenerator: Fix the compilation errors introducec by the last commitDominik Holland2018-05-161-1/+1
| | | | | | | | | | | | | The control_panel template cannot use the 'operation' macro yet, as it cannot provide any return value at the moment. This commit will revert this part to the original version. In structs the Q_PROPERTY macro cannot have a change signal, because of that a new notify parameter is added to the 'property' macro and the is set to false when used inside the struct.*.tpl Change-Id: Ic4c74d92c5e8e978e993ad937d86267118110883 Reviewed-by: Antti Hölttä <ahoelttae@luxoft.com>
* Update the ivigenerator templates to use macrosAntti Hölttä2018-05-1514-189/+69
| | | | | | | | | Replace repetitive or complex parts of ivigenerator's templates with macros. Add a directory for common code. Also some cleanup. Task-number: QTAUTO-847 Change-Id: I12d7d6c25db14d4ab05583274742aec9e35d2bbf Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
* ivigenerator: Generate correct public headers when building a qt moduleDominik Holland2018-04-125-0/+20
| | | | | | | | | | When building a qt module all public headers need to use the module name in their include statements. This is done by using the QFACE_MODULE_NAME qmake variable, which is now mandatory when generating a qt module from a qface file Change-Id: I31232a48a3c978552a27f1d82f3eacba480427b2 Reviewed-by: Antti Hölttä <ahoelttae@luxoft.com>
* Use the new QIviPendingReply class in the autogenerator templatesDominik Holland2018-03-234-6/+12
| | | | | | | | | | | | | Every method inside a qface file will now return a QIviPendingReply. This also changes the signature of the QIviVehicleFunctions module and its backend implementations. Also updated the window_qml example to make use of the new returned QIviPendingReplies from the open() and close() calls. Task-number: QTAUTO-837 Change-Id: Icf8a31fcd94630254f71b0c4fb2e1ef4296591af Reviewed-by: Antti Hölttä <ahoelttae@luxoft.com>
* Fix backend initialization issuesAntti Hölttä2018-03-211-6/+5
| | | | | | | | | Fix initialization issues in generated backend classes and also in the QIviAbstractFeature class. Add initialization check to the autogenerated test. Add initialization and reconnection tests for remote object features. Change-Id: I5dbb179c612da721676a4b4959d8626a237f479a Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
* Add qtro templates that rely on the qt's replica compilerAntti Hölttä2018-03-091-2/+2
| | | | | | | | | | Add qtro templates that rely on the qt's replica compiler instead of homemade replica and source templates. IVIGenerator generates .rep files that are passed further to the replica compiler. Task-number: QTAUTO-849 Change-Id: I2bc3bb1899386028b9e99ac991f679b56544e3ca Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
* Always generate class names with a uppercase first letter for modulesDominik Holland2018-02-146-12/+12
| | | | | | | | | The module names within qface are most of the time lowercase, which lead to lowercase class names and also registering a lower case QML singelton, which is not allowed. Change-Id: Ie52bf5bf6c564dab9eabc6040859f70be6cd3cb7 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* ivigenerator: Also register all models in the generated module as MetaTypeDominik Holland2018-02-071-0/+4
| | | | | Change-Id: I2088261780e3b322358fcdf7894ab8f1197628c7 Reviewed-by: Antti Hölttä <ahoelttae@luxoft.com>
* ivigenerator: Fix a problem generating signals without argumentsDominik Holland2018-02-062-2/+2
| | | | | | | Also added more signals to the generation autotest Change-Id: Iccbd16741ce8a4ecdbf69b04c0bd0b7357a652c2 Reviewed-by: Antti Hölttä <ahoelttae@luxoft.com>
* doc: Minor fixesDominik Holland2018-01-161-0/+1
| | | | | | | | | | Add a reference to the "Qt Plugin System" documentation and add the "Extending QtIVI" page to the index page. Fix some linking issues Change-Id: Iaaa51c9a6fde177cb5ec2fe69b03344b93f6c2ed Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* Update all Pelagicore copyright headers to 2018Dominik Holland2018-01-1611-11/+11
| | | | | Change-Id: I408c855d9619e20f481a592dc1f514b90af642f9 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* Add fixes that enable the use of struct members in interfacesAntti Hölttä2017-11-244-5/+26
| | | | | | | | | | Add fixes for using structs in interfaces. Previously struct members for interfaces would not work because of missing includes. Add a filter function to the generator that lists structs an interface or a struct are depending on. Extend the echo testcase to use structs in more complex ways. Change-Id: I144903ba487a845d1182f90c4318e1187986a7fd Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
* Add stream serialization functions for generated structs and enums5.10Antti Hölttä2017-11-024-6/+72
| | | | | | | | | Add stream operators and equality-operators for the struct template. Change existing enum stream operators to check values outside of the enums range. These are needed for serializing of types eg. when using generated types over QTRO. Change-Id: I169b3d598b65eaae2de8562507a66ee996b81081 Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
* Fix notifications on property changesMike Krus2017-11-021-2/+2
| | | | | | | | Change signals are now emitted when values are committed to the backend Task-number: QTAUTO-548 Change-Id: If5880e1924b56e22b97017724bcc6cb0c9261844 Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
* Minor doc fixesDominik Holland2017-10-181-0/+1
| | | | | Change-Id: I15ab1a6e6c10275f523d9b28ec3a5668f0e10901 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* ivigenerator: Also connect signals from backend to frontendDominik Holland2017-09-192-0/+35
| | | | | Change-Id: If367eca672f311b73ac4494a9ad9405fcb10f6f1 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Integrate qtsimulator support for the control_panelDominik Holland2017-09-192-0/+22
| | | | | | | | | | | | | | | | | | | | | | The control_panel acts as a server and the backend connects to it. Once a connection is established the control_panel will push it's initial values to the backend and from there all properties and signals are synchronized. Currently only one connection is supported. The qtsimulator support is detected during configure time and based on that the new "simulator" feature is enabled. The ivigenerator now has a configuration file, which is used to define which features it supports. This is used to be able to generate qtsimulator support into the simulation backends only if the qtsimulator is available and the feature is enabled. Task-number: QTAUTO-441 Task-number: QTAUTO-442 Change-Id: I5045d21f92176fed7d9025850b70f4759c9232c2 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>