aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlimportscanner
Commit message (Collapse)AuthorAgeFilesLines
* Allow optional imports in qmldir filesUlf Hermann2020-10-081-1/+1
| | | | | | | | | | This is useful for modules that select their imports at runtime using qmlRegisterModuleImport(). We can list all possible variants as optional imports so that tools can see what types might be available. Task-number: QTBUG-87130 Change-Id: I8a37bdde79aef3619fd1f05e5ea6781d521afa88 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-10-062-2/+2
| | | | | | | | 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>
* QmlCompiler: Rename ResourceFileMapperUlf Hermann2020-10-051-2/+2
| | | | | | | The file class names should start with a common prefix. Change-Id: I5e014c103668a1bc73d359b00a1dda33e5637a79 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Long live libQtQmlCompiler!Ulf Hermann2020-10-054-15/+4
| | | | | | | | 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>
* QQmlDirParser: Treat dependencies like importsUlf Hermann2020-09-251-1/+1
| | | | | | | In particular, allow auto and latest versions. Change-Id: I4a6b26112950d066ae2d8a37dc0e9fa1dec24724 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>
* 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-161-1/+1
| | | | | | | | 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>
* 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: 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>
* CMake: Regenerate projectsAlexandru Croitor2020-07-092-2/+4
| | | | | | | | | 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>
* qmlimportscanner: Use QmlDirParserUlf Hermann2020-07-081-67/+95
| | | | | | | | | | | | | | This gives us a reliable way to parse imports and versions. Apparently we can also have multiple classname entries in the same qmldir file. Reflect that in the parser. Also, drop the version field from the output. Nobody uses it and maintaining it while allowing partial, missing and auto versions would be rather difficult. Fixes: QTBUG-85304 Change-Id: Iab89a6d505a3c58174e623f02f0418899cb5fa2f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Port QtDeclarative from QStringRef to QStringViewKarsten Heimrich2020-06-161-1/+1
| | | | | | | | Task-number: QTBUG-84319 Change-Id: I2dcfb8a2db98282c7a1acdad1e6f4f949f26df15 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* CMake: Regenerate qtdeclarative/toolsAlexandru Croitor2020-05-292-0/+2
| | | | | | | | Includes - A bunch of TARGET_DESCRIPTION Change-Id: I6acfe05187afbdd45cf7e1bf8634f1554a51c791 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Move qmllint's metatype support to tools/sharedUlf Hermann2020-04-013-3/+7
| | | | | | | | | We want to read qmltypes files and analyze scopes also from other tools. Furthermore, restructure the shared directory, so that each tool only includes what it needs. Change-Id: I96a2dcc8b1c5fac613592fb1867bf51fa5ef3a6e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Regenerate and adapt to merge from devwip/cmakeAlexandru Croitor2020-03-122-10/+6
| | | | | | Change-Id: If8daa6152a563d4309d7342414780ef75b9f5589 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
* Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-03-122-5/+9
|\ | | | | | | | | | | | | | | Conflicts: dependencies.yaml src/qml/qml/qqmlengine.cpp Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
| * Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-091-2/+2
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qqmlirbuilder_p.h src/qml/qml/qqmlpropertycachecreator_p.h src/qmltyperegistrar/qmltypesclassdescription.cpp src/qmltyperegistrar/qmltypesclassdescription.h src/qmltyperegistrar/qmltypescreator.cpp src/quick/items/qquicktext_p.h src/quick/util/qquickvaluetypes_p.h Change-Id: Ic209741592e7b85820bf3845722023a190ebc1c5
| | * Use Qt::SplitBehavior in preference to QString::SplitBehaviorEdward Welbourne2020-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The Qt version was added in 5.14 "for use as eventual replacement for QString::SplitBehavior." Move another step cloaser to that goal. Change-Id: I3214ad6ccaca9dfd4a026589cabeb40cbf4a6298 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * Restore offset/length in QQmlJS::DiagnosticMessageSimon Hausmann2020-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed in a few places outside of declarative, so this change restores the loc member in DiagnosticMessage and moves QQmlJS::AST::SourceLocation into common's QQmlJS namespace/directory. QQmlError is unaffected and retains only line/column. Amends d4d197d06279f9257647628f7e1ccc9ec763a6bb Change-Id: Ifb9d344228e3c6e9e26fc4fe112686f9336ea2b2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-02-171-2/+2
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/qtqml/plugin.cpp src/qml/qml/qqml.h src/qml/qml/qqmlmetatype.cpp src/qml/qml/qqmlmetatype_p.h src/qml/qml/qqmltypeloader.cpp src/qml/types/qqmlbind.cpp src/quick/items/qquickitemsmodule.cpp tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp Change-Id: I52548938a582cb6510271ed4bc3a9aa0c3c11df6
| | * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-02-131-2/+2
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4engine.cpp Change-Id: I61f41672e2dfe7e542ca30fed5f173d0a9ee3412
| | | * Remove /get from CMAKE_QML_DIRAndré Klitzing2020-02-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-80843 Change-Id: I3a871930c9920159f455a1d4e8ef7c20e7966b52 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * | | Use QTypeRevision for all versions and revisionsUlf Hermann2020-02-031-1/+5
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In many places we carry major and minor versions or revisions that are loosely coupled to minor versions. As the Qt minor version resets now, we need to handle these things more systematically. In particular, we need to add a "major" part to revisions. QTypeRevision can express the current major/minor pairs more efficiently and can also be used to add a major version to revisions. This change does not change the semantics, yet, but only replaces the types. Change-Id: Ie58ba8114d7e4c6427f0f28716deee71995c0d24 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-01-292-1/+11
|\| | | | | | | | | | | | | | | | | | | | Conflicts: dependencies.yaml Change-Id: Ie3e9dc62031a85e5e81cbdf04694b95159d49fca
| * | CMake: Add Qt6 forward compatible CMake APIAlexandru Croitor2020-01-241-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-74137 Task-number: QTBUG-80477 Change-Id: Iaf88de57dd25f0a28c153667593203f75b6c472c Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
| * | Replace QVariant::type with QVariant::userTypeOlivier Goffart2020-01-171-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | as type is going to be deprecated. This change was done automatically with the help of clazy. In addition, ColumnRoleMetadata was changed to take an int instead of a QVariant::Type Change-Id: Ibc02d7b52e7d931a56c19fdebc4788b5e6df2a39 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Post Merge FixesLeander Beernaert2019-11-252-0/+8
| | | | | | | | | | Change-Id: I13bc3aef318d8b497b01c61fcca7760abd96339a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2019-11-252-1/+11
|\| | | | | | | Change-Id: I48b9c2e4f3a75c18470c55f73f2089dc1401de54
| * Add support for scanning qrc files in qmlimportscannerAndy Shaw2019-10-242-1/+11
| | | | | | | | | | | | | | | | | | | | | | This reuses the ResourceFileMapper and extends it slightly to return full paths on request. Subsequently, this is moved into a shared directory inside tools. Fixes: QTBUG-55259 Change-Id: Ice5fc68d03b767a4185742e182556ab4290bd28d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Regenerate all projects with new CMake API versionAlexandru Croitor2019-11-152-2/+2
| | | | | | | | | | | | Change-Id: Ie0db35f674137c229eaf049616f38f8e818f7092 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Regenerate projectsAlexandru Croitor2019-11-142-2/+108
| | | | | | | | | | | | Change-Id: I38044c382e4d84b5865a19cdd04cc8922bd72a77 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-10-114-3/+277
|\| | | | | | | Change-Id: I4a91928610f79c8e21a05781953ffa41508c828a
| * CMake: Provide API to allow handling of QML static pluginsAlexandru Croitor2019-08-174-3/+277
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds a new -cmake-output command line argument to qmlimportscanner which outputs its result in a format which is consumable by CMake. This change also adds a new CMake package called Qt5QmlImportScanner. It provides a function called QT5_IMPORT_QML_PLUGINS() which is useful for projects that use a static build of Qt and which also use QML plugins. Calling it with the target name of your application does the following: - Runs qmlimportscanner at configure time to find out which QML / QtQuick plugins are used by your project - Links the imported QML plugins into the target - Links the static dependencies of the QML plugins into the target - Generates a .cpp file that initializes imported QML plugins, which is subsequently compiled and linked into the given target When Qt is built in a shared library config, the introduced function is a no-op. [ChangeLog][CMake] Added ability to import static qml plugins with CMake builds using the new QT5_IMPORT_QML_PLUGINS function. Task-number: QTBUG-38913 Change-Id: Ib9b9a69654eab13dfbe12d10f5cb28ba3c307d1b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-07-111-4/+6
|\| | | | | | | Change-Id: I2963c1209316fb6755f572969f368970450d7991
| * extend grammar for better version parsing supportFabian Kosmale2019-07-041-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Be more strict in parsing version numbers This also makes it easier to access the version number in other places using the Visitor interface, like (soon) the linter and avoids reparsing the text twice. Potential disadvantages: previously allowed import statements will rejected at parse time, e.g. import QtQuick 0b10 Potential further advantage: Weird import statements like import QtQuick 0b10 will be rejected earlier Change-Id: Ifcd187b79a90952bc964c688afa4ea9b158e5109 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Simplify errors and diagnosticsUlf Hermann2019-06-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We only need two classes to describe all possible diagnostics: * A low-level private POD DiagnosticMessage. This is easily copied and passed around internally. It doesn't need to adhere to a stable API and it doesn't carry any extra baggage. * The high-level public QQmlError with its stable interface. This can internally also use a DiagnosticMessage as storage. Change-Id: I52be88d9b5d9855a661b8032b01eedb43a0fb0b3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Port the declarative toolsAlexandru Croitor2019-06-082-0/+45
|/ | | | | | | | | Also fix up QmlDevTools module to not depend on QtQml, but instead make it include the headers / cpp files as it is done in the qmake project. Change-Id: I240c52d5357db150a7c0c819892fb0a3708ceee4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Split QV4::Value into a static and a dynamic partUlf Hermann2019-05-311-1/+1
| | | | | | | | The static part can be used for compilation and won't resolve managed objects. This allows us to remove all the remaining V4_BOOTSTRAP. Change-Id: Id2f6feb64c48beb2a407697881aea8c0d791a532 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* qmlimportscanner: Fix commentsKai Koehne2019-03-211-11/+10
| | | | | Change-Id: I435662abafbe7b76fed7b012bfed2f99aa7158a3 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmlimportscanner: add some literal strings definitionsMarco Benelli2018-07-121-9/+12
| | | | | Change-Id: Ie65e7541b5a189867b27471b83e52dc2e4416183 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Use anonymous namespace instead of static declarationsMarco Benelli2018-07-121-11/+15
| | | | | Change-Id: Iced889303616fdae0074149a3f10572425275085 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-1/+1
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10Lars Knoll2017-09-201-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4compileddata.cpp src/qml/compiler/qv4compileddata_p.h src/qml/jsruntime/qv4engine.cpp src/qml/jsruntime/qv4qmlcontext.cpp src/qml/jsruntime/qv4qmlcontext_p.h src/qml/jsruntime/qv4regexpobject.cpp src/qml/jsruntime/qv4regexpobject_p.h src/qml/types/qqmllistmodel.cpp src/quick/items/qquickanimatedimage_p.h src/quick/scenegraph/qsgrenderloop.cpp tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp Change-Id: If20ef62b2c98bdf656cb2f5d27b1897b754d3dc0
| * qmlimportscanner: Scan the root directory againMorten Johan Sørvig2017-09-191-1/+1
| | | | | | | | | | | | | | | | | | | | “qmlimportscanner -rootPath /path/to/foo” should scan QML files in the “foo” directory. Remove QDir::NoDot, which was added in commit 6ff0e9a6. Change-Id: I15cc4a289cf246786cdf8fe2020c7f3d2798b7a5 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-09-051-2/+2
|\| | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickwindow.cpp src/quick/scenegraph/qsgrenderloop.cpp Change-Id: Idd7106995b5545fcac869e9056a365ef9edb36ca
| * qmlimportscanner: Only skip debug/release directories if the path ends with themAndy Shaw2017-09-041-2/+2
| | | | | | | | | | | | | | | | | | Since the preceding path may contain debug or release in it, then we only want to check if the path ends with it as opposed to containing it. Change-Id: Ib4d466987fccb75771fcd2fa018b6f1375df7dc4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Marco Benelli <marco.benelli@qt.io>
* | Adjust QMAKE_TARGET_PRODUCT, QMAKE_TARGET_DESCRIPTIONKai Koehne2017-07-281-2/+1
| | | | | | | | | | | | | | | | | | | | The product should be Qt5 (the default). The QMAKE_TARGET_DESCRIPTION is actually less than a description but a beautified name, that is shown e.g. in the task manager, crash reporting tool etc. Make it title case, like most Windows applications do. Change-Id: I570aee2c2016e78fdb7a93c2d7a66b70fdcb0cff Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Remove custom setting of qmake VERSION field in toolsKai Koehne2017-07-281-6/+0
| | | | | | | | | | | | | | | | qt_tool.prf sets the VERSION to MODULE_VERSION by default. Also, qmake automatically makes it a quadruple for the .rc file metadata. Change-Id: Ie2d0f2022c4416ce824a6786eef4a8c461ed70f1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-03-021-0/+9
|\| | | | | | | Change-Id: I6cbd83b61fac34c2ba6936711289ec09a490719a