Commit Graph

1289 Commits

Author SHA1 Message Date
Leander Schulten
7e526d9b05 QmlJs: Fix reformatter for arrow functions
Fixes: QTCREATORBUG-23019
Change-Id: I6c6bee7092cb12f225ad744df2b3834dfd4bbc8f
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2020-12-17 12:17:20 +00:00
Thomas Hartmann
3838bb4e08 QmlJS: Fix resolving of implicit dependencies
If the QtQuick import was less than 2.15 implicit dependencies
were not properly resolved.
For example if a type from a module derives from QtQml.QtObject.

Change-Id: I42a3320ee91496da0991de2018efcd124d56f6cd
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2020-12-03 07:34:40 +00:00
Fawzi Mohamed
054e3fa28f qmljs: actually fix incorrect condition
Suppress error message if either the current or the sub import are
optional.

Change-Id: I6ab8592c6aa8b20576bfa897e432d317f8a7e3b5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-11-27 08:26:47 +00:00
Fawzi Mohamed
596e0c9fcb qmljs: avoid compiler warnings
Change-Id: I6640d461abb010ff694dfd06e1fe039f69338cc4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-11-26 13:34:26 +00:00
Fawzi Mohamed
6d8c1bd388 qmljs: fix wrong condition in import resolving
Change-Id: Ie6e0d3a5cbd97a9d15dc74b553bdc17d7d039bea
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-11-26 13:11:53 +00:00
Fawzi Mohamed
5ce8cf70e8 qmljs: Fix parsing and and loading of qmldir imports
Add most changes to the qmldir parser of Qt6. This is not a direct
application of the changes because they rely on changes to QtBase that
are Q6 only.
Ignore load errors of optional dependencies.

Fixes: QTCREATORBUG-24772
Change-Id: I0b85818b602c8c7c1712e52318b4ca3f15364cc5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-26 11:14:26 +00:00
Tim Jenssen
01d509a100 qmljs: improve code a bit
Change-Id: Iea7bdb5c1a0340b60a3e9efd1e9369403af4fabd
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-11-17 08:31:48 +00:00
Jarek Kobus
6d5e302157 Use typed syntax in calls to QMetaObject::invokeMethod
We do it wherever possible. Some places can't be fixed
since they still rely on dynamic introspection
(mainly QQuickItem cases).

Change-Id: Ia00b4a04d8b995c9a43b7bf2dbe76a60364bb8ca
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-16 13:45:02 +00:00
Miikka Heikkinen
d661c2ed12 QmlJS: Ensure QtQuick is the first import
Some items will show empty property panel and cannot be reparented
in QmlDesigner if the module that defines the item is imported before
QtQuick module. This fix ensures QtQuick module is always imported
first.

Change-Id: Ie610fef681f5bf0ac62d1b879bb9306d4f7d293b
Fixes: QDS-3115
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-16 09:36:15 +00:00
hjk
eb45b8f9b9 Avoid more uses of non-explicit QChar(int) constructor
Will be gone in Qt6.

Task-number: QTCREATORBUG-24098
Change-Id: Id76b15bb11879b2e8ff0f71af45acbfb1720f763
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-10 12:27:36 +00:00
Jarek Kobus
34c97ac868 Fix a build with Qt 6
In Qt 6 implicit conversion between QFuture and other types
is forbidden. Make it explicit instead.
See ff0ba7e2d7b91fd5809cb314935a1ca1a436f6c9.

Change-Id: Ie42e6b9b5047ba5eeec9f63fd03179e73f95314d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-05 08:46:43 +00:00
Eike Ziller
5e67bc5055 Fix build with Qt6
Add missing includes for "incomplete type" issues.
Remove usage of QDesktopWidget.
Don't compile native WebKit help backend (missing native widget integration).
Add SvgWidget dependency.

Task-number: QTCREATORBUG-24098
Change-Id: I1b3afb54d385940ff283824870fa7454866212a4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-26 08:44:21 +00:00
Alessandro Portale
c68f49fefa Remove unused private functions
As found by Cppcheck.

Change-Id: I697ea69992425ff41e35990ad00be312b35ba70a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-08 09:06:02 +00:00
Eike Ziller
8b031c8c05 Merge remote-tracking branch 'origin/4.13' into master
Change-Id: I3f2a6c553819e992da7e9f538dc44b95b482359e
2020-10-02 10:47:07 +02:00
Fawzi Mohamed
1b134a6909 QmlJS: accept import without version
Since Qt 6 import without version are accepted and should import
the latest version.

Change-Id: Id98bd0f7664dd77b30b9c91ee153fccc4160fc6d
Fixes: QTCREATORBUG-24533
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-10-01 12:35:22 +00:00
Fawzi Mohamed
89c8021c5c QmlJS: fix reformatting of required properties
Fixes: QTCREATORBUG-24376
Change-Id: I9ebe66f881575ce8e58cee46d34c3ff8da55ef9c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-10-01 08:47:14 +00:00
Fawzi Mohamed
eddf2bead8 QmlJS: fix operator << of Trie to QDebug
Change-Id: I0a540c7b1842fff9652a7ced01697eae2e90b0e0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-09-30 07:09:36 +00:00
Fawzi Mohamed
45716a4ccc QmlJS: set and propagate qtVersion in ProjectInfo
Change-Id: Icbeb3679c8a76c111a5e3503b2c496c28c830342
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-09-29 14:24:14 +00:00
Eike Ziller
4dc9d92b1e Remove unneeded QStringList forward declarations
Fixes build issue with Qt6, for which QStringList is now a
QList<QString>.

Task-number: QTCREATORBUG-24098
Change-Id: I0c81aa5bae413b836dbedea0bb6117b46f6f24c2
Reviewed-by: hjk <hjk@qt.io>
2020-09-29 08:58:12 +00:00
Thomas Hartmann
f1c9f8e628 QmlJS: Do not change strings referenced by QStringView
QStringRef is stable under reallocations of it's string()),
while QStringView is not.

This adds the missing changes from qtdeclarative 1b10ce6a08e.

Task-number: QDS-2825
Change-Id: I120a34153424ea514abaa783f1a617ef2f8b4cf4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-24 16:00:54 +00:00
Alessandro Portale
dc1439dedd CMake build system: Propagate less target dependencies and includes
...and thereby have less include paths per compile unit.

Change-Id: I70de8db12d881ea827595ca0cacaea13b5c0f3bd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-21 10:53:12 +00:00
Eike Ziller
cf2a651c3b Make QmlJS(Tools) build with Qt5 & Qt6
Port from QStringRef to QStringView

Change-Id: I472d16f20e40ca52b8e5d481850a6bd8a1a38f3b
Reviewed-by: hjk <hjk@qt.io>
2020-09-17 09:37:23 +00:00
Eike Ziller
5ad724c61b Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	src/plugins/qmakeprojectmanager/qmakeproject.cpp

Change-Id: Ieb1c3e946f11d3c4fa1ee6b5afdf83cc532d8aed
2020-09-17 10:28:19 +02:00
Thomas Hartmann
f641434ec1 QmlJSCheck: Fix crash
Task-number: QDS-2766
Change-Id: I4b0e81b8104ac35a286a318e87e95ea022ed66f6
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-09-14 12:21:49 +00:00
Orgad Shaneh
e504d96934 Merge remote-tracking branch 'origin/4.13' into master
Change-Id: I8a2dca29595a0770f4162786b15a145f3f4133af
2020-09-04 16:11:12 +03:00
Thomas Hartmann
356acf16b8 QmlJSCheck: Workaround for ListElement
When editing QML there are false positives reported
for ListElement.

Task-number: QDS-2602
Task-number: QDS-2716
Change-Id: If3fc297d6609213448f8353e9406b3f0aaf65870
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2020-09-03 11:22:32 +00:00
Eike Ziller
5183994a30 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: Ibb60b8a7ac531b239bb9c490da843d5cc1a6300a
2020-08-14 13:31:05 +02:00
Christian Kandeler
b19c5969d8 QmlJS: Fix crash
Fixes: QTCREATORBUG-24477
Change-Id: I45ab28fd11d8c9e51fb3b537a677620ecee5985b
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2020-08-14 08:01:07 +00:00
Robert Loehning
0f7447e1b1 QmlJS: Remove redundant white space
Change-Id: Ic999c6ca85b8f5bbbc9d4a808805196006dbe60c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-08-10 17:04:26 +00:00
Eike Ziller
3944162039 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
	src/plugins/cmakeprojectmanager/cmakebuildstep.h
	tests/auto/debugger/tst_namedemangler.cpp
	tests/auto/qml/codemodel/check/tst_check.cpp

Change-Id: Iefd5f71c03c0078513b76a92af764a4fb22ee4c2
2020-08-10 15:56:54 +02:00
hjk
f41f153882 Adapt qmljslexer to Qt base change caa40f57d4d
qstrtod is no longer exported.

This effectively reverts commit 149cc3af6 as it causes an explicit
dependency on private headers, leading to more problems downstream
than the implicit dependency using the declaration.

Change-Id: I93a9cfc6e440b20d6bed51504bb8004fd67f341c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-08-10 07:45:17 +00:00
Thiago Macieira
149cc3af6b Fix build with Qt 6: qstrtod is an inline function
Change-Id: Ib620871532484bcaa43cfffd1628d6bf0f93fd78
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-08-08 16:50:37 +00:00
Fawzi Mohamed
2ad89747c4 qmljs: qtdeclarative change 9ab1a6759018b78b0f160c5286f8b0235a34ec50
Support required list properties

The corresponding rules were missing so far.

Fixes: QTBUG-85716
Change-Id: Iaf0cbfbb8736929a213bd6bf329bb2ebdde652c4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-08-03 06:59:36 +00:00
Fawzi Mohamed
1ea9d6ce87 qmljs: fix unreachable test for catch clause
Change-Id: Ica1ff034b88f06849026957c8beed2cda77badcc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-08-03 06:31:08 +00:00
hjk
43b658e9e7 Utils: Drop Utils::SkipEmptyParts again
We require Qt 5.14 nowadays.

Change-Id: Iff245257d3cb19207007c0445ee13814e66152dd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-21 12:42:27 +00:00
Christian Stenger
6e29adaae7 QmlJS: Replace QRegExp by QRegularExpression
Task-number: QTCREATORBUG-24098
Change-Id: I70157bcbee67cf493e28b5bad97248877a25e5c6
Reviewed-by: hjk <hjk@qt.io>
2020-07-20 10:23:52 +00:00
Eike Ziller
b18711da91 Merge remote-tracking branch 'origin/4.12' into 4.13
Conflicts:
	share/qtcreator/debugger/lldbbridge.py

Change-Id: Ia444f6424fb35b9a539e157afcee868161535272
2020-07-06 16:23:13 +02:00
Christian Kamm
2c2cd08761 QmlJS: Fix codemodel reset
The QML import paths weren't scanned for modules when the code model was
reset.

Task-number: QTCREATORBUG-24082
Change-Id: If818ebf4ef123529e5fe8de40e6b5d0154c84680
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2020-06-30 08:57:28 +00:00
Tim Jenssen
b8cd87dea0 Merge remote-tracking branch 'origin/qds-1.59' into 4.13
Conflicts:
	src/plugins/clangformat/clangformatplugin.cpp
	src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp
	src/plugins/qmldesigner/qmldesigner.qbs

Change-Id: Ie4a0beeb9fd32ac9683f4e8769988a9c3f3e369a
2020-06-26 16:51:22 +02:00
Tim Jenssen
5a06305ffe qmldesigner: enable Transion in QmlUi files
Change-Id: I2e35e8a2dc7b946297c70fd775bd3e3366295271
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-26 12:38:18 +00:00
Thomas Hartmann
ad17ea9611 QmlJS: Fix false positives for Connections
Connections and ListElement are in the QtQml scope,
when using type information from Qt kit.

Change-Id: I6236a317117e15f4b68c0642186bfdb91d0c92db
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Christian Kamm <mail@ckamm.de>
2020-06-25 08:10:43 +00:00
hjk
54575fe42d QmlJS: More Qt6
Mostly QRegExp, one QHash::unite.

Change-Id: Ia2816fee65b9459c0f89419161f44c38cd572c36
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-19 07:13:06 +00:00
Eike Ziller
8b8ecfa28f Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/cmakeprojectmanager/fileapiparser.cpp

Change-Id: I39f8c2be859be043f506bef77de9bb5b42d38165
2020-06-15 11:30:34 +02:00
Christian Kamm
39ad832686 QmlJS: Resolve missing QEasingCurve prototype
This helps with resolving QEasingCurve's prototype, which is only
available once QtQml has been loaded.

Task-number: QTCREATORBUG-24142
Change-Id: Icb19491071c195c16c527bd206ffdea6f5806b4e
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-12 12:24:37 +00:00
Miikka Heikkinen
7f4bf437da QmlJS: Add a way to return just the context of the project of a file
Added ModelManagerInterface::projectVContext() method to return just
the context of the project the file belongs to and nothing more.

To make this possible, fixed caching the file-to-project relationships
and removed automatically adding the currently active project to
list of projects the file belongs to in allProjectInfos().

Task-number: QDS-1495
Change-Id: I949c0202d0280264b6856562a2e7abc2f93d13c0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-06-11 12:42:20 +00:00
Christian Stenger
ba580bba83 QmlJS: Fix line number for string literals (Part 2)
Amends 626807c94e. Scanning the strings appears differently if
using multi-line strings and using the line terminator at the beginning
of a string or having already some characters present.

Fixes: QTCREATORBUG-23777
Change-Id: I840a11e3b0e06adda443849f926189bda9dc2e4b
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2020-06-10 13:07:23 +00:00
Christian Stenger
f4157e81d2 QmlJS: Fix superfluous whitespace
When dragging a property on itself inside a "oneline" item
Qt Creator prefixes a single whitespace even if it contains
already whitespace(s).

Change-Id: I3028d8c44d9b91d51c96a6d363e48a877a6a78da
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-06-09 12:29:08 +00:00
Miikka Heikkinen
9b91b51285 QmlJS: Return correct default value for vector*d builtin types
This fixes the warning that comes when using "myvec.x: 10" style of
defining  qml vector*d properties.

Task-number: QDS-2189
Change-Id: If77373a4dd8483b65dd782502efb774b95844583
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-09 12:21:54 +00:00
Christian Stenger
128341d4e2 QmlJS: Fix possible duplicate semicolon
When dragging a member inside or onto a "oneliner" item a
duplicate semicolon can appear which makes the code invalid.

Fixes: QTCREATORBUG-12560
Change-Id: Ifa824a64b951fde879625d321dfae48e167a9227
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-06-09 09:37:29 +00:00
Eike Ziller
c644e7c80a Merge remote-tracking branch 'origin/qds-1.59'
Conflicts:
	src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
	src/plugins/qmlpreview/qmlpreviewconnectionmanager.cpp

Change-Id: Ifa7c66330c1995378280cdb4c57c30015dc11b68
2020-06-08 16:04:15 +02:00