aboutsummaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* Tools: Convert to static type registrationsUlf Hermann2020-02-205-37/+81
| | | | | | | | qml and qmltime were still using qmlRegisterType() for some internals. Let's get rid of those. Change-Id: I68c0e7213f3b5b28670364c4db1cdec41d299b7d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* 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>
* | qmlformat: preserve annotationsFawzi Mohamed2020-02-122-0/+47
| | | | | | | | | | | | Change-Id: I22e72d91f6d422e93a7ebc642a8449cb490aec20 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
* | Add QML_CORE_PROFILE support to QML toolThomas Hartmann2020-02-062-1/+14
| | | | | | | | | | | | | | | | | | | | | | If QML_CORE_PROFILE is defined we use the CoreProfile surface format. This is required for QtQuick3D. For consistency we also introduce QSG_CORE_PROFILE. Adding QSG_CORE_PROFILE also to qmlscene. Change-Id: I4feee91740162cf36fa2668695b74f5a1279bb89 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-02-061-0/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/types/qqmlbind.cpp src/quick/items/qquicklistview.cpp tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp Change-Id: Id6805c13256ad13d5651011e5dd09bba0ec02987
| * Run qtEnsurePluginResourcesCpp() from qtquickcompiler.prfUlf Hermann2020-01-301-0/+1
| | | | | | | | | | | | | | | | | | This was missed when factoring out the resources flattening. Fixes: QTBUG-81699 Fixes: QTBUG-81713 Change-Id: I6ee42c0b91aaa57c593b218eb52359205098e5c6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add support for file selectors to qml toolThomas Hartmann2020-02-041-0/+13
| | | | | | | | | | | | | | | | | | | | This allows defining file selectors using a command-line option. [ChangeLog][QtQml][qml] The QML Runtime tool --selector option now allows defining a custom QQmlFileSelector. Change-Id: I1be5efd273b2f387df72b1d5057f7281e5c0c156 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | qmlformat: Support even more language featuresMaximilian Goldstein2020-01-305-101/+330
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds support (among other things) for: - Pragmas - Type annotations - get / set properties - Some previously unsupported escape sequences (\b,\v...) - Calling methods on numeric literals Also now checks whether the dumped code is still parsable. Change-Id: Ia142a7c0b3e608115e79c1d98a62b682dce4eec9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | 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>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-201-25/+26
|\| | | | | | | | | | | | | Conflicts: src/quick/items/qquickitemview.cpp Change-Id: Ib9faebdbef5eebb80f4e6aeb5b15b5df7494b157
| * qml: Fix options that need to be set before QApplication instantiationFriedemann Kleint2020-01-151-25/+26
| | | | | | | | | | | | | | | | | | | | | | Move the Open GL and scaling options setting QCoreApplication attributes into the helper getAppFlags() which already handles the application type. Change getAppFlags() to not modify argv which is not necessary since the parser will accept the options. Change-Id: Ib2f94f832e6551a938ff0e9bfe27649850d38d1e Reviewed-by: Ulf Hermann <ulf.hermann@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>
* | qmlformat: Fix some language features being unsupportedMaximilian Goldstein2020-01-173-15/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qmlformat now supports: - arrow functions - generator functions - this expressions - object patterns - regex literals - type expressions - plain expressions Aborts if an error occurs during dumping now. Also now automatically tests qmlformat against all example / test qml files. Change-Id: Idc24004c6f2c1cd65289bcad75985a1ef047c8d2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | QQmlListProperty: Add replace and removeLast functionsUlf Hermann2020-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | This allows us to implement QmlListWrapper::virtualPut(). Also, the additional functions make the list properties useful in other contexts. Fixes: QTBUG-79263 Change-Id: I528bc69222ca7743f0fc3697c3aed2a3468b4d87 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | qmllint: Consider failure to find imports an errorUlf Hermann2020-01-131-0/+1
| | | | | | | | | | | | | | | | There is no real reason to tolerate it. We can generate all qmltypes at build time, and if we can't find them, the results are likely to be off. Change-Id: Id935d76ac3ca6b601381b40a73d7fbacca342c4d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | qmllint: Consider attached propertiesUlf Hermann2020-01-131-0/+10
| | | | | | | | | | | | | | | | | | We cannot figure out who attached properties to what, therefore we consider any uppercase property we cannot locate as a potential attached property. Change-Id: I60508b9e4e038a51b87c56edf0796ac492aa3fa0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | qmllint: parse simple type assertionsUlf Hermann2020-01-134-9/+46
| | | | | | | | | | Change-Id: Ic24018137d8f989686d4a8f927efb824453d114b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | qmllint: Assume "parent" property is always document parentUlf Hermann2020-01-133-0/+12
| | | | | | | | | | | | | | | | ... except if the document parent is Component. Then leave the type alone. Change-Id: Id7b2e6efdefe18a8d375967ddedcdf9e07a07946 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | qmllint: Resolve aliasesUlf Hermann2020-01-137-128/+272
| | | | | | | | | | Change-Id: Ida53af9774dc72559395064169113d0ee1f47f24 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | qmllint: Analyze member accessUlf Hermann2020-01-136-77/+290
| | | | | | | | | | | | | | | | | | We can analyze access to many field member expressions and figure out if the accessed members exist. There are limits to this, of course. Generic JavaScript values are out of scope here. Change-Id: Id2e7613e56f06555cc3a2ba1c51683d9ea0bb84b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | qmlformat: Fix default construction of CommentUlf Hermann2020-01-101-2/+2
| | | | | | | | | | | | | | m_location would be uninitialized. Change-Id: Ieeeb0c0783a0b8e6f919019bd2ddcc1752993eaf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | qmllint: parse JS files for methodsUlf Hermann2020-01-102-140/+196
| | | | | | | | | | Change-Id: I3888231ac82f9babd51e6332af3c5457bf3c9141 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | qmllint: Clean up access to m_exportedName2ScopeUlf Hermann2020-01-101-11/+12
| | | | | | | | | | | | | | | | Don't accidentally overwrite the anonymous scope, and clearly mark where we want to modify the scopes and where we just want to retrieve them. Change-Id: I801d378ccaea6eb2548875766a9d3141dcb9f5e5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Qt Forward Merge Bot2020-01-092-2/+3
|\ \
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-092-2/+3
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/particles/qquickitemparticle.cpp src/qmlmodels/qqmladaptormodel.cpp tests/auto/particles/qquickitemparticle/tst_qquickitemparticle.cpp Change-Id: Ibd8fbb91da6893a09f4ffe61ad0b95d8149bbc87
| | * Use the correct icon filename for QML Runtime on WindowsShawn Rutledge2020-01-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Amends d7b7fed0cddf6236db3cf1bfdf9cc1380929cf5c. Task-number: QTBUG-70826 Change-Id: If9b74d19c4fc2bbe3ae882b4767919c74f3a38af Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
| | * Fix usage of qtquickcompiler.prf after lrelease.prfJoerg Bornemann2019-12-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider a project that sets CONFIG += lrelease embed_translations qtquickcompiler qtquickcompiler.prf is loaded first and loads resources.prf. Then lrelease.prf is loaded and extends RESOURCES. The latter changes are never picked up, because resources.prf was already loaded which is recorded in QMAKE_INTERNAL_INCLUDED_FEATURES. Use the newly introduced qtFlattenResources function instead of fully loading resources.prf. Task-number: QTBUG-79672 Change-Id: I1894ede97b4d5de567971a1a8cef407460bba97d Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | | qmlformat/dumpastvisitor: Fix a few segfaultsMaximilian Goldstein2020-01-091-3/+8
|/ / | | | | | | | | | | Change-Id: Ic8e95944cf36000a004d010293a532101433c3af Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | qmlformat: Fix whitespace for parameter defaultsMaximilian Goldstein2020-01-082-5/+5
| | | | | | | | | | Change-Id: I7958bf1546cc5854fc9b9856e36928ea932af0ca Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | tools/qmlformat: Improve formatting quite a bitMaximilian Goldstein2019-12-203-18/+72
| | | | | | | | | | | | | | | | | | | | - Fix strings not getting properly escaped - Fix if/else blocks not getting formatted correctly in some cases - Remove unnecessary newlines - Improve comment attachment Change-Id: Id8264c069315b3c6bd9ba8e8ac991dbdce8581a7 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | qtdeclarative/tools: Implement qmlformatMaximilian Goldstein2019-12-199-1/+1862
| | | | | | | | | | | | | | | | qmlformat is a tool that formats qml files according to the QML coding conventions (https://doc.qt.io/qt-5/qml-codingconventions.html). Change-Id: I359c4bd3b51f60614535f0e857d7e0b21b1d9033 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Fix Qt6 build in preparation of qt5 submodule updateAlexandru Croitor2019-12-191-2/+2
| | | | | | | | | | | | | | | | | | Fixes the QTextStream usages. Change-Id: I0c009a82fb644a9f3c3d42ec410d18b680977f23 (cherry picked from commit 1c5c5f7aadc2dcc73a21eeb818e95c4e1b7de70f) Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Avoid deprecated non-q-prefixed hex() functionUlf Hermann2019-12-171-1/+1
| | | | | | | | | | | | | | Use Qt::hex() instead. Change-Id: I46bc2f2006ce860cd938a86432783011365c8164 Reviewed-by: Liang Qi <liang.qi@qt.io>
* | qmllint: Use QHash::insert(QHash)Liang Qi2019-12-161-5/+1
| | | | | | | | | | | | | | This amends 4f6815b29003e140be5ac5763429a4bb256f5b9f. Change-Id: Icbe08d2c636969b40e7092b18c4bc2d21476944a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | qmllint: Avoid QHash::unite()Ulf Hermann2019-12-131-1/+5
| | | | | | | | | | | | | | | | As we don't have QHash::insert(QHash), yet, we have to iterate for now. Change-Id: I3deaf8c0fb53446bb9f125786d20ed89abe85c42 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | qmllint: Handle unversioned import statements in qmldir filesUlf Hermann2019-12-112-7/+19
| | | | | | | | | | | | | | | | The import statements in qmldir files are not required to have a version attached to them anymore. Change-Id: I925d5f965c73685874c23510cf2e569d1528d8c1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | qmllint: Read app.qmltypes files for extra type resolutionUlf Hermann2019-11-182-74/+113
| | | | | | | | | | Change-Id: I7f19b39dd65063ae26b93bf1b40b0be0b0e15c6d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | qmllint: Remove special cases for Component, QtObject, and ConnectionsUlf Hermann2019-11-181-16/+0
| | | | | | | | | | | | | | | | | | The plugins.qmltypes for QtQml have proper descriptions for those. They do have some interesting properties, after all. Change-Id: I7f0922dd14c66c64fe88b55087fd55cb992d33db Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | qmllint: CleanupUlf Hermann2019-11-1816-1659/+1053
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qmllint needed to be refactored before we can add any new functionality: * Fix all the (C++) linter warnings * Remove pointless namespaces * Merge ScopeTree and FakeMetaObject into one class * Remove the "Fake" from class and variable names * Remove dead code * Add "We mean it" warnings everywhere * Unify #include style This also "accidentally" fixes the automatic matching of signal handlers in Connections elements to signals in their parent scopes. Change-Id: Idf8daae34dfd6c0ee00da28b017f921da3eba25c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Move qmltyperegistrar into srcUlf Hermann2019-11-089-1170/+8
| | | | | | | | | | | | | | | | | | We want it to be available early in the build process. qmltyperegistrar will be required to build qml, quick, and various imports. Change-Id: I15b827cd4b322a2bcea2780eeedb8dbe132aa59a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | qmltyperegistrar: Allow QML_IMPORT_VERSION as alias for IMPORT_VERSIONUlf Hermann2019-11-081-5/+8
| | | | | | | | | | | | | | | | | | As we use QML_IMPORT_MAJOR_VERSION, QML_IMPORT_MINOR_VERSION, and QML_IMPORT_NAME, it's strange that we required the raw import version to come without the "QML_". Change-Id: Ida7d677851edf8f4d0179ea2a14772620d65bfa1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | qmltyperegistrar: Improve legibility of generated codeUlf Hermann2019-11-041-2/+2
| | | | | | | | | | Change-Id: I0084b03651c93ea26cd93edf1badcce4721ef993 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-267-9/+29
|\| | | | | | | Change-Id: Iaa7dbbe9926d25cfb1b1c51e7013e58cb71d86b5
| * qmllint: fix typoFabian Kosmale2019-10-241-1/+1
| | | | | | | | | | Change-Id: I02a6f4dd1804251e0420f2fbc334ee9c38d3dc49 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * Add support for scanning qrc files in qmlimportscannerAndy Shaw2019-10-246-8/+28
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Deprecate qmlminSimon Hausmann2019-10-251-0/+2
| | | | | | | | | | | | | | | | | | | | [ChangeLog] The qmlmin tool is deprecated and not needed anymore. The built-in caching of qml files addresses the needs and unfortunately the tool does not work with more advanced concepts such as required properties or the ES 7 yield statement. It will be removed in Qt 6. Change-Id: I2830f91d1dc2ad5e3c66270dad8e25793587ae7f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | qmltyperegistrar: Register only classes with QML.Element classInfoUlf Hermann2019-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | We may have QML.Attached in some classes we don't want to register. QML.Attached needs to be on the original class, even if the class is registered as a foreign type in some other context. Change-Id: I3d46fa351a2e595e879f0d2d8cc441d59c9dd754 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | qmltyperegistrar: Allow specifying the minor versionUlf Hermann2019-10-242-2/+17
| | | | | | | | | | | | | | | | | | Unconditionally using QT_VERSION_MINOR is not a great idea for user projects. Yet, we have to specify some minor version, at least for now. Change-Id: Id9d0d0417a2ac6b8775cef755357274d8fbd637d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | qmltyperegistrar: Throw an error if import name or version is emptyUlf Hermann2019-10-241-0/+8
| | | | | | | | | | | | | | | | We cannot generate anything sensible in those cases. Change-Id: I6005b970cedd999212920759a3dd45827b79b77c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>