Commit Graph

6441 Commits

Author SHA1 Message Date
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
David Schulz
785932f0f1 Debugger: improve std::unordered_map dumper for cdb
and fix dumper tests

Change-Id: I1debd25a835aba28d77e5605dc49a5ea01221995
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-29 10:59:23 +00:00
Christian Kandeler
11d1b8bb4c Unit test: Add missing switch cases
Amends d8c1e51bfe.

Change-Id: Ida799fdf3ac8da78c892f4f6823009a33b65340b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-26 09:52:53 +00:00
Eike Ziller
aae3bf4ef7 Merge remote-tracking branch 'origin/4.14'
Change-Id: I516e87eed1b716ec085095c9dd4f47f04a99de7c
2021-01-25 09:06:36 +01:00
Christian Kandeler
bfb63acb09 clangbackend: Fix missing completion for private member functions
... when trying to complete the name of a function definition. libclang
tags such completions as "not accessible", even though we are not in a
call context.

Fixes: QTCREATORBUG-25244
Change-Id: I4b03b1a43be7a85c37c7d2b2bfe2d83112075674
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-22 14:49:54 +00:00
Christian Kandeler
d8c1e51bfe ClangCodeModel: Support highlighting angle brackets
... in template declarations and instantiations.

Fixes: QTCREATORBUG-16799
Change-Id: I82bc6411ca980ecbe2a6c70ae37580166a4b89e9
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-22 10:48:33 +00:00
Marco Bubke
7dc72c533e QmlDesigner: Improve imagecache
Instead of coding some arguments to extraId(state) we provide now a
std::variant there extra arguments can be saved. Because it's a
std::variant it can be easlily extended by new structs. There is a new
synchronous interface too. It has an extra method for QIcon which saves
icons in an extra table. It would be even nicer if we would have a
mipmap image too. So we could do it asynchonously too but so far it works
only in the main thread.

Task-number: QDS-3579
Fixes: QDS-3584
Change-Id: If368d84d82308a91a5f4f037021e749c9ef868ed
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-01-21 13:14:28 +00:00
Eike Ziller
f79e4b3677 Merge remote-tracking branch 'origin/4.14'
Change-Id: Ib343adc6b761d15410d357137e4fc38040ce8d48
2021-01-20 11:13:11 +01:00
Fawzi Mohamed
c532076bfd qmljs: fix tst_dependencies
Fixed the dependencies test.

Now it makes sure that all dependencies are loaded before evaluating
the checks, otherwise a race condition in the link process (QTCREATORBUG-25240) might give problems.
This requires running the event loop to ensure that the invokeMethod
in PluginDumper::loadPluginTypes creates the futures in the model
manager.

Change-Id: I4c0dd5cc948917e2a74fd46c3b66ee3bb5370da4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-20 08:12:21 +00:00
Fawzi Mohamed
d4d5d5db11 qmljs: fix tst_dependencies imports
update imports of tst_dependencies to newer version (for Qt 5.15)

Change-Id: I095200a2fe54a059cd2d69c76b6da08ab8e596a5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-18 14:49:57 +00:00
Christian Stenger
122fdf6e5a Squish: Make another helper tool compatible
Change-Id: I1fc4e268e311c628b541b76ae3a948854635a4a5
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2021-01-18 14:19:30 +00:00
Christian Stenger
18d73f132e Squish: Make helper tool python 3 ready
Change-Id: I42f59a6819467209d46e3830aff6897861c548ef
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2021-01-18 14:19:25 +00:00
Eike Ziller
16d25a3cc8 Merge remote-tracking branch 'origin/4.14'
Conflicts:
	src/plugins/qmldesigner/assetexporterplugin/componentexporter.cpp

Change-Id: If742bcd843cf75cf55e07b489ecb7211f0cd9058
2021-01-18 11:50:32 +01:00
Fawzi Mohamed
45bdb39c6b qmljs: fix tst_importcheck
Mainly update import lists for Qt5.15 and ensure load is complete
before comparing.

Change-Id: I954cc4806d49d1a466f5e558b836ce49eb3693b0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-15 13:55:33 +00:00
Ulf Hermann
663a12e00f Tracing: Fix flamegraph view test
QQC2's scroll view does not allow clicking through the scroll bars even
if they are invisible. That's a shame, but we're not going to fix it in
QtCreator. Rather, choose locations to click on that are outside of the
scroll bars.

Also, wait for the window to be exposed before manipulating it.

Change-Id: I7d8de1a6be7dec88c5d0ac1707341b543e385a9e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-15 13:05:59 +00:00
Christian Kandeler
a42d252054 SSH: Fix non-session based download operation
Apparently this one never worked, but as we don't use it in our own
code, that went unnoticed.

Fixes: QTCREATORBUG-25236
Change-Id: Ia013baf3ca2fd01cc14b72d9c6a5f73426539d00
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-15 10:41:32 +00:00
David Schulz
7fc015aca9 UnitTest: Fix debug qbs build against release llvm
Change-Id: Iadc073f3904123f62b642843bd94935476055555
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-01-08 13:36:10 +00:00
Christian Stenger
b4cc084a98 Utils: Add findAnyChild() to TypedTreeItem
Removes some static casts on the user side.

Change-Id: I0a9ae512f294c0e78e0a5890e557c483af86abfe
Reviewed-by: hjk <hjk@qt.io>
2021-01-08 05:58:54 +00:00
Tim Jenssen
b801a9339d Merge remote-tracking branch 'origin/4.14'
Change-Id: I70504e096be620434f38cd990c593950da8b24ba
2021-01-07 14:23:46 +00:00
Marco Bubke
b11d8aa92a Sqlite: Update Sqlite from 3.31.1 to 3.34 and adapt carray
You can now pass everything you can convert to a span directly and bind it
with a carray instead of using the pointer interface. This is working for
int, long long, double and null terminated C strings.

Change-Id: I274c218e2dec0f11e68576545bb78601f85462bd
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-01-06 14:41:01 +00:00
Eike Ziller
d95e1f940a Merge remote-tracking branch 'origin/4.14'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: I5b8d93f2f08b62626c3f3447728c64d198b601ff
2021-01-04 09:09:21 +01:00
Leander Schulten
771e269a3b QmlJs: Fix reformatter for template strings
Change-Id: Ie0b7909d634d1e2e735377b053f7a1c1c2518f78
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2020-12-17 12:31:48 +00:00
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
Björn Schäpers
8987996500 clang-tidy: Suppress clang warnings
Those warnings should be printed via the clang code model, which can be
fine tuned to (de-)activate warnings. The clang-diagnostic-* warnings
from clang-tidy are not shown in the dialog an thus can not be
selectivly activated by the user.

Change-Id: I80b2cad227a9fd8fa0de253c73c40abfa8076be6
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-12-15 19:38:30 +00:00
Eike Ziller
4bc2b4741d Merge remote-tracking branch 'origin/4.14'
Change-Id: I842a7c7358fd0ff6d85c151806e440043914e09a
2020-12-14 14:19:15 +01:00
David Schulz
93dd966ce2 CMake: add missing Utils dependency to extensionsystem test
Change-Id: I95a518e3ecb098bd39a06f921bfbeb1b6fb0126f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-12-14 12:35:22 +00:00
hjk
c6ae5ab506 Debugger: Relax RValueReference test
Exact output depends on too many factors, just make sure the
base type is there.

Make LLDB+GCC on Linux pass.

Change-Id: I520a8367ab00ee95f87b5d4fb935f3ae21efd820
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-12-14 09:25:41 +00:00
hjk
50b2eb934f Debugger: Disable some static member tests for LLDB
LLDB does not report anything in that case nowadays. Which is actually fine.
Makes StaticMembersInLib and UndefinedStaticMembers pass.

Change-Id: I302ab702e5eacf89fcd08ea1935dbf43e5e56fa8
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-12-14 09:25:32 +00:00
hjk
77993e7b58 Debugger: Fix passing of extra parameters to LLDB dumper tests
As the others do. Fixes the WatchList dumper test.

Change-Id: Id1622f6d405e9e9c9b1f4b0124a7dca74f7e3019
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-12-14 08:55:33 +00:00
Alessandro Portale
dce06016ef Include some existing manual tests in the Qbs build system
Change-Id: Iceb346c42ff798430fb4ee6887b34f89768f014b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-12-11 13:35:11 +00:00
hjk
c4c55955e4 Debugger: Drop some too clever logic from ValuePattern matching
Change-Id: I6e1c89e3637e4408a23584bf71fcf8e2c4d29d7f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-11 12:48:23 +00:00
hjk
d4ed07eb87 Debugger: Change/improve LLDB display of enums in some cases
This fixes the Internal2, EnumFlags and EnumInClass tests on Linux.

The values lose now the previously hand-crafted Class:: prefixes,
but the context is clear from the type column, and it's what LLDB
developers (and potentially users) consider normal.

Change-Id: I09e41f7b4fb4f078ef3f535fe650d06e7c2a0331
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-12-11 11:37:11 +00:00
hjk
14035584d8 Debugger: Fix CharArray dumper and test for LLDB
Change-Id: If12936fa863633b1ca85e712f8395e8ab4a0d69c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-11 09:35:37 +00:00
hjk
5cf60fc38f Debugger: Fix LLDB message parsing in dumper tests
Was off by one, swallowing the first character of the message.

Change-Id: I736cadda2cb6d9e3703d276b631e574c498af874
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-11 09:35:01 +00:00