Commit Graph

6274 Commits

Author SHA1 Message Date
David Schulz
33359883f2 Fix qbs unittest build
Change-Id: Ifb7f564217921c9907dd7e300bc1c31ad7ae1536
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-03-30 10:25:00 +00:00
Marco Bubke
710b96cc89 Sqlite: Value can now handle blob too
This can be quite handy if we want to handle images in the database
dynamically.

Change-Id: I76b87d6b59e999b043bb2335192c90a371187431
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-03-30 07:30:08 +00:00
Marco Bubke
393c65e34e Sqlite: Use std::byte
Change-Id: Ie5bdbae67f7d0f9e533ad20ddb66d03057df2028
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-03-30 07:30:02 +00:00
Marco Bubke
7785a3a651 Sqlite: Move result count to class declaration
It move the magic number of column results to the sql statement
and improves the mock a little bit.

Change-Id: I101067444cf27ec5dea0c72de7fd484a7e8710f0
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-03-26 12:24:37 +00:00
Christian Stenger
98ac237b7f Unittest: Rename test cases to reflect their content
Amends b746a3e562.

Change-Id: I96e37d31be7efc72533c767c882ffa62967e7a6c
Reviewed-by: Tom Praschan <tom@praschan.de>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-03-22 19:59:35 +00:00
Erik Verbruggen
5ad724a3ac Support for QML module mapping
QUL uses module mapping for theming of QtQuick.Controls: during
code-generation the compiler is pointed to the Controls implementation
it should use. This is done by rewriting any import of QtQuick.Controls
with the given module name. The CMake build scripts will write a file
for each target to the directory "qml_module_mappings" in the build dir,
and those files will contain the mappings used.

Fixes: QTCREATORBUG-25356
Change-Id: I3f74897836dde7717b03bd6dffa46dcc0689ffdd
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2021-03-19 10:43:23 +00:00
Alessandro Portale
93fbd5be02 Remove dead code "< QT_VERSION_CHECK(5, 14, 0)"
Qt Creator required Qt 5.14 or higher. Let's removed the #idef-ed code
for building against lower Qt versions.

Add a comment in porting.h where we still need such code for sdktool.

Change-Id: Ib330275208eec4a2f285b4b9f480530c171f538a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-18 19:12:39 +00:00
Christian Stenger
b746a3e562 Unittest: Fix expectations
Amends 5fcd52fe83.

Change-Id: I68ce291176ab8e095b09ae6f0d64d2564e52cf0f
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-18 10:49:48 +00:00
Eike Ziller
5c713d624c Merge remote-tracking branch 'origin/4.15'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: I309fe2a4ea7afac85481fc6466a9a6e58e340019
2021-03-18 09:41:37 +01:00
Eike Ziller
62011851ae Merge remote-tracking branch 'origin/4.14' into 4.15
Change-Id: Ie467c5d63420041a9acffeb4a726130988ec0f41
2021-03-18 09:29:51 +01:00
Eike Ziller
4151f091e3 Merge remote-tracking branch 'origin/4.15'
Change-Id: If0dbebdf37b0ffea2528bf6ce6d34d88554f8dfb
2021-03-16 10:55:54 +01:00
Christian Stenger
da53e3f994 Squish: Allow automatically created kits
Linking to Qt makes the respective configured kits become
auto detected and these have a fixed Qt.
The Qt version combo box for these kits is disabled on the
Kits page, so be more relaxed when checking kits page.

Change-Id: Ieb7e22b47bd5e5c5603e85dc0ddf2421427e85d6
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2021-03-16 07:11:26 +00:00
Christian Stenger
412b661672 Squish: Correct hitting "Do Not Show Again"
Original implementation just made it work for the common use case.
If the order or the selected buttons differed from the common case
this failed.
Beside this it is later on more easily to extend.

Change-Id: I581b0af2579fa728a81b9946028ade5559f17fd8
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2021-03-16 07:10:53 +00:00
Robert Löhning
2ec094b419 Squish: Prepare for clang > 9
Change-Id: I4cf6e8be63568d56388b0cf87ae692735bf4c113
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-15 09:53:55 +00:00
Eike Ziller
bce64778c5 Merge remote-tracking branch 'origin/4.15'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qtcreator_ide_branding.pri

Change-Id: I009308451e1c6276692412f498125d79a8f12a07
2021-03-11 14:10:14 +01:00
Christian Stenger
2b5f7316ac Tests: Work around problems in execution of dumper tests
On several machines the QDir test interferes in a not yet known
way and makes all following tests fail. Moving it to the end
makes the problem vanish.

Change-Id: Ic8e7fdaaf9581be0cdd5666c7d2f12a2e8ed80ee
Reviewed-by: hjk <hjk@qt.io>
2021-03-11 09:05:04 +00:00
hjk
b4de69795f Debugger: Mark elision of long QUrls in Locals and Expressions
Fixes: QTCREATORBUG-25404
Change-Id: Ieee42f9239c9ffe88da03765678e1d2c4b6bb11d
Reviewed-by: David Schulz <david.schulz@qt.io>
(cherry picked from commit 6df27ccbe7)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-03 08:25:25 +00:00
David Schulz
d17277b546 LSP: reduce error handling complexity
Instead of checking recursively every possible object just check the
required keys for an object and validate it on construction or
assignment from json.

This will reduce the implementation effort for protocol extensions and
also reduce the false positives we might get if the protocol gets
updated.

Change-Id: I3df24e62430d2c7575d26c1581e6a9606e7da4c1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-02 12:51:47 +00:00
hjk
6df27ccbe7 Debugger: Mark elision of long QUrls in Locals and Expressions
Fixes: QTCREATORBUG-25404
Change-Id: Ieee42f9239c9ffe88da03765678e1d2c4b6bb11d
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-02 09:13:34 +00:00
Fawzi Mohamed
9e4e44d180 qmljs: preserve default arguments when reformatting QML
Fixes: QTCREATORBUG-23009
Change-Id: I9949fe26a91a063c4804fddcca4e26d14bc5cd61
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-02 08:29:42 +00:00
Fawzi Mohamed
0ff75a721f qmljs: reformat inline components
Fixes: QTCREATORBUG-25381
Change-Id: I472105cd6436d4d0ae7369880c332b8f4a2321ad
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-02 08:29:29 +00:00
Fawzi Mohamed
c57f6a703b qmljs: correctly handle required and readonly properties
* correct indentation after required property QTCREATORBUG-24144
* handle required <name> statement
* allow default readoly required reordering
* more permissive than the actual parser (which then will show errors
for invalid sequences)
* backport form QmlDom

Fixes: QTCREATORBUG-24144
Change-Id: I19166ca65d108d533a1ed3748c09e35bcfdbc56d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-02 08:29:13 +00:00
Eike Ziller
0f5b6c82ee Merge remote-tracking branch 'origin/4.15'
Change-Id: Ifae18bacb0c4bdb1e0516c9f92c0fd16150e35e6
2021-03-01 09:56:20 +01:00
Eike Ziller
eaa4592b63 Merge remote-tracking branch 'origin/4.14' into 4.15
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: I892ea0c3b42f61b9cd24fa5508ec181d8d245d29
2021-03-01 09:49:45 +01:00
Christian Kandeler
a995a4633f CPlusPlus: Do not mis-classify bitfield declarations as initializations
Fixes: QTCREATORBUG-25390
Change-Id: I1976b7db2996f5a09db73adbd127aac9ab92d57d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-25 15:55:54 +00:00
Fawzi Mohamed
bd05384765 qmljs: handle string templates in scanner
* add (multiline) template string support
  templates can be nested, which means that the scanner/lexer cannot
  be a simple state machine anymore, but should have a stack to store
  the state (the number of open braces in the current template
  string).
  The lexer stare is currently stored in an int, so we abuse that and
  store a the number of open braces (maximum 0x7f = 127) for at most 5
  nested templates in the int after the flags for the multiline
  comments and strings.
* improve representation of delimiters (==, <=, ||,... not split in
separate delimiters)
* (QmlDom backport)

Change-Id: I2b4d23b65febedef29a748f4c5f377fde27bd7fd
Fixes: QTCREATORBUG-22766
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-25 08:37:12 +00:00
Christian Stenger
de04f29198 Squish: Wait for the docs update progress bar
Change-Id: I73e80119a7e5a8d09397138d1301154af597f907
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2021-02-25 08:02:37 +00:00
Fawzi Mohamed
c0f9f29097 qmljs: correctly reformat js spread operator (...)
Fixes: QTCREATORBUG-23402
Change-Id: I6b4bd0846dac67116711b7ed046bd52d137b7674
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-23 12:38:55 +00:00
Eike Ziller
768d4321f9 Merge remote-tracking branch 'origin/4.14'
Change-Id: I214b8d59e8ff7fe0511cd6116ec7725ddc4376ee
2021-02-18 09:26:22 +01:00
hjk
34945f84e4 Debugger: Use a class for GdbMI parser parameters
Currently only the previous from/to pair, but can be extended
by codec state.

Task-number: QTCREATORBUG-24462
Change-Id: I3d101e74d1fef65bb75ddaab1dc2eaf77201dcde
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-18 06:07:36 +00:00
Christian Kandeler
dfa24f09ad ClangCodeModel: Show only valid applicable overloads when completing
libclang is smart enough to filter the overloads according to which
arguments have already been entered, so let's make use of that.

Fixes: QTCREATORBUG-650
Change-Id: Ic2711f460c908c6fd9c8efe28c3c63a0ce2d9205
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-17 07:09:37 +00:00
hjk
9c9ca280ea Debugger: Add some manual test to check console interaction
Change-Id: I02a87657f5be1c4ba8ab8921d0d015a8f34df0af
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-17 06:31:02 +00:00
Christian Kandeler
74177a559e clangbackend: Work around libclang cursor bug
... involving accessing the member of a nested anonymous union from
within the surrounding class. libclang reports a CXCursor_CXXThisExpr
for this location instead of a CXCursor_MemberRefExpr. However, the
latter is still locatable in the AST, so we can correct this.

Fixes: QTCREATORBUG-25342
Change-Id: I1eba13d5153205a52b3689d8ad52493a56b76c07
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-15 12:18:36 +00:00
Marco Bubke
e3d12e659a Sqlite: Add readTo method
There are cases when you want to read to an already existing container.
This will prepare for the RETURNING extension in the next Sqlite version
where you can write and read. That will simplify quite some code.

Change-Id: I740ffbedecf72bb5518392f3707a0a6b2221db56
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-15 10:39:45 +00:00
Marco Bubke
18fe4233f8 Sqlite: Add callback method
Sometimes it is better to have a callback instead of returning a container.
The call has to manage the state if an exception is called but otherwise
it will reduce the memory footprint. There will be to a RETURNING
to Sqlite which will read back values as you write.

Change-Id: I7eb49850e2c76f883a03277b31c5e713e9774c92
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-15 10:39:30 +00:00
Christian Kandeler
5f5f38e028 ClangCodeModel: Support "parentheses" matching for ternary operator
That is, show which ":" belongs to which "?" when the cursor is on one
of them.

Fixes: QTCREATORBUG-1410
Change-Id: Ie19360b3dfc82d92c264d99a5aa1864eda66e5c8
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-11 08:52:17 +00:00
Christian Stenger
ec9a72808f Tests: Fix pluginspecs test for cmake
Change-Id: I700bd9cbcdabfa08863ffb727a084a9339e660d5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-10 05:24:38 +00:00
Christian Kandeler
058841e8de Locator: Enable to show C++ type aliases
These were not showing up in any global symbol list so far.

Fixes: QTCREATORBUG-5800
Change-Id: I8e5c3b9b26f09d8cbcd31431e28c103da05d9bf8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-09 10:00:56 +00:00
Christian Stenger
ced96a480d CMake: merge binary directories of sub projects
...into top level. Exceptions are applied explicitly.

Change-Id: I59c54967dffc0bef2e8cc05c73763fcf18c12517
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-05 14:09:12 +00:00
Christian Kandeler
59d24fa268 Fix warnings about unused variables
Change-Id: I0bb76529a28c4288967cb79972c1863a0b1c84c6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-05 08:51:44 +00:00
hjk
a5b93b54c8 CPlusPlus: Add missing line and column info for lambda functions
Task-number: QTCREATORBUG-25242
Change-Id: I5032bb04879e30f5516471e2038dc4b6bb3477f8
Reviewed-by: hjk <hjk@qt.io>
2021-02-05 08:51:09 +00:00
Christian Kandeler
bcde1ead55 Fix qbs build
Change-Id: I2e5e385a938343b2dbc487f79e3cf6c7fb2199fa
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 16:54:42 +00:00
Fawzi Mohamed
7015ef04b7 qmljs: add check for comparisons not depending on values
currently we mainly try to warn about primitive == null/undefined or
primitive === non primitive.
There are other that we could warn about null==null null==undefined,
but I feel that they might be triggered too much by clean code.

Change-Id: Id43d838d60a4e13f361be34e4bb38211777a081e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 14:05:16 +00:00
Fawzi Mohamed
cc00af8334 qmljs: fix qmljscheck
* fix ASTVariableReference::value: correctly get reference value type
by using either initialiser of bindingTarget (broken since a codemodel
update in 2018)
* disable warning for casting in bool to null comparison (it does not
cast, is always false)
* fix property checks (where skipped without default of readonly)
* remove non relevant checks (ErrInvalidPropertyType for lowercase  now that custom
value types are supported, and for properties called data)
* updated import version

Change-Id: I38407acf327d0f773b38dda4c02fb4d95a420851
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 14:03:44 +00:00
Fawzi Mohamed
5c1cbf6b3f qmljs: support inline components
* add inline components to bind.
* inserts inline components in the component that contains them (makes
  Context:lookupType simpler)
* unify Context:lookupType overloads without adding extra heap allocations
  using a template (avoid code duplication)
* add tests for inline components
* warn about nested components
* use model manager to load dependencies in tst_check (old test did
  not load dependencies and simply skipped all checks on imports)

Fixes: QTCREATORBUG-24766
Fixes: QTCREATORBUG-24705
Change-Id: Ibcade7752cdaa08e960f66db3a724ab7fb3268cf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 09:53:08 +00:00
Fawzi Mohamed
b8d99af6fd qmljs: fix arrow function reformatting
This is mainly just making sure that token that are "empty" are really
empty (to avoid writing them out in the reformatter), but still
contain the correct location (for error messages using for example
firstSourceLocation()).

Introduce a SourceLocation::zeroLength() method to make this change
simpler to do.

QtCreator does not run qlalr automatically, so it is "polluted" by the
updated generated files.

Fixes: QTCREATORBUG-25198
Change-Id: I0ab19fb380ee3d9a7d9e05d104fe313468f52703
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 09:52:40 +00:00
Marco Bubke
e34eb170dc QmlDesigner: Add an reason parameter to the image cache abort callback
Sometimes we abort the request, sometimes it failed. In the first case
we maybe want the cancel the imageprovider request, in the second we
return an empty image.

Fixes: QDS-3388
Change-Id: Iaef76aa09ac734795f86447e1a7cf6a5c7b5ae81
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
2021-02-01 16:24:16 +00:00
Marco Bubke
62582877f6 QmlDesigner: Fix flacky test AsynchronousImageCache.WaitForFinished
Change-Id: I94afa8ec2925b85f5dbf44e7b2ad5db484f48148
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-01 16:06:23 +00:00
Marco Bubke
6a0cfc0c6e QmlDesigner: Fix flacky test ImageCacheGenerator.WaitForFinished
Change-Id: I7c08ec68d20a54e125805ad98f87879c99b1aad3
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-01 16:06:19 +00:00
Marco Bubke
1cf09e5979 QmlDesigner: Compress generator tasks
A document change can generate new image request and if the are not in the
database new task for the collector are generated. But if there are already
tasks for an equal id they would generated twice. So the tasks are now
merged. The auxilialry data is not merged because it is expected that
it is not changing.

Task-number: QDS-3388
Change-Id: Id1aceb564dd9dc7c5a1ea5ae4680d7ee36611cda
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-01 16:06:13 +00:00