aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljstypedescriptionreader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Expose getter and setter names of C++ classes in qmltypes filesFabian Kosmale2021-01-291-0/+3
| | | | | | | | | | | 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>
* qmllint: Remove exceptions for most unknown builtinsUlf Hermann2021-01-211-1/+1
| | | | | | | | | | | | All those types are properly defined in the qmltypes files now. We just need to search the enumerations the same way as methods and properties in order to find everything. Also, deduplicate the code that resolves properties, methods, and enums by using a common template for iterating the scopes. Change-Id: I0bf1423974d0ec8f602ecd0342522b3e981a8586 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Support extended typesUlf Hermann2021-01-201-1/+1
| | | | | | | Fixes: QTBUG-90448 Change-Id: I5fb6b3d9223ae95ca7e039c5b9139ed086052c29 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Skip failing testsFabian Kosmale2021-01-201-0/+2
| | | | | | | | And do not choke completely on extended. Task-number: QTBUG-90448 Change-Id: I4ac5742ec70f5ba1ed1403be444d9cc7229830c2 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmltyperegistrar: Expose interface informationMaximilian Goldstein2020-11-231-5/+42
| | | | | Change-Id: Ica3f5c6696542921bc8d399cd46d901ba06f6d83 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QmlCompiler: Store values QQmlJSMetaEnum when availableUlf Hermann2020-11-121-0/+15
| | | | | | | | | | | | | When parsing QML files, we need to keep the enum values around as this is the only place where we can find them (without parsing the same file again, that is). With C++ types we don't strictly need them as they are also available from the C++ header, but if the qmltypes file is nice enough to provide them, we can use them. (Which will be for types that are not actually C++ types, but rather types produced by registering a QML file with qmlRegisterType()). Change-Id: Ibcc93b30e523a00e1eeb80029943c48b83d0e1b5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Allow more convenient access to enums in QQmlJSScopeUlf Hermann2020-11-121-1/+1
| | | | | Change-Id: Ibac4dd7641a89b686bee63cf974b2257a35631a2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Integrate sequences with registration macrosUlf Hermann2020-11-111-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | You get to write QML_SEQUENTIAL_CONTAINER(value_type) now, and qmltyperegistrar will generate a sensible registration call from that. A registration might look like this: struct MyStringListForeign { Q_GADGET QML_ANONYMOUS QML_SEQUENTIAL_CONTAINER(QString) QML_FOREIGN(MyStringList) QML_ADDED_IN_VERSION(3, 1) }; It's unfortunate that we need to use a metaobject to transfer all of this information, but there is no other sensible way. Transform the containers defined in qv4sequenceobject.cpp to use the new style, and move them out of the builtins, into QtQml. Recognize that only one of them was ever tested, and add tests for the rest. Task-number: QTBUG-82443 Change-Id: I3a30f9e27266bb575eea26c5daf5dad1ec461cc5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Make sure that properties are writable by defaultUlf Hermann2020-10-261-0/+1
| | | | | | | Amends commit 7feab1fb95317b924fe39c49dd9907ca3df61a40. Change-Id: I32e22b51501d9c98af74ac00506619cfe33f6b7c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Properly discern between inherited and own namesUlf Hermann2020-10-221-2/+2
| | | | | | | | | | | Previously, we would mix them up on importExportedNames(), which was also misnamed. Now we keep them in their proper place in the scope hierarchy, so that we can identify which scope a property came from. Exceptions are the qmllint-specific treatment of parent properties and Connections elements. Change-Id: I7c012388b16c83439d6f2de2e83fac0da4940d30 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Drop the metaobject revision from exportsUlf Hermann2020-10-191-1/+11
| | | | | | | | | Instead, output a warning if the revision doesn't match the version. We want to get rid of generic version/revision matching. To this end, add a way to retrieve the version from an export. Change-Id: Ie887103eba910f14e49faa684ac559cc72cab199 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Read the "bindable" attribute from plugins.qmltypesUlf Hermann2020-10-161-15/+12
| | | | | | | | | And refactor QQmlJSMetaProperty to use setters rather than a gigantic constructor. Also, notice that we don't have to construct the same property twice just to update its type. Change-Id: Ia6c195fa7088f6ecdff868daae17d4284c1edb22 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Wrap into Qt namespaceUlf Hermann2020-10-051-0/+4
| | | | | | | As a Qt module, QmlCompiler's classes should live in the Qt namespace. Change-Id: I3138812c288979fe7cff316dd9b63213bd6dfd05 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Rename TypeDescriptionReaderUlf Hermann2020-10-051-0/+689
The names should begin with a common prefix. Change-Id: Ibd832ebe7a778c7af8ee3b75253e04491ded28be Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>