aboutsummaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* QmlCompiler: Rename QmlJSImporterUlf Hermann2020-10-052-6/+6
| | | | | | | Add an extra 'Q' for consistency. Change-Id: Idd34e0c898c9a7ac70b1ec3856a8af6829ec6fb7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Rename QmlStreamWriterUlf Hermann2020-10-054-8/+8
| | | | | | | The names should start with a common prefix. Change-Id: Ib2cc247d459d78de5f0a8ea0be73b89429154475 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Rename ResourceFileMapperUlf Hermann2020-10-052-5/+5
| | | | | | | The file class names should start with a common prefix. Change-Id: I5e014c103668a1bc73d359b00a1dda33e5637a79 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Rename ImportedMembersVisitorUlf Hermann2020-10-051-1/+0
| | | | | | | The class names should start with a common prefix. Change-Id: I645ef476f8493d38c2f4c5241d4a2903543f09e8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Rename metatypes_p.hUlf Hermann2020-10-053-11/+11
| | | | | | | Those are specific to QML/JS. Change-Id: I45a5d4eb6c53bd5ca4026e042af83c4afaa4953c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Rename ScopeTree to QQmlJSScopeUlf Hermann2020-10-054-34/+34
| | | | | | | That is a better name. Change-Id: I34a6867692a236dd16ed8e3a68866f994eab02d2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Long live libQtQmlCompiler!Ulf Hermann2020-10-0534-2807/+33
| | | | | | | | Move all the code from tools/shared into src/qmlcompiler and build a static library from it so that we can re-use it in external tools. Change-Id: I7c8d8e59063dc7c711f4072f103a01095e6f5997 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Remove member access chains from ScopeTreeUlf Hermann2020-10-026-40/+28
| | | | | | | | | What we need there is a proper type inference. This should be added separately. For now, keep the member access chains local in qmllint and don't pollute ScopeTree with them. Change-Id: I9f50aa4e54b285bd93e7bd4cd17797509df0c168 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Remove ScopeTree::m_unmatchedSignalHandlersUlf Hermann2020-10-025-37/+23
| | | | | | | | Rather, immediately output the warnings when we encounter them. Change-Id: I4bd1a5491a47cb0232bfdd4e325f8f122593aa39 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Unify injected and "normal" JavaScript identifiersUlf Hermann2020-10-026-87/+142
| | | | | | | | The specifics of how to warn about the injected identifiers are moved out of ScopeTree as that is not related to the structure of the scopes. Change-Id: I26418c3fa492da8339abf045a4034a8464b7bbb8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Remove ComponentVersionUlf Hermann2020-10-0210-166/+28
| | | | | | | QTypeRevision does all we need there. Change-Id: Ib27ae2d58167a7a45fac31262a45e387d047af89 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Remove ScopeTree::isVisualRootScope()Ulf Hermann2020-10-023-16/+8
| | | | | | | | This is not a property of the ScopeTree itself, but rather a property of how qmllint sets up its scopes. Change-Id: Ifb7c0f1f841046a6ae68e246fbd706f67bedb2af Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Remove C++ types from the importer interfaceUlf Hermann2020-10-026-49/+51
| | | | | | | | We don't use them anymore. Now we can also make all the ScopeTrees const again as we don't need to modify them anymore after importing. Change-Id: I3ece767f4f62f06cb0640f1f191eb8d98400717c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Don't use C++ names of QML typesUlf Hermann2020-10-024-42/+27
| | | | | | | | | The C++ names are an implementation detail of the importer, and qmllint has no business messing with them. All the types are supplied as ScopeTree by the importer now. Change-Id: I3ef2b5da1dc19f95c7f2a5d80fa1297ba10bef8f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Remove exportedQmlNames from import resultsUlf Hermann2020-10-024-42/+32
| | | | | | | We don't need to expose them anymore. Change-Id: Ibb25f688459972f718f9a051fbb7265c7e5b5f92 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Uncruftify the importing of base qmltypesUlf Hermann2020-10-025-49/+55
| | | | | | | | | | | | | | builtins.qmltypes are imported separately now. Any other bare qmltypes files without qmldir should be specified explicitly. If none are specified, qmllint looks in the current directory for qmltypes files, not in all possible import paths. This is still somewhat weird, but admittedly it's handy for qmltypes files generated for application binaries. For the same reason, we unconditionally include the current directory in the list of default import paths. Previously this was done if no explicit qmltypes files were specified, which makes little sense. Change-Id: Iaa56f8b40b3ec3045f55928251d7efea5616d23b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tools: Remove QmlJSImporter::m_currentDirUlf Hermann2020-10-023-11/+9
| | | | | | | | It was only used to make paths passed to importFileOrDirectory absolute. We can do that before passing them. Change-Id: I0798d38080596fc6eb314259e81702b81a7743dd Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Move the import handling code out of qmllintUlf Hermann2020-10-029-342/+431
| | | | | | | We want to re-use this logic in other places. Change-Id: I63cbee86a83265ddd241a4fae9ce8c48f38b5f18 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Fix updating of parent propertyUlf Hermann2020-10-023-11/+13
| | | | | | | | | | | We need to check for the baseTypeName, not for the internalName. Also, this is not really the scope's business but a property of how qmllint sets up its scopes. Task-number: QTBUG-87116 Change-Id: I8f0e558a4a5861164c6e85f90e3d88e469ea0769 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Evgeniy Dushistov <dushistov@mail.ru>
* qmllint: Ignore grouped properties againUlf Hermann2020-10-021-4/+3
| | | | | | | | | | We cannot handle those, yet. Add tests that prove correct grouped properties pass and incorrect ones are expected to fail at causing qmllint to fail for now. Task-number: QTBUG-87116 Change-Id: I0aeed15d262e2c6226e27d5d92890c5385a38936 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Consistently spell "Warning"Ulf Hermann2020-09-281-1/+1
| | | | | | | There was one place where it was written in lower case. Change-Id: Id953fa6c260502ab5bca8cfa061c817bb5a70581 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Make imports localUlf Hermann2020-09-284-99/+167
| | | | | | | | | Imports are not transitive. qmllint gets this wrong so far. Fixing it reveals two tests where we use types we haven't imported. Import the relevant modules. Change-Id: I45f3229468d54137f97d6b699f3a98a1349bc412 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Use a hash for scripts read from qmldir filesUlf Hermann2020-09-252-5/+5
| | | | | | | You cannot use the same name multiple times anyway (for now) Change-Id: I957340273772a1c5cf0a9da840a305bc8b311e95 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* TypeDescriptionReader: Don't export C++ names as QML namesUlf Hermann2020-09-256-42/+62
| | | | | | | | | | | | | | This is just wrong. The types are not visible in QML under their C++ names. Indeed, this way we reveal a number of places where we confuse the names. Fix those in turn. Furthermore, one of the tests was incorrect. The qmltypes files did not contain an export entry for one of the types, and therefore the type was formally anonymous in QML. However, we did access it via its C++ name. Fix that by exporting the C++ name. Change-Id: I8dd96334076b90fb174daf5b285d622f96495f56 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Split available names into exported, imported, C++ namesUlf Hermann2020-09-254-44/+79
| | | | | | | | | | exported names are the names a component intends to export. imported names are the names the importing component sees, possibly adding a prefix. C++ names are only used in qmltypes files for non-composite types. Change-Id: I843e34f07a026a06931ed76d72a3cce98e3e5552 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlDirParser: Treat dependencies like importsUlf Hermann2020-09-253-4/+4
| | | | | | | In particular, allow auto and latest versions. Change-Id: I4a6b26112950d066ae2d8a37dc0e9fa1dec24724 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* ScopeTree: Remove the "name" propertyUlf Hermann2020-09-255-23/+25
| | | | | | | It was rarely used and only caused confusion. Use internalName instead. Change-Id: I196b1d77db04a2cb6e3cd0447d34ce9bae0b9cd5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Clarify the meaning of the various names a scope can haveUlf Hermann2020-09-255-21/+25
| | | | | | | ... and notice that they are misused everywhere. Change-Id: I2254993dc5d11e967e7e83c6f0efb37fa17744be Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Keep scopes mutable until all the imports are resolvedUlf Hermann2020-09-254-13/+13
| | | | | Change-Id: I48601019d0e200eae9d52c3a9db45913cdd9d0f8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* ScopeTree: Add provisions for supplying types to methodsUlf Hermann2020-09-252-9/+44
| | | | | | | | | We want to proactively fill in all the types when constructing the ScopeTree so that we don't have to carry an undue number of imports around. Change-Id: I209d88568434c36073c11216dcd052babe5e3dae Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Mark scopes read from QML files as compositeUlf Hermann2020-09-251-0/+1
| | | | | Change-Id: I3e46a62595bfc05cdf9ee4233a27cd744b080ab9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Move import handling code into separate classUlf Hermann2020-09-252-64/+126
| | | | | | | | This still messes up the association between scopes and imports, but at least it encapsulates the issue better. Change-Id: I67239495e61ee10d18e6c4b3e837560a42650710 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Don't dump imported enums into the current scopeUlf Hermann2020-09-241-4/+0
| | | | | | | | | This bit of code has never fulfilled any discernable function. Enum access is done elsewhere. Add a test case to prove that access to enums from QtQml's plugins.qmltypes still works. Change-Id: I62fd6c1ec748c88205aa20367ee06d7a33502fa1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Regenerate projects before API changeAlexandru Croitor2020-09-222-28/+0
| | | | | | | Task-number: QTBUG-86815 Change-Id: I834513b93cf495ff9075d4cd541ed425e2ccbc15 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMake: Install public qmake .prf files into the prefix mkspecs dirAlexandru Croitor2020-09-211-0/+12
| | | | | | | | | These are needed for qmake projects. Fixes: QTBUG-86802 Task-number: QTBUG-86498 Change-Id: I09c05a358fa580a3a9eab002c6ada42ad70e999c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmlimportscanner: don't include QtQuick.Controls.xxx.impl as depdendencyAssam Boudjelthia2020-09-171-0/+4
| | | | | | | | | | | Since Qt 5 series include those modules QtQuick.Controls.xxx.Impl inside QtQuick.Controls.xxx, we shouldn't add them to the dependencies list. This also will silence androiddeployqt warning about invalid path for these modules. Pick-to: 5.15 Change-Id: Ic8c8aa1248b170ab1d455484effb38d24a1b4d35 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix additional warnings from usage of deprecated APIsVolker Hilsheimer2020-09-163-4/+4
| | | | | | | | Replace QLibaryInfo::location with QLibraryInfo::path, and remove usage of Qt::AA_EnableHighDpiScaling, which doesn't have any effect anymore. Change-Id: I347e8a83e0f4c2b4405f2512e569ad3234f05a98 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* qmlformat: Fix multiline comment attachmentMaximilian Goldstein2020-09-042-2/+11
| | | | | | Pick-to: 5.15 Change-Id: I3ba8a4cd683df3309dd6df31b1fd426a0875f8fa Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove use of deprecated High-DPI application attributesTor Arne Vestbø2020-09-022-16/+0
| | | | | Change-Id: Ibfb50fdcbb51ba93d6e5d11f9e8ce0e7b3bfde79 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Fix a bunch of compiler warningsLars Knoll2020-08-281-4/+4
| | | | | | Taks-number: QTBUG-86234 Change-Id: I4c945edecdbe55bc5587c18599d49dfb82ade1eb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Regenerate load(qt_app) projectsAlexandru Croitor2020-08-261-6/+5
| | | | | | | | Use the new qt_internal_add_app function. Task-number: QTBUG-85757 Change-Id: I455443a29511c809d2ad87073b2ae685fdbf27ae Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove last remaining use of QStringRefKarsten Heimrich2020-08-231-1/+1
| | | | | Change-Id: I91685ac4cf1f5186d58252587fb8c7d7375372b2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: fix import java scripts from moduleEvgeniy A. Dushistov2020-08-222-0/+11
| | | | | | Fixes: QTBUG-86183 Change-Id: I4809cb5a408eb4e668f802cf0d7b7a872d1ed4b7 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmlformat: fix handling of "if else" inside "if" in "if else"Evgeniy A. Dushistov2020-08-202-14/+41
| | | | | | Fixes: QTBUG-86060 Change-Id: I7a191c451793bf4e1f6a2bd02ceb36b5957136c2 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Improve the QML/JS type readerUlf Hermann2020-08-204-9/+8
| | | | | | | | Don't alternate between paths and URIs if we only need the URIs, and don't rely on casting from ASCII to QString or QChar. Change-Id: I4c206d5ff488939d5d2d78a3694d8eaf54ec5ec1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: handle signals defined in qml fileEvgeniy A. Dushistov2020-08-191-11/+20
| | | | | | | | | FindWarningVisitor for signal add property "signal" + "Changed", so it was impossible find "singal" and "onSingal" names. Fixes: QTBUG-83793 Change-Id: I5a62211f413f543fdb6bf00e0ab921561d7a9643 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Initial work on handling Qt Qml static pluginsAlexandru Croitor2020-08-135-208/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt 5 we added a QmlImportScanner package that provided a qt5_import_qml_plugins() function. Calling it with a target ensured running qmlimportscanner to find and link necessary qml static plugins for an application to work. This is the initial port of that to Qt 6, with a few differences. It introduces 2 function names, the version-less one and qt6_ prefixed one, qt_import_qml_plugins and qt6_import_qml_plugins. Implementation notes. In Qt 5 we figured out what link flags to pass by parsing the plugin prl files. In Qt 6, CMake can generate appropriate plugin targets with dependencies, as well as Config files that can look for the dependent packages. Use that information for finding the dependencies and linking. Note this relies on the assumption that find_package(Qt6Qml) will already include all available Qml plugin Config files, so that the targets exist in scope by the time qt_import_qml_plugins is called and links against those targets. The automatic inclusion is handled by a change in qtbase. In Qt 5 the function was available as part of QmlImportScanner package. In Qt 6 the function is moved to QmlMacros, so it's enough to find_package(Qt6Qml) to use it. A dummy QmlImportScanner package is provided for backwards compatibility, that simply finds the Qml package. Another change is to make the resource name added by qt6_target_qml_files unique (include the target name), because qmlcachegen generates a cpp file with a static initializer function name that includes the resource name. This caused duplicate symbol errors when linking more than one qtquickcontrols2 style plugin into an application when the resource name was not unique. There are a couple of TODOs left: - Figure out if it's possible to automatically call qt_import_qml_plugins for applications that link against Qml. Perhaps using our hacky scope finalizers. - Figure out how to handle scanning of resources. Task-number: QTBUG-85961 Task-number: QTBUG-85994 Change-Id: I42f61e4acc6f74a3cdc030dba9e41ce789bc28f6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Move functionality to read types from QML files out of qmllintUlf Hermann2020-08-139-92/+223
| | | | | | | We want to re-use this in other tools. Change-Id: I2a8cd104d54c1fa9b2898213b0b9e09719e42bca Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Compile against latest qtbaseLars Knoll2020-07-091-1/+1
| | | | | | | Adjust to the lastest changes in QList and QString. Change-Id: I216b2746a3305222a21c5aead3aec6106ac1f035 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Regenerate projectsAlexandru Croitor2020-07-0920-56/+76
| | | | | | | | | 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>