aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/qmljs/qmljscheck.cpp
Commit message (Collapse)AuthorAgeFilesLines
* qqmljscheck: don't mix ids between inline componentsSami Shalayel2025-10-091-0/+11
| | | | | | | | | | Ids can't leak out of inline components, so use different idStacks when looking at different inline components. Fixes: QTCREATORBUG-32418 Change-Id: Ia7d90951fd527433c6106fe5ef68b4ef1332f10c Reviewed-by: hjk <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* Merge remote-tracking branch 'origin/qds/dev'Tim Jenssen2025-04-031-1/+1
|\ | | | | | | Change-Id: I32c097041c1b1b33618c20651c265698d9e69208
| * QmlJS: Allow blocks in TimelineAnimationThomas Hartmann2025-03-211-1/+1
| | | | | | | | | | | | | | | | | | | | We add signal handlers to TimelineAnimation since QDS 1.0. We normalize those handler with braces and this should continue to work. Task-number: QDS-15014 Pick-to: qds/4.7 Change-Id: Ib7a354d0e25a087aabe690ebda66f131b579d666 Reviewed-by: Tim Jenssen <[email protected]>
* | Avoid potential detach of non-const Qt containers in range-loops 1/2Alessandro Portale2025-03-211-6/+6
|/ | | | | | | By making the containers const. Change-Id: I3095d7c817bd8a9cc40184aba144d617c6071f97 Reviewed-by: hjk <[email protected]>
* QmlJS::Check: Suspend warnings for ScriptAction defined in the .ui fileRafal Stawarski2025-02-201-13/+15
| | | | | | | | | | Connections were the only type that was allowed to have function definitions, call expressions, etc. in the .ui file. It's now extended with ScriptAction. Task-number: QDS-10449 Change-Id: If55116a291c5c1d6441f6ab0c3a651861da69fba Reviewed-by: Thomas Hartmann <[email protected]>
* Libs: Make static QRegularExpression instances static constAlessandro Portale2024-11-201-2/+3
| | | | | Change-Id: Ie5a2675651bd83128123cc18601141ba11a13e81 Reviewed-by: hjk <[email protected]>
* qmljscheck: fix M129 warning on components with same nameSami Shalayel2024-10-241-2/+13
| | | | | | | | | | | | | | | Look in the imports up whether a component with the same name as the current component was imported. In this case, this component shadows the current component and can be used in the file without recursively instantiating anything. Therefore, count the number of components with the same name as the currently edited qml file that was imported in the current file and warn if no other component with the same name was imported. Fixes: QTCREATORBUG-31313 Change-Id: Id1e748dc0dcdbb514d9882cf79dfba959abacd15 Reviewed-by: Semih Yavuz <[email protected]>
* QmlDesigner: Add missing commaThomas Hartmann2024-09-181-6/+2
| | | | | | Task-number: QDS-11061 Change-Id: Ie86affe6b9fe3d28a4bc49c012cd7287225085e0 Reviewed-by: Knud Dollereder <[email protected]>
* QmlJSCheck: Do not allow object in when conditionThomas Hartmann2024-09-101-0/+7
| | | | | | | | | | This is syntactically correct and can be hard to spot, but is not valid QtQuick. Task-number: QDS-13452 Change-Id: I010e44e33147c97edbd992c3452ba1c086fb42cb Reviewed-by: Marco Bubke <[email protected]> Reviewed-by: Ulf Hermann <[email protected]>
* QmlJSCheck: Allow new translation macros in designerThomas Hartmann2024-08-211-3/+10
| | | | | Change-Id: I16a871a919f9f36d219f8b55e1c4601860b79dfe Reviewed-by: Thomas Hartmann <[email protected]>
* QmlDesigner: Allow behaivoursThomas Hartmann2024-07-151-1/+1
| | | | | | | We support them in the model and they do not seem to do any harm. Change-Id: I7124bc0ecebdc87943edde53f016f18d20e2dcf4 Reviewed-by: Thomas Hartmann <[email protected]>
* Merge remote-tracking branch 'origin/14.0' into qds/devTim Jenßen2024-07-101-0/+26
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/qtdesignstudio/src/how-to/qtdesignstudio-live-preview-desktop.qdoc qt_attributions.json src/libs/sqlite/CMakeLists.txt src/plugins/qmldesigner/CMakeLists.txt src/plugins/qmldesignerbase/QmlDesignerBase.json.in src/plugins/qmlprojectmanager/CMakeLists.txt src/tools/qml2puppet/qml2puppet/instances/qt5import3dnodeinstanceserver.cpp src/tools/qml2puppet/qml2puppet/instances/qt5import3dnodeinstanceserver.h Change-Id: If33e41d8951a49acaba0a74c3e5848eef52bb945
| * QmlJs: Fix a warning about comparison of different signsJarek Kobus2024-04-151-1/+1
| | | | | | | | | | | | | | Amends e1d90a7965e167287550dc39f9b941569b7d8a49 Change-Id: I7c49927cbe8db71e3571875b59b522d186a852df Reviewed-by: Christian Stenger <[email protected]>
| * QmlJS: Add another static check for enum valuesChristian Stenger2024-04-151-0/+2
| | | | | | | | | | | | Task-number: QTCREATORBUG-19226 Change-Id: Ic995eee2e868bbe1953c0c33d1bab5793e07ebe2 Reviewed-by: Ulf Hermann <[email protected]>
| * QmlJS: Improve handling of user defined enumsChristian Stenger2024-04-151-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Improves handling of Qml based enums inside qml documents. * completion of enums * follow the enum * highlighting values inside the declaration * displaying the enum declaration inside the outline * minor static checks Task-number: QTCREATORBUG-19226 Change-Id: Ia07fd9a8b7fa3106f2ea53198bfdcc50eecb7307 Reviewed-by: Ulf Hermann <[email protected]>
* | QmlDesigner: Unify invalid idsAli Kianian2024-06-241-10/+24
|/ | | | | | | Fixes: QDS-13056 Change-Id: I8d99e0e9eba148fe4d31c3c9a2d28f46d91b377a Reviewed-by: Miikka Heikkinen <[email protected]> Reviewed-by: Marco Bubke <[email protected]>
* Merge remote-tracking branch 'origin/qds/dev' into 12.0Tim Jenssen2023-10-051-1/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: share/qtcreator/qmldesigner/connectionseditor/SuggestionPopup.qml share/qtcreator/themes/dark.creatortheme share/qtcreator/themes/default.creatortheme share/qtcreator/themes/flat-dark.creatortheme share/qtcreator/themes/flat-light.creatortheme share/qtcreator/themes/flat.creatortheme src/libs/utils/CMakeLists.txt src/plugins/CMakeLists.txt src/plugins/qmlprojectmanager/qmlproject.cpp src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp Change-Id: Idd87c281e1aa7b7fd2702473ad55e18563cbfb21
| * QmlJSCheck: Do not warn about visual properties in ConnectionsThomas Hartmann2023-09-191-1/+5
| | | | | | | | | | | | | | Change-Id: I1b8d9374021d337d87025290fd025dd600fc3967 Reviewed-by: Qt CI Patch Build Bot <[email protected]> Reviewed-by: <[email protected]> Reviewed-by: Tim Jenssen <[email protected]>
* | QmlJS: Remove unused functionsChristian Stenger2023-09-281-30/+0
| | | | | | | | | | | | | | Amends eb5cdb4293be8c4c878425ea9d45f5c105205bb2. Change-Id: I8d8627b9471547df0334f6035d4a0241a21c1f1f Reviewed-by: Fabian Kosmale <[email protected]>
* | Revert: qmljs: add check for comparisons not depending on valuesOlivier De Cannière2023-09-271-47/+0
|/ | | | | | | | | | | | The warnings produced by these checks have always been somewhat broken. Ever since they were added people users complained about the M325 warnings because they were confusing or because of false positives. Fixes: QTCREATORBUG-29601 Change-Id: Ifac1ed0819a05251b3c4b583627cc45553e3d680 Reviewed-by: Ulf Hermann <[email protected]> Reviewed-by: Thomas Hartmann <[email protected]> Reviewed-by: Eike Ziller <[email protected]>
* Merge remote-tracking branch 'origin/11.0' into qds/devTim Jenssen2023-09-141-7/+7
|\ | | | | | | Change-Id: I2bf1a2a72d9765d9b4088840414b4933644db47a
| * Fix M16 warning restrictionsSemih Yavuz2023-08-301-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case id is not ancestor, we cannot find that ID in m_idStack by design. The ID of an uncle type could be either popped out or not pushed in yet. The previous implementation, therefore, doesn't restrict M16 messages if non-ancestor ID is referred. As a workaround, disable M16 warnings completely if the enclosing type uses ImmediateProperties. Amends 012f984c27d8513e304d894f986977548d3c1add Task-number: QTCREATORBUG-28468 Change-Id: I47326e005753ff7b94057732602cfeb6dc525bbb Reviewed-by: Ulf Hermann <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* | QmlJS: Turn ErrDoNotMixTranslationFunctionsInQmlUi into a warningThomas Hartmann2023-08-301-4/+4
| | | | | | | | | | | | | | Task-number: QDS-10548 Task-number: QDS-7597 Change-Id: I785fbf0f47f0753b257ef5fae1c3bf4afa9b416f Reviewed-by: Tim Jenssen <[email protected]>
* | Add interface to check incompatible qml idsVikas Pachdha2023-07-211-1/+6
|/ | | | | | | Task-number: QDS-10121 Change-Id: I112bee4e9323dc4eff30ec7a4693c1e9632d6ba9 Reviewed-by: Qt CI Patch Build Bot <[email protected]> Reviewed-by: Thomas Hartmann <[email protected]>
* Restrict M16 warningsSemih Yavuz2023-06-271-17/+19
| | | | | | | | | | | | | | Do not warn out invalid property name if the property starts with an id in the same component scope. Small refactoring: Move early-return-likely elements up before any calculations done. Fixes: QTCREATORBUG-28468 Change-Id: I2cbdbc24af42f126db0bbd6027ebe4f96d9c199f Reviewed-by: <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: hjk <[email protected]>
* QmlJS: Fix initializing static analyzerChristian Stenger2023-06-121-2/+9
| | | | | | | | | | | ...when using a customized analyzer that has no customization. If there is no customization we do not store the value inside the settings, so we get empty lists instead of the default lists for disabled messages. Amends 427640063e2d95752e95b17af13b8ed3e0e4473a. Change-Id: Idea560176b0a9caa93dca7a3a2d01cc3aa3a6d2f Reviewed-by: Alessandro Portale <[email protected]>
* QmlJS: Switch default enabled state for analyzer messageChristian Stenger2023-06-071-0/+2
| | | | | | | | | | | | | This message was mainly added for the QmlDesigner and DesignStudio. It might be a valid warning under circumstances, but it may also prevent valid use cases. Turn it off by default and enable it for the QmlDesigner parts. Fixes: QTCREATORBUG-29088 Change-Id: Id2c76efdf3fa419cfce71ad89360927241d41ac8 Reviewed-by: Tim Jenssen <[email protected]> Reviewed-by: <[email protected]> Reviewed-by: Ulf Hermann <[email protected]>
* QmlJS: Allow disabling static analyzer messagesChristian Stenger2023-05-041-21/+59
| | | | | | | | | | Provide settings to define a customized set of enabled static analyzer messages. Fixes: QTCREATORBUG-29095 Change-Id: Id629e383dd9e3beeef98026759ac66716dc43d23 Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: Leena Miettinen <[email protected]>
* Merge remote-tracking branch 'origin/10.0' into qds/devTim Jenßen2023-03-261-12/+18
|\ | | | | | | | | | | | | | | bigger conflicts resolved at: src/plugins/qmldesigner/CMakeLists.txt src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp Change-Id: I08e2a109d8e37cbd77225129854e9e633725bfc7
| * QmlJS: Tr::TrAlessandro Portale2023-02-011-4/+7
| | | | | | | | | | | | | | | | Excluding the Qml parser, which needs to remain in sync with it's copy in Qt. Change-Id: I22f475f265dd74687e3239c4d6916c777798a447 Reviewed-by: hjk <[email protected]>
| * Remove GPL-3.0+ from license identifiersKai Köhne2023-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0, this applies only to a hypothetical newer version of GPL, that doesn't exist yet. If such a version emerges, we can still decide to relicense... While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only Change was done by running find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \; Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b Reviewed-by: Eike Ziller <[email protected]>
| * qmljs: Remove foreach usageArtem Sokolovskii2022-12-211-7/+10
| | | | | | | | | | | | | | | | Task-number: QTCREATORBUG-27464 Change-Id: Ifdb8cf514dfe328e0a64bde1beff3e63a4b7fbc3 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: hjk <[email protected]> Reviewed-by: <[email protected]>
* | QmlJS: Allow string::arg() in ui.qml filesThomas Hartmann2023-02-071-3/+6
| | | | | | | | | | | | Task-number: QDS-9037 Change-Id: Ie91e745ae4d20e0fd96df1d767fc875475a0be7a Reviewed-by: Henning Gründl <[email protected]>
* | QmlJSCheck: Add missing commaThomas Hartmann2023-01-201-3/+16
|/ | | | | | Change-Id: I5f26cbe50ecb47c088bab8b9cdea49d0103352eb Reviewed-by: Burak Hancerli <[email protected]> Reviewed-by: Thomas Hartmann <[email protected]>
* Merge remote-tracking branch 'origin/8.0'Eike Ziller2022-09-191-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf src/libs/utils/fileutils.cpp src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp src/plugins/qmldesigner/designercore/include/abstractview.h src/plugins/qmldesigner/designercore/include/nodemetainfo.h src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp src/plugins/qmldesigner/designercore/model/model_p.h src/plugins/remotelinux/linuxdevice.cpp tests/auto/utils/fileutils/tst_fileutils.cpp Change-Id: I26a21e2523d3d725fdb8c548a531cdbdaeaeca20
| * QmlDesigner: Allow multiple StateGroups in .ui.qmlHenning Gruendl2022-09-131-1/+1
| | | | | | | | | | Change-Id: If7f626f196899ebd49e5f6393d8e3ef81447945c Reviewed-by: Thomas Hartmann <[email protected]>
* | Use SPDX license identifiersLucie Gérard2022-08-261-24/+2
| | | | | | | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <[email protected]>
* | Merge remote-tracking branch 'origin/8.0'Eike Ziller2022-08-191-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reverts/comments out parts of 45f93a817a527e6dc81a8971dd2868b3da66cd84, which needs to be resolved in a follow-up commit. Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp src/plugins/clangcodemodel/clangmodelmanagersupport.cpp src/plugins/cmakeprojectmanager/cmakesettingspage.cpp src/plugins/python/pythoneditor.cpp src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp src/plugins/scxmleditor/common/colorsettings.cpp Change-Id: I7f0f7b7120e75a9fc3a8886bc57c17345cbb501b
| * QmlDesigner: Allow Timer in ui.qml filesThomas Hartmann2022-08-161-1/+1
| | | | | | | | | | | | Change-Id: I0fbf7270f8514b212fab5aae89d2def11d6b53bd Reviewed-by: <[email protected]> Reviewed-by: Thomas Hartmann <[email protected]>
* | qmljs: (QString -> Utils::FilePath)++Fawzi Mohamed2022-07-131-5/+5
|/ | | | | | | | | convert more QString containing paths to Utils::FilePath Change-Id: I1219d7d147993e48cfa641dc9bea72ab38c90f51 Reviewed-by: Tim Jenssen <[email protected]> Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: <[email protected]>
* Merge remote-tracking branch 'origin/7.0'Eike Ziller2022-04-261-1/+3
|\ | | | | | | Change-Id: I3da1b663a570682201afbe644d6f9299019aae21
| * QmlJsCheck: Add more ids to negative listsThomas Hartmann2022-04-261-1/+3
| | | | | | | | | | | | | | | | Since those are QML keywords those ids can create all kind of unexpected side effects. Change-Id: I9ecb9b0559c57d59104aacedfca505b559de9685 Reviewed-by: Tim Jenssen <[email protected]>
| * qmljs: correctly handle js string templatesFawzi Mohamed2022-04-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | In most cases we do want to visit the expressions in a function template. Changing its accept0 would force those not wanting to visit it to iterate on the templates (currently a linked list), so we add a visit method explicitly visiting the expression in all the needed places. Fixes: QTCREATORBUG-21869 Change-Id: I47733544bfd32eec357810b97242608b8f7de572 Reviewed-by: Eike Ziller <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* | Merge remote-tracking branch 'origin/7.0'Eike Ziller2022-04-221-1/+13
|\| | | | | | | Change-Id: I01ce83a2da66bb65af37c0ecc92372789cb85c01
| * QmlJS: Fix more invalid M325 casesChristian Stenger2022-04-221-1/+13
| | | | | | | | | | | | | | Fixes: QTCREATORBUG-27380 Change-Id: I76d1ef3d2f2a4cc9d930a006ecb3b564efea3fbc Reviewed-by: <[email protected]> Reviewed-by: Fawzi Mohamed <[email protected]>
* | Merge remote-tracking branch 'origin/7.0'Eike Ziller2022-03-281-1/+2
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri src/plugins/studiowelcome/recentpresets.h src/plugins/studiowelcome/userpresets.h Change-Id: Ie573b945eb28347a36ee1b3582fbd6ab0c0f866c
| * QmlDesigner: Add invalid ids to QmlJSCheckThomas Hartmann2022-03-241-1/+2
| | | | | | | | | | | | | | Also improving document message for exceptions. Change-Id: I7878987ce73f5d4891ced3c702c7804b25b07eb3 Reviewed-by: Miikka Heikkinen <[email protected]>
* | qmljs: correctly handle js string templatesFawzi Mohamed2022-03-211-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In most cases we do want to visit the expressions in a function template. Changing its accept0 would force those not wanting to visit it to iterate on the templates (currently a linked list), so we add a visit method explicitly visiting the expression in all the needed places. Fixes: QTCREATORBUG-21869 Change-Id: I47733544bfd32eec357810b97242608b8f7de572 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: Henning Gründl <[email protected]>
* | Merge remote-tracking branch 'origin/7.0'Eike Ziller2022-02-141-1/+13
|\| | | | | | | Change-Id: Iab67dffe64bee391bd921ed8832bb17b36ec861b
| * QmlJS: Soften strict equality check Pt IIIChristian Stenger2022-02-111-1/+13
| | | | | | | | | | | | | | | | | | | | Adapt to differences Qt5 vs Qt6. Fixes: QTCREATORBUG-25917 Change-Id: Ieee1cf0442016c62b82bd932dd62d0dc9a78bc26 Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: <[email protected]> Reviewed-by: Fawzi Mohamed <[email protected]>