aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmllint
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-187-0/+45
|\| | | | | | | | | | | | | Conflicts: tools/qmllint/findunqualified.cpp Change-Id: I2593b5cc0db1d14e0c944aec4b88a80f46f5b0c1
| * qmllint: Check for unknown types in JavaScript accessUlf Hermann2020-03-173-0/+11
| | | | | | | | | | | | | | | | | | 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-172-0/+6
| | | | | | | | | | | | | | | | | | 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-163-0/+17
| | | | | | | | | | | | | | | | 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-162-0/+11
| | | | | | | | | | | | | | | | | | 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: Update Apple platform defines after rename in qtbaseTor Arne Vestbø2020-03-171-2/+2
| | | | | | | | | | Change-Id: Ia0a075e3199eab735f9b289873beeb8730ebc47e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2020-01-1616-7/+131
|\| | | | | | | Change-Id: I0c5b939c70bdb91ccdf7068784308416dcaa5736
| * qmllint: Consider failure to find imports an errorUlf Hermann2020-01-132-3/+3
| | | | | | | | | | | | | | | | 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-132-0/+7
| | | | | | | | | | | | | | | | | | 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-133-0/+17
| | | | | | | | | | Change-Id: Ic24018137d8f989686d4a8f927efb824453d114b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * qmllint: Assume "parent" property is always document parentUlf Hermann2020-01-134-0/+37
| | | | | | | | | | | | | | | | ... 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-134-0/+32
| | | | | | | | | | Change-Id: Ida53af9774dc72559395064169113d0ee1f47f24 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * qmllint: Analyze member accessUlf Hermann2020-01-133-1/+22
| | | | | | | | | | | | | | | | | | 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>
| * qmllint: parse JS files for methodsUlf Hermann2020-01-103-0/+10
| | | | | | | | | | Change-Id: I3888231ac82f9babd51e6332af3c5457bf3c9141 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * qmllint: CleanupUlf Hermann2019-11-182-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2019-11-252-0/+3
|\| | | | | | | Change-Id: I48b9c2e4f3a75c18470c55f73f2089dc1401de54
| * qmllint: Parse .mjs files as JavaScript rather than QMLUlf Hermann2019-10-152-0/+3
| | | | | | | | | | | | Change-Id: I80783289452300d4609a27f5b470ecdeeeca5e71 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Regenerate all projects with new CMake API versionAlexandru Croitor2019-11-151-3/+3
| | | | | | | | | | | | Change-Id: Ie0db35f674137c229eaf049616f38f8e818f7092 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2019-10-1412-66/+169
|\| | | | | | | | | | | | | Removed dependencies.yaml because we don't use it yet in wip/cmake. Fixed conflict in qmlcachegen.cpp. Change-Id: Ie1060c737bee1daa85779903598e5b6d5020d922
| * qmllint: Parse variable declarations from PatternElementsUlf Hermann2019-10-012-0/+10
| | | | | | | | | | | | Change-Id: If8b4f5302cc1ee3a4193b354503b304534d7dfd9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * Make qmllint read qmldir files and qmltypes files in app directoryUlf Hermann2019-09-255-0/+29
| | | | | | | | | | | | | | | | | | | | This makes it possible to resolve components which were either directly registered in the application or specified as composite types in qmldir files. Change-Id: I42482563f31ac780d6b37e62375d09d122c4a308 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Clean up qmllint testUlf Hermann2019-09-191-59/+65
| | | | | | | | | | | | | | | | | | There were several test functions that did effectively the same thing. Unify them. Change-Id: I2d1a9c1534b1c21498c9f0b7a8b80cd4f2a508b5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * qmllint: Take prefix into account when inserting namesUlf Hermann2019-08-302-0/+12
| | | | | | | | | | Change-Id: I2c13e8fc173e5e155d07a1bbf8547df65605ba10 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * qmllint: Consider methods from the current scope as valid IDsUlf Hermann2019-08-303-0/+17
| | | | | | | | | | Change-Id: I71e9e2d5b4623938605d7afbfc79ae5c7d4251fc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * qmllint: Handle the default import and .ui.qml filesUlf Hermann2019-08-303-0/+18
| | | | | | | | | | Change-Id: I9d86daa737d30ea0f76af431c59f44d59d4786e4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * qmllint: Warn about magic signal handlersUlf Hermann2019-08-302-0/+25
| | | | | | | | | | | | | | | | Those are typically part of Connections elements. We want to use functions instead. Change-Id: I08b65eae8b8a6ba95f7a3570f5465961abbb506e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Deduplicate code in tst_qmllint.cppUlf Hermann2019-08-291-39/+25
| | | | | | | | | | Change-Id: I2a9a8ecc0b2da2383242bba36186a72ff59e4c42 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Regenerate the necessary bits of qtdeclarative after wip/qt6 mergeAlexandru Croitor2019-10-141-8/+24
| | | | | | | | | | Change-Id: If58c29baf7fa3c3591968fca6d11f7649308dbf9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-10-114-16/+51
|\| | | | | | | Change-Id: I4a91928610f79c8e21a05781953ffa41508c828a
| * Make the qmllint test an actual testUlf Hermann2019-08-262-15/+19
| | | | | | | | | | | | Change-Id: I59a96cbef9a68454b68a37e5c7aed45cb4009785 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * qmllint: do not warn about the identifier of a catch statementFabian Kosmale2019-08-193-1/+32
| | | | | | | | | | Change-Id: I2e679fe4fbebff7d8252da6ea69aed3cc9ffab41 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-08-155-20/+58
|\| | | | | | | Change-Id: I6f2152aeecaeb8e63fdbc1cdf1444132a054b6f5
| * qmllint: Improve parent handlingFabian Kosmale2019-07-264-18/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Do not warn about parent access in unknown components This avoids false positive warnings when an imported component could not be found (or when it actually was not imported). We still warn about the component which could not be found, so the user is still informed that something is not right. We also still emit a warning when we know the properties of a component, and parent is not one of them. - Do not recommend the use of parent to address the root components properties. For this to work, we would need to know whether the root component reparents its children or not. Moreover, id lookups are actually faster than parent lookups. Change-Id: I83d0e71e4bf20d34a3e6d836c2b123b2bf0d416e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * qmllint: Improve signal handler recommendationsFabian Kosmale2019-07-252-2/+13
| | | | | | | | | | | | | | | | | | | | | | - Fix the case where multiple unqualified accesses would be mapped to the same signal (wrong in all but one cases), as the event parameter has the same name and we were using a QHash. Fixed by using QMultiHash and searching for the matching signal handler (by location) - Recommend arrow functions for single line event handlers Change-Id: I3cbb85fe0e49b454908ca03b4c86318ef02e364c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add QtDeclarative Test CoverageLeander Beernaert2019-08-141-0/+19
|/ | | | | | | | | | | | | | | | | | | | | | All tests compile and run on a developer build. These tests are failing: tst_qqmlsqldatabase Fails due to missing sql driver tst_qqmlsqldatabase Fails in wip/qt6 tst_ququicklayouts Fails in wip/qt6 tst_flickableinterop Fails in wip/qt6 tst_qquickpinchandler Fails in wip/qt6 tst_qquickflickable Fails in wip/qt6 tst_qquickgridview Fails in wip/qt6 tst_qquickimage Fails due to missing jpeg plugin tst_qquicklistview Fails in wip/qt6 tst_qquicktext Fails in wip/qt6 tst_qquickcanvasitem Fails in wip/qt6 tst_scenegraph Fails due to missing jpeg plugin tst_TestFiltering Fails in wip/qt6 Change-Id: I4b9d69c118e23c095cb72ad5a67653fc30943bb1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Extend linter to check for unqualified idsFabian Kosmale2019-07-126-0/+103
| | | | | | | | | | | | | | | | | | | | The linter has gained a new option (-U/--check-unqualified). If run with this option, it warns about occurrences of unqualified identifiers. Furthermore, it attempts to detect the reason for why the identifier can be used unqalified: - If the id originates from the root element, it suggests to qualify the access either with the root element's id, or with "parent" if applicable. - If the id is the parameter of a signal, it suggests to use functions in the handler, instead of relying on the signal parameters to be "magically" injected into scope. The linter does not attempt to handle with statements, but warns the user instead that they are a bad idea. Change-Id: I9aaf28c37595d84886a1071d49b86799b222a617 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Updated license headersJani Heikkinen2016-01-201-17/+12
| | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I04760a0801837cfc516d1c7c02d4f503f6bb70b6 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* qmllint: Add unit-testsSérgio Martins2015-10-257-0/+121
Change-Id: Ia3eb33e89597e3811112ce78d8a59a822cc9190c Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>