aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmltyperegistrar
Commit message (Collapse)AuthorAgeFilesLines
* qmltyperegistrar: Fix handling of default propertiesUlf Hermann2021-02-022-0/+85
| | | | | | | | | Default properties are always local. There is no way to declare a default property for a foreign type as the default property is queried directly from the classinfo at runtime. Change-Id: I30efb6fba190957ac2a4ad86da437f209cd1f3ad Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmltyperegistrar: Do not add extensions to local anonymous typesUlf Hermann2021-02-021-1/+1
| | | | | | | | | If we generate a local anonymous type, then that's the local part of a QML_FOREIGN local/foreign couple. Any QML.Extended in there belong to the foreign type. Change-Id: Ic1706045eff03dd7b1b553240596ffc21818c8bd Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Allow for multiple extensions per objectUlf Hermann2021-02-012-0/+56
| | | | | | | | | | | | | | | | | | | Previously, the assumption was that each object could only have a single extension object. As proven by the new qqmllanguage test this is not the case. Each registered object in the type hierarchy can have its own extension. Therefore, adjust the algorithms that generate qmltypes and iterate the extension objects when analyzing them. This leads us to the realization that anonymous types can in fact meaningfully carry extensions and implement interfaces. Adapt qmltyperegistrar accordingly. For the test to compile, however, we need to realize that the class declaring interfaces needs to befriend all potential subclass's QmlInterface structs. Fix that, too. The rabbit hole went deep. Change-Id: Ia451897e927e03b95c3062e829edf1dfcd216613 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Expose getter and setter names of C++ classes in qmltypes filesFabian Kosmale2021-01-292-2/+9
| | | | | | | | | | | This simply exports the name which are already available in the json files generated by moc. We do not consider whether the methods are non-private for now. MEMBER is not supported either, but might be added if the need actually arises. Fixes: QTBUG-90711 Change-Id: If3ee18c8ce60499676a7ee22df569cba0912e22f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmltyperegistrar: Make sure we have metatypes for all QML typesUlf Hermann2021-01-255-0/+150
| | | | | | | | | | We need to be able to resolve any QML type from its C++ name using QMetaType::fromName(). qmltyperegistrar can generate the missing metatypes, either by creating synthetic ones (for namespaces), or by making sure the existing ones are registered (for others). Change-Id: If775af56d891f2c2a5bb94589b3cb05a199c7c35 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add support for extended types to qmltyperegistrarUlf Hermann2021-01-182-2/+4
| | | | | | | | | | | | | | | We generate the extensions as separate types. This also covers the case of value types being extended by "themselves". We can properly express this now, so we don't need the hackery of generating the local members of a type with QML_FOREIGN into the foreign type anymore. This also fixes interfaces from local types being written for foreign types. Fixes: QTBUG-89501 Change-Id: Ic76acd7eef09a92c1e36bd7a649c7a2deb24597b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove the qmake project filesFabian Kosmale2021-01-153-35/+0
| | | | | | | | | Remove all qmake project files, except for examples which are used to test that qmake continues to work. Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* CMake: Regenerate projects using pro2cmake one last timeAlexandru Croitor2020-12-102-1/+4
| | | | | | | | | And fix up some incorrect qmake project files Pick-to: 6.0 Change-Id: Ia6d27ac68195635021fe7c4a5f06386a60f3f323 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Support namespaced QML_ELEMENTMaximilian Goldstein2020-12-102-1/+17
| | | | | | | Fixes: QTBUG-87266 Change-Id: Iad8c7765b339c5498f541702bbf7df64164f5358 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmltyperegistrar: Expose interface informationMaximilian Goldstein2020-11-232-0/+30
| | | | | Change-Id: Ica3f5c6696542921bc8d399cd46d901ba06f6d83 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmltyperegistrar: Use QString rather than string for stringsUlf Hermann2020-11-121-1/+1
| | | | | | | | All other type names are actual C++ type names. Also, correctly resolve qreal if its type is overridden at configure time. Change-Id: Ia2a1b4309f94e8c72461ee69005b1bdee6337370 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove debug usage of QT_FORCE_ASSERTSAlexandru Croitor2020-11-101-2/+0
| | | | | | | Amends a4d956048b4679bf5b448340d1f3428793699990 Change-Id: I9a44b6e800114968cb5e783282d439697b0a65a9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmltyperegistrar: Add past-major-version optionMaximilian Goldstein2020-11-105-0/+19
| | | | | | | | Adds the option to specify past major versions of modules to be registered. This is necessary for modules that don't export any types themselves to work when built statically. Change-Id: I4b4a379f92707ec64cbb32f91db9d010440b95a2 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
* CMake: Adjust to public API renaming in qtbaseAlexandru Croitor2020-10-181-1/+1
| | | | | | Task-number: QTBUG-86827 Change-Id: Ibeae878cbd7cc43031aeb13b2c480215c849f8bc Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-10-064-4/+4
| | | | | | | | Modify special case locations to use the new API as well. Task-number: QTBUG-86815 Change-Id: I3b964e3baf0cc7040830156dac30358ea1152801 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Adjust to qtbase changesFabian Kosmale2020-09-042-6/+9
| | | | | | | | | | | | | - isQProperty has been renamed to bindable - QNotifiedProperty is no more - Bindable properties have a function to obtain the QBindable; store that information in the qmltypes files. Task-number: QTBUG-86434 Task-number: QTBUG-86435 Change-Id: I2ba593af1e197d04d2c30cfb9e6904a3d2059e4b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Restrict qmlRegisterTypesAndRevisions to major version givenUlf Hermann2020-07-162-0/+34
| | | | | | | | | | | We should not register any revisions larger than the given major version as that allows importing an incomplete module, as the version-less import. Typically the offending version is pulled in via some QML_FOREIGN and only the types derived from that foreign class are available in the higher major version. Change-Id: I186fb010d704bea514cefff9f66eb58186df5c91 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Regenerate projectsAlexandru Croitor2020-07-092-2/+38
| | | | | | | | | We need the qt_add_tool changes to successfully configure qemu builds. The rest of the changes are just to be in sync with the .pro files. Change-Id: I7bcc08ac58f57a5761aedef09761428c55235289 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Use qt_enable_autogen_tool to explicitly enable AUTOMOCMÃ¥rten Nordheim2020-06-242-1/+22
| | | | | | | | Otherwise it will depend on the moc executable existing already during configuration/generation. Change-Id: I9b3f0ef42ba6ecf5eeb59e92fd6dad553c5c47af Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Port type registrar test to cmakeFabian Kosmale2020-06-143-0/+67
| | | | | | | | | | | Unfortunately, the type registrar simply does not work with manually moced files, and headers without any extension are not picked up by automoc. Task-number: QTBUG-84869 Task-number: QTBUG-84906 Change-Id: If1adbb9bfb3f793f3ee90f5b27cece233e354443 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmltyperegistrar: Preserve isQProperty flag from metatypesUlf Hermann2020-05-282-2/+12
| | | | | | | Task-number: QTBUG-76025 Change-Id: I952afdad6410c3f7ccb05b6c3de77020b30f78d3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
* Preserve access semantics in qmltypesUlf Hermann2020-05-182-0/+7
| | | | | | | | gadget types are accessed with value semantics, object types are accessed with reference semantics, and namespaces are not accessed. Change-Id: I5eb8f132d729416f28bf94e651f877fc4a9a5c77 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmltyperegistrar: Correctly handle foreign and super classesUlf Hermann2020-04-163-0/+47
| | | | | | | | | | | Previously, if there were multiple super classes, revisions were only collected for the first one. Also, properties and enums declared in the type itself were ignored when QML.Foreign was specified. Finally, we would previously re-set resolvedClass and re-sort the revisions on each super and attached type. Change-Id: Iccb939cae66a5c4e2e5c312359e389463df80b4e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmltyperegistrar: Retain alias and isFlag information for enumsUlf Hermann2020-04-092-0/+17
| | | | | | Change-Id: Id484c7bb1a3ed3b2bf593f6197664e4ee2ad4006 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* qmltyperegistrar: Record header file names in qmltypes filesUlf Hermann2020-03-302-0/+8
| | | | | | | We will need them to find the types in C++ code. Change-Id: Id00c6d855adbb767a0be8a9469fbe47447ccec8b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* qmltyperegistrar: Accept more file extensions as headersUlf Hermann2020-03-305-3/+152
| | | | | | | | Also, even if the file does not appear to be a header, still try to include it. People use strange file names. Change-Id: I2db7bd6aa14007a8b458c3860ba0553bb3b384b7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmltyperegistrar: Accept extra foreign types filesUlf Hermann2020-03-267-0/+217
If you add your own libraries with metatypes, qmake cannot determine where to look for their metatypes.json files. Add a qmake variable that allows the user to specify them. Fixes: QTBUG-82709 Change-Id: I3f5685146c134c89e541e4097ff3928de9af2aee Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>