Commit Graph

1494 Commits

Author SHA1 Message Date
Vikas Pachdha
f1b5fb6e11 Add interface to check incompatible qml ids
Task-number: QDS-10121
Change-Id: I112bee4e9323dc4eff30ec7a4693c1e9632d6ba9
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-07-21 09:31:43 +00:00
Tim Jenssen
48230d63b8 Merge remote-tracking branch 'origin/11.0' into qds/dev
Conflicts:
 src/plugins/qmldesigner/CMakeLists.txt
 src/plugins/qmldesignerbase/CMakeLists.txt
 src/plugins/qmlprojectmanager/CMakeLists.txt
Change-Id: If706ae3fe7a7d0e17036ce6285bec772d1f6127d
2023-07-04 16:22:32 +00:00
Semih Yavuz
012f984c27 Restrict M16 warnings
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: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2023-06-27 07:21:58 +00:00
Tim Jenssen
846f8dba92 Merge remote-tracking branch 'origin/11.0' into qds/dev
Conflicts: src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.cpp
  src/plugins/qmldesigner/components/stateseditornew/stateseditorwidget.cpp
  tests/unit/unittest/qmlprojectmanager/projectitem-test.cpp

Change-Id: Icdb63851ec0162d82217e85b3beb0b6f9f12899e
2023-06-22 14:50:56 +00:00
Christian Stenger
ca8066251e QmlJS: Fix compile with Qt6.2
Change-Id: I3f386e1a51f821f55a0eb6df929ebdd7ee3fa9f7
Reviewed-by: hjk <hjk@qt.io>
2023-06-20 11:41:08 +00:00
Christian Stenger
97a97b3019 QmlJS: Fix initializing static analyzer
...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 427640063e.

Change-Id: Idea560176b0a9caa93dca7a3a2d01cc3aa3a6d2f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-06-12 12:05:04 +00:00
hjk
3d4621c531 Utils: Fix compilation with namespaced Qt
Change-Id: I5e9ce4a637672fece8884d88c87fc8aaee7d9cc3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-12 11:50:29 +00:00
Tim Jenssen
66263782ec Merge remote-tracking branch 'origin/11.0' into qds/dev
Conflicts:
  src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp
  src/plugins/qmldesigner/components/stateseditornew/stateseditorview.cpp
  src/plugins/qmldesigner/designercore/model/qmltextgenerator.cpp
  src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp

Change-Id: I4c8a33736b25c3bb24241224d0a1e7358bb7fd94
2023-06-08 16:35:56 +02:00
Christian Stenger
585eb1c3e4 QmlJS: Switch default enabled state for analyzer message
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 <tim.jenssen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-06-07 10:32:06 +00:00
Tim Jenssen
a6d1b594a4 Merge remote-tracking branch 'origin/11.0' into qds/dev
Change-Id: I79a272471b3400eec0a0fa9fca175d1d4a8c0a13
2023-06-07 12:07:21 +02:00
hjk
9db19c653c All: Replace deprecated QLibraryInfo::location
... by QLibraryInfo::path() which exists since 6.0

Change-Id: I0e1e071e0d279ddaf1f1027a0e6ce350ab21739a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-06-06 14:35:55 +00:00
Thomas Hartmann
90b36d88e2 QmlJS: Add support for annotations in qmljsreformatter
This fixes that the annotations are removed. The indentation
still has issues.

Change-Id: I6752767e00e0fafe8eb567066db3b9952f0d0a4f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-06-06 11:17:46 +00:00
hjk
cfa88ac169 QmlJS: Avoid deprecation warning
de18b3ff370543b5b99bd068b871a2cd677cf9f3 deprecated the
QCryptographicHash::addData(const char *data, qsizetype length)
overload.

Change-Id: I86444a9d7de3cafc596f508fc08c3a4c1f25142f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-06 07:45:27 +00:00
Eike Ziller
6e7bb28f09 Tr: Add missing full stops
Change-Id: I2debc56d0740eaa30c7d597eae18910f319c1d98
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-05-26 13:50:18 +00:00
Semih Yavuz
cd73f8c6b8 qmljsreformatter: don't default foreach type to "in"
Fixes: QTCREATORBUG-29123
Change-Id: I4d3a611c359946c4483388cbf18a0b6f16d0a8d6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-05-08 07:39:26 +00:00
Christian Stenger
427640063e QmlJS: Allow disabling static analyzer messages
Provide settings to define a customized set of enabled
static analyzer messages.

Fixes: QTCREATORBUG-29095
Change-Id: Id629e383dd9e3beeef98026759ac66716dc43d23
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-05-04 10:49:07 +00:00
Jarek Kobus
a0f6e8dc04 Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}
Follows QtcProcess -> Process rename.

Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 05:52:26 +00:00
Jarek Kobus
470c95c94b Utils: Rename QtcProcess -> Process
Task-number: QTCREATORBUG-29102
Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-04 05:52:16 +00:00
Jarek Kobus
a3a5b8f806 Utils: Rename asynctask.{cpp,h} -> async.{cpp,h}
Follows AsyncTask -> Async rename.

Change-Id: I37f18368ab826c9960a24087b52f6691bb33f225
Reviewed-by: hjk <hjk@qt.io>
2023-05-03 13:24:20 +00:00
Christian Stenger
5bc60ac8de QmlJS: Stop suggesting versions for imports if possible
Fixes: QTCREATORBUG-28649
Change-Id: I918b229855c18519800a54a73b56eaffa40524e5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-24 11:37:58 +00:00
Semih Yavuz
21ca06fc7c Codeformatter: Support indenting of type annotated function
Fixes: QTCREATORBUG-29046
Change-Id: Ie4a4d85b7aa00ddf4dd3ea4bade6ffa57af7b4e0
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-04-20 12:55:40 +00:00
Christian Stenger
ebfcb8af65 QmlJS: Fix compile with Qt6.2
Amends 15a06b77c0.

Change-Id: Iefac198e1d566fcbda77e22bcab289dda15fa1ba
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-18 10:27:32 +00:00
Jarek Kobus
7ab0fd56ae RunExtensions: Move onResultReady and onFinished into asynctask.h
Change-Id: I96dbf5b0253251224ae678172cd5fca12b34326a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-17 09:10:33 +00:00
Semih Yavuz
15a06b77c0 Fix tst_qml_reformatter auto test
Add source location to pragma library writer so that the comments before
.pragma line are also written.

Fix tst_qml_reformatter by skipping the blankline comparisons. Line by
line comparison with the non-formatted code is not a good idea to test
 reformatting. Ideally test should have compared the formatted file with
the original one character wise, yet it is not worth changing into that
at this point.

Amends 0ce57fcf5e90f8bf8cfbe681f2954a0c1ef0e945

Change-Id: I39bcee2c881e1a0928c17ebb45aa1c85e6cf3b99
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-14 14:23:14 +00:00
Semih Yavuz
78cf563142 reformatter: fix formatting of js directives
Fix the miscalculation of the start / end of the js directives lines.
Also small optimizations on usage of increment operators. Add a unit
test.

Fixes: QTCREATORBUG-29001
Change-Id: I38923f137dca5c0b89d474cd747a64ec11e62fd9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-04-12 11:50:43 +00:00
Tim Jenssen
adb664f521 Merge remote-tracking branch 'origin/qds/dev'
Conflicts: src/libs/utils/filepath.cpp
  src/plugins/qmldesigner/qmldesignerexternaldependencies.cpp
  src/plugins/qmlprojectmanager/cmakegen/generatecmakelists.cpp
  tests/unit/unittest/CMakeLists.txt

Change-Id: I017a6075db41a5233487ac855ffe23de2b2bb0ee
2023-03-30 13:30:42 +00:00
Tim Jenßen
feabda3aa7 Merge remote-tracking branch 'origin/10.0' into qds/dev
bigger conflicts resolved at:
  src/plugins/qmldesigner/CMakeLists.txt
  src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp

Change-Id: I08e2a109d8e37cbd77225129854e9e633725bfc7
2023-03-26 16:26:18 +02:00
hjk
884a1d6f94 Replace a few \returns by Returns
Change-Id: I09c633e610421f5cc8257b15de60ffa98d890ee0
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-03-24 14:51:55 +00:00
Thomas Hartmann
3b1c9ea882 QmlJS: Take Qt 6.5 into account for Connections
In Qt 6.5 Connections are on QtQml.Base

Task-number: QDS-9492
Change-Id: I07874695367994641126f25148f3425af37b6bf3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-03-23 15:27:43 +00:00
Jarek Kobus
0bec769b69 QmlJS: Use QtConcurrent invocation for async run
Add ModelManagerInterface::importScan() overload to avoid
instantiating dummy QPromise arg on caller side.

Change-Id: Idf836d30b2167d8840cc4e7ac6f95377c9d5622a
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-14 08:47:26 +00:00
Alessandro Portale
9f2f2f3390 Translations: Change translation context prefix from "::" to "QtC::"
lupdate would be confused by translation contexts starting with ::

Change-Id: Ie95e73436fd3cafc80a8e89f908efadc747e644c
Reviewed-by: hjk <hjk@qt.io>
2023-02-10 16:27:55 +00:00
Thomas Hartmann
5e70a0e374 QmlJS: Do not set import as invalid if sub import fails
QtQuick.Controls has sub imports like QtQuick.Controls.macOS/windows
that wil lbe invalid on other platforms. In this case we do not want
to mark the original import as invalid, since it turns
off checks in QmlJSCheck.

Therefore moving the setting to invalid into the block that is only
executed for non optional sub imports.

Task-number: QDS-9094
Change-Id: If0ad4e32c14d608f88b8239f390208e51a93fbd8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-02-10 08:27:40 +00:00
Ulf Hermann
ccbee9bf42 qmldir parser: Handle internal types with versions
There is no reason why internal types cannot have versions.

Fixes: QTCREATORBUG-28755
Change-Id: I419f2e052634b603dfc5b2bfff155167cf6f9304
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-02-08 09:50:00 +00:00
Thomas Hartmann
51864d0808 QmlJS: Allow string::arg() in ui.qml files
Task-number: QDS-9037
Change-Id: Ie91e745ae4d20e0fd96df1d767fc875475a0be7a
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
2023-02-07 12:31:55 +00:00
Alessandro Portale
17b28909a9 QmlJS: Tr::Tr
Excluding the Qml parser, which needs to remain in sync with it's copy
in Qt.

Change-Id: I22f475f265dd74687e3239c4d6916c777798a447
Reviewed-by: hjk <hjk@qt.io>
2023-02-01 13:48:12 +00:00
Thomas Hartmann
0198ed15f3 QmlDesigner: Skip makeComponentChain in TextToModelMerger::load
This is not required in the context of QmlDesigner and can become
very slow.

Change-Id: Id4a4ae30c5fa55e88ed295624365efb724e26f62
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-02-01 09:48:12 +00:00
Alessandro Portale
f46af497e1 Translations: Prefix translation contexts for libraries with "::"
Change-Id: I0631ad6fdc9f341a162d879e54ff09fbdb74398e
Reviewed-by: hjk <hjk@qt.io>
2023-01-26 14:51:03 +00:00
Marcus Tillmanns
414b95cb91 QmlJS: Reduce number of for loops
Removes some unnecessary contains() by using the QSet directly.

Fetch all required paths at once instead of calling generatedQrc(...)
multiple times.

Change-Id: I0a6f65d11d92a4ec4f6655a87e30df6a5c4d6545
Reviewed-by: hjk <hjk@qt.io>
2023-01-26 13:04:26 +00:00
hjk
d6fb9754ca QmlJS: Proliferate FilePath use
Change-Id: Ifd009ef9c6e15506d173727e84dda966d79bdb01
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-01-24 14:15:36 +00:00
Thomas Hartmann
49955964f7 QmlJSCheck: Add missing comma
Change-Id: I5f26cbe50ecb47c088bab8b9cdea49d0103352eb
Reviewed-by: Burak Hancerli <burak.hancerli@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-01-20 10:12:20 +00:00
hjk
4ddd28ae22 Utils: Rename QtcProcess::readAllStandard* to readAllRawStandard*
... and re-use the old QtcProcess::readAllStandard* names for
a QString-returning 'decoded' version.

For now, only use that in 'full Utf8' cases, to stay bug-compatible,
the plan is, however, to employ the QTextCodecs we have already
in the channel buffers. That will be one-by-one, though.

Change-Id: Id209e0671920d4ea4197918e872f441254112d52
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-10 12:08:53 +00:00
Kai Köhne
4e9c1d126c Replace GPL-3.0 with GPL-3.0-only
GPL-3.0 is deprecated by SPDX.

Change done by

 find . -type f -exec perl -pi -e 's/LicenseRef-Qt-Commercial OR GPL-3.0(?!-)/LicenseRef-Qt-Commercial OR GPL-3.0-only/g' {} \;

Change-Id: If316a498e3f27d2030b86d4e7743b3237ce09939
Reviewed-by: Lucie Gerard <lucie.gerard@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-10 08:05:04 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
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 <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Sami Shalayel
dc67907679 Update the qml code model parser
Updates the qml code model from qtdeclarative dev
(commit: 164d8f66d82deea74464c68a2cdd19e5998835da).

Fixes: QTCREATORBUG-28238
Change-Id: I383c98012f1efd56110d43c258fa1b398a6f8255
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-05 15:25:18 +00:00
Eike Ziller
55fa109b59 CMake build: Use version-less Qt targets
Since we do not support Qt < 5.15 anymore, and as a first step
for getting rid of our special FindQt5.cmake.

Change-Id: Icc5dbaf9b0a3a622b1f609ff114b9decb6d2856c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-01-05 10:13:16 +00:00
Artem Sokolovskii
4947c5c657 qmljs: Fix warnings
Change-Id: I4bac76e9d7286fc762af3b097102b3aa975f7247
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-01-02 13:34:52 +00:00
Tim Jenssen
f2956ece11 Merge remote-tracking branch 'origin/qds/dev'
Conflicts: src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp
  src/plugins/updateinfo/updateinfoplugin.cpp
  src/tools/qml2puppet/CMakeLists.txt
  src/tools/qml2puppet/qml2puppet/instances/qt5rendernodeinstanceserver.cpp

Change-Id: I6b65ce2d603453fcebc2291574d55db80853f247
2022-12-22 14:08:46 +01:00
Sami Shalayel
5d6765c08e changeLicense.py: support new license style
Add support for the new licenses (that are commented out linewise via
//) to changeLicense.py that until know just knew about the old-style
licenses commented as /*block*/.

Change-Id: If29c4a49e210cf7516ae93fb1b7ef7e9f5a51f34
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-12-21 13:18:32 +00:00
Artem Sokolovskii
f0556b08b8 qmljs: Remove foreach usage
Task-number: QTCREATORBUG-27464
Change-Id: Ifdb8cf514dfe328e0a64bde1beff3e63a4b7fbc3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-12-21 12:53:41 +00:00
Sami Shalayel
90b8e482c9 qml code model: load builtins import
LinkPrivate::linkImports() would either load the <builtins> or the
<defaults> module, but only process the <defaults> module in
LinkPrivate::populateImportedTypes().

Note: The <defaults> module (from the package '<default>') is the
QtCreator magic replacement for the actual <builtins> modules
(from the package 'QML').

This means that if the <defaults> were loaded, then QtObject would
be recognized as an object from QtQuick.
On the other hand, if the <builtins> were found, then neither
<defaults> nor <builtins> would have been imported and QtObject
would not have been found in the imports (because neither <defaults>
nor <builtins> would have been imported).

The "<defaults>-found" situation happens right after a "reset code
model" while the "<builtins>-found" appears when the qml code finally
found the <builtins> package, usually after running cmake or when a
project was freshly opened in Qt Creator.

Instead, always try to load both <defaults> and <builtins> module.

Also, fix the builtins.qmltypes (that contains the qt creators magic
types) to reflect that Component and QtObject
are both available from the QML package (the <builtins> module), as
else one cannot import QtObject from QtQml after a code mode reset.

Fixes: QTCREATORBUG-28287
Fixes: QTCREATORBUG-28375
Change-Id: I67084a169dc5ca8ec2474b721dbef83cd47037c7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-12-19 13:53:59 +00:00