aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmllint
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* Improve the QML/JS type readerUlf Hermann2020-08-201-4/+3
| | | | | | | | 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>
* Move functionality to read types from QML files out of qmllintUlf Hermann2020-08-136-328/+14
| | | | | | | 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-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>
* qmllint: Resolve enums from parent typesUlf Hermann2020-06-261-15/+20
| | | | | | | | Fixes: QTBUG-85185 Fixes: QTBUG-84036 Change-Id: If0989a85df93903fee6cb146a515cd362160ff49 Reviewed-by: Evgeniy Dushistov <dushistov@mail.ru> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Properly process qmldir imports and dependenciesUlf Hermann2020-06-242-105/+83
| | | | | | | | | | | | | | | | | | We don't want to pick the dependencies from the qmltypes files. Rather, parse them directly from the qmldir. Do process versions, too. Also, import explicitly given qmltypes files only once, and don't expose QML types from dependencies as actual types. Hide them behind an inaccessible prefix. For the inaccessible prefix to work, we need to import the C++ class names without the prefix. The prefix doesn't make sense for C++ names anyway. In addition, properly process version-less imports. Change-Id: If582ad271db35351d219332c319571a814628fe0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Discern between "auto" and versioned imports in qmldirsUlf Hermann2020-06-241-2/+2
| | | | | | | | | | | | | You can now import the latest version, a specific version, or, "auto" which is the same version as the parent module. [ChangeLog][QtQml] You can now procedurally add module imports to modules, using qmlRegisterModuleImport(). However, actual import statements in qmldir files should be preferred wherever possible. Fixes: QTBUG-84899 Change-Id: I3b32dd8b07a19d31b6538b9a6bb436840862f345 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: search methods and properties also in attached typeEvgeniy A. Dushistov2020-06-191-22/+45
| | | | | | | | | | | | | | I changed the strategy of traverse via related types. Before: traversal happens only via linked list type -> type->superClass After: traversal via binary tree formed by attachedType and superClass I use pre-order strategy, current type, then all attached types, then all super classes Fixes: QTBUG-84861 Change-Id: I4a8fce869bc541de6900514d29575174d2753f02 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: high level item can also be listEvgeniy A. Dushistov2020-06-182-3/+11
| | | | | | | Fixes: QTBUG-84300 Change-Id: I1a9db060cdeb7c4ec10deedab5141a06245a55b2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmllint: fix wrong warning about enum usageEvgeniy A. Dushistov2020-06-173-0/+19
| | | | | | | Fixes: QTBUG-83796 Change-Id: I635bbfd98cf7be8418b454626ba7725e92b71c2c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Port QtDeclarative from QStringRef to QStringViewKarsten Heimrich2020-06-163-13/+13
| | | | | | | | 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>
* Deduplicate the import resolution algorithmUlf Hermann2020-06-101-83/+16
| | | | | | | We will need it in various other places, too. Change-Id: I61c55f88b66ab85448ae8fff125fe34108532fc4 Reviewed-by: Fabian Kosmale <fabian.kosmale@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>
* Fix Clang 10 warning about creating copies in range-forUlf Hermann2020-05-202-3/+3
| | | | | | | | | We should not copy the loop variables. Fixes: QTBUG-83989 Pick-to: 5.15 Change-Id: Ic94710a2c08aa19656c5e1853c40b10b203bca0e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qmllint: Fix evaluation of type assertionsUlf Hermann2020-05-202-6/+4
| | | | | | | | | | Previously, type assertions were ignored. The test case didn't fail because simple type casts were automatically detected when the derived objects were instantiated and assigned to base type properties. Pick-to: 5.15 Change-Id: I437e77ff38b7d570451cf27ca84e9897b519413f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Compile with latest qtbase devFabian Kosmale2020-05-161-1/+0
| | | | | | | Get rid of QTextCodec in QQmlError and qcoloroutput.cpp and etc. Change-Id: I26ab81536d12eb0587d5d9ae747f6a379a4d0b12 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Fix typoMaximilian Goldstein2020-05-141-1/+1
| | | | | Change-Id: Iec3632bdf2446d9a54397c113b648db1c4f7db6e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: fix typo in outputMitch Curtis2020-05-071-1/+1
| | | | | | Change-Id: I5442f90e58fae0ed5b132c0bbabd0161822f85b8 Pick-to: 5.15 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix qmllint crashMaximilian Goldstein2020-05-061-1/+1
| | | | | | Fixes: QTBUG-83915 Change-Id: I26731ebcec6be46602b6acc7562c65b1c9f3e43a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: warn when passing a directory to -i optionMitch Curtis2020-05-062-23/+25
| | | | | | | | | It should be a file. Change-Id: I52f4ebcf8bdd8ddd1fedd66ceffe9a060139c1d9 Fixes: QTBUG-83861 Pick-to: 5.15 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Add flags for toggling warningsMaximilian Goldstein2020-04-306-95/+130
| | | | | | | | Enables all warnings by default and makes it possible to toggle individual ones using command line flags. Change-Id: Ie55f32f646fd9422313977969f9f00b59ee9ad99 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Show filename in addition to line and columnFabian Kosmale2020-04-243-11/+18
| | | | | | Fixes: QTBUG-83684 Change-Id: If15a9498ae223dccfbafe88b14453a4b180247d9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* ScopeTree: Make methods a QMultiHashUlf Hermann2020-04-151-7/+12
| | | | | | | You can have multiple overloads with the same name. Change-Id: Ifffcc634e96b41f99152092b72b61dad64713b23 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-093-16/+52
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4executablecompilationunit.cpp src/qml/jsruntime/qv4executablecompilationunit_p.h src/qml/qml/qqmlobjectcreator.cpp src/qml/qml/qqmlpropertycachecreator_p.h src/qml/qml/qqmltypecompiler.cpp src/qml/qml/qqmltypedata.cpp tests/auto/qml/qmlformat/tst_qmlformat.cpp tools/qmllint/scopetree.cpp src/qml/qml/qqmlapplicationengine_p.h Adjusted tools/qmllint/findunqualified.cpp to use newer API Change-Id: Ibfb4678ca39d626d47527265e3c96e43313873d4
| * qmltyperegistrar: Use target instead of template nameMaximilian Goldstein2020-03-263-16/+52
| | | | | | | | | | | | | | | | | | Due to the fact that multiple targets may be present in the same directory we have to ensure they all get a unique qmltypes. Fixes: QTBUG-82710 Change-Id: I4d7966035644b68f7d3330a4c974369503c48bf2 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * qmllint: Fix typoFabian Kosmale2020-03-241-1/+1
| | | | | | | | | | | | Fixes: QTBUG-82992 Change-Id: I6cb79b5736f283f68ec0a94c4494e4ca592b16d4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | qmllint: Consistently use shared pointers for ScopeTreeUlf Hermann2020-04-016-53/+55
| | | | | | | | | | | | | | | | | | | | ScopeTree keeps a weak pointer to its parent scope and strong shared pointers to its children. Avoid passing bare pointers around, so that we cannot create multiple shared pointers independently from the same bare pointer. Change-Id: Id0faece550b1878363004d843a8fa5c1164794ae Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Move qmllint's metatype support to tools/sharedUlf Hermann2020-04-0113-1797/+482
| | | | | | | | | | | | | | | | | | 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>
* | qmllint: Drop support for "ModuleApi"Ulf Hermann2020-03-304-55/+3
| | | | | | | | | | | | | | | | | | This is some ancient, pre-Qt5 way of describing singletons. We don't need it anymore. Change-Id: I6355acf187b8ede4298a7026229a587cd1a12f1b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-201-0/+17
|\| | | | | | | Change-Id: I6f320ea43b5837444226228c118e57c4bda8702a
| * qmllint: Break inheritance cyclesUlf Hermann2020-03-191-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | Previously we would run into infinite loops on those. Mind that qmllint will reject a file called Window.qml that imports QtQuick.Window and then instantiates a Window {}. Such a thing is bad style. Task-number: QTBUG-82817 Change-Id: I6db82ca1794c3020dcb7d7e837fe44f72bca5029 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-183-23/+63
|\| | | | | | | | | | | | | Conflicts: tools/qmllint/findunqualified.cpp Change-Id: I2593b5cc0db1d14e0c944aec4b88a80f46f5b0c1
| * qmllint: Check for unknown types in JavaScript accessUlf Hermann2020-03-171-2/+19
| | | | | | | | | | | | | | | | | | There are many incomplete qmltypes files around. We should not just crash on those. Task-number: QTBUG-82817 Change-Id: Ie072b80473927570c80fb2f9ae329de711c35904 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * qmllint: Don't crash on IDs that aren't scopesUlf Hermann2020-03-171-3/+18
| | | | | | | | | | | | | | | | | | In particular, those can be qualifiers for imports, in which case we have to combine them with the next segment in order to find the type. Task-number: QTBUG-82817 Change-Id: I217a79572cd1e160dcbbcb9541c53941c81ab76c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * qmllint: Use fully qualified QML type names as superClassUlf Hermann2020-03-162-9/+11
| | | | | | | | | | | | | | | | Otherwise we miss subtleties such as Label vs. T.Label. Task-number: QTBUG-82817 Change-Id: Idc2131426b2fd96f279dab83292a348b9295d5c0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * qmllint: Add QFont to the list of unknown builtinsUlf Hermann2020-03-161-11/+17
| | | | | | | | | | | | | | | | | | And also check them when analyzing JavaScript access. Task-number: QTBUG-82817 Change-Id: I677e7883fb24ab80ff20d1998e2d7df440ef4112 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | CMake: Regenerate and adapt to merge from devwip/cmakeAlexandru Croitor2020-03-122-6/+2
| | | | | | | | | | | | 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-129-60/+56
|\ \ | | | | | | | | | | | | | | | | | | | | | Conflicts: dependencies.yaml src/qml/qml/qqmlengine.cpp Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
| * | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-095-18/+18
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-024-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Use QTypeRevision for all versions and revisionsUlf Hermann2020-02-035-42/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Post merge fixesLeander Beernaert2020-01-242-6/+10
| | | | | | | | | | | | | | | Change-Id: Ie8aca222809f35174fb6c6488832ec3ff5432272 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2020-01-1618-1857/+1760
|\| | | | | | | | | | | Change-Id: I0c5b939c70bdb91ccdf7068784308416dcaa5736
| * | Make QtQml work with the latest changes in qtbaseLars Knoll2020-01-141-3/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | Adjust the code to work with the new QString and QVector data structures that have inlined size and data pointers. Fix a large bunch of compiler warnings from QFlags. Update dependencies for qtbase and qtsvg Change-Id: Iba237aed90c140b822e0cf501b9fb7156ec27c2d 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>