Commit Graph

47434 Commits

Author SHA1 Message Date
David Schulz
4a8443ff81 LanguageClient: remove unused function declarations
The formatting functionality moved into the LanguageClientFormatter.

Change-Id: I2fb941485b1407d8bf148b2868a9c7593b6dd61e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-22 13:04:30 +00:00
hjk
c8829ff5b3 Utils: Use value/setValue instead of settings also for TriStateAspects
Change-Id: I3d0a58917cd6682e14894e4320d166a1c8de6a9a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-22 12:06:11 +00:00
hjk
f8a946ce96 ProjectExplorer: Silence recently introduced warning
The checked path is actually used in the context of the debugger.

Change-Id: I58af35db65b8fb4ad0af9694714765bdc336a0ef
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-22 12:06:02 +00:00
The Qt Project
ec5f7d8a6b Merge "Merge remote-tracking branch 'origin/4.14'" 2021-02-22 11:20:52 +00:00
Eike Ziller
c55e59cb77 Merge remote-tracking branch 'origin/4.14'
Change-Id: Ib9512b4fc5e17b04ca4be79fc315e79a52d06497
2021-02-22 12:19:58 +01:00
Christian Kandeler
b066b3029e CPlusPlus: Improve type name minimization
... for function parameters. These are located in the scope of the
surrounding class or namespace.
This uncovered a bug in the "Insert Virtual Functions of Base Classes"
quickfix, which we also fix here.

Fixes: QTCREATORBUG-8030
Change-Id: I7f11659dc8e252e3819df8178734e8958fa1b496
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-22 11:16:49 +00:00
Eike Ziller
f47c7b2e90 Valgrind: Do not save defaults to settings
Task-number: QTCREATORBUG-24762
Change-Id: I10fee50cde9facaa35a67114ac15e8b1daa72ab2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-02-22 10:24:03 +00:00
Michael Weghorn
f4dc3fd5c5 Debugger: Prepend '*'s for autodereferenced pointers
If automatic dereferencing of pointers is enabled, the
"Value" and "Type" columns for pointers hold the values for
the dereferenced pointers.

In order to have a consistent behavior for the "Name" column
as well, prepend '*'s to indicate that the variable/expression
has actually been dereferenced.
Add parantheses around the original expression if it doesn't
match a simple regex for variable names, to avoid that the
leading '*' changes the meaning of the expression
(so e.g. a dereferenced 'somepointer + 1' is displayed
as  '*(somepointer + 1)' rather than '*somepointer + 1').

This introduces a new 'autoderefcount' field to propagate the
information how many levels of dereferencing have taken
place from the Python to the C++ side, which is then
used to add the leading '*'s for the display name.

Fixes: QTCREATORBUG-20907
Change-Id: Ia9a41cb42e25ba72a6d980a765dbe2b454deb8c8
Reviewed-by: hjk <hjk@qt.io>
2021-02-22 09:36:45 +00:00
Eike Ziller
7cb81fb5ba CMake build: Add .pri files to development package
This adds at least partial, transitional support for building
3rdparty plugins with qmake against Qt Creator built with CMake.

This might still miss some other .pri files that follow
their own naming conventions.

Fixes: QTCREATORBUG-24055
Fixes: QTCREATORBUG-25334
Change-Id: I83cc547da938976c2ec12a21a17f286b937147f7
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-02-22 07:30:33 +00:00
Tom Praschan
f600386732 Fix dot command for pasting with 'P' being 'p'
Change-Id: Ic491f3a198a03fd08a680e044c4e8f2f5ebe2866
Reviewed-by: hjk <hjk@qt.io>
2021-02-22 06:06:49 +00:00
Cristian Adam
cc0fa86ffd CMakeProjectManager: Add package manager auto-setup
Adds CMAKE_PROJECT_INCLUDE_BEFORE as initial CMake parameters
with a path to a auto-setup.cmake script that will run
conan install if a conanfile.txt is found in the prject.

A project can have a local QtCreatorPackageManager.cmake file
that will be loaded if exists.

The auto setup can be controlled via the following CMake variables:

* QT_CREATOR_SKIP_PACKAGE_MANAGER_SETUP
* QT_CREATOR_SKIP_CONAN_SETUP
* QT_CREATOR_SKIP_VCPKG_SETUP

conan.cmake is taken from https://github.com/conan-io/cmake-conan
which takes care of the conan specific compiler cruft. License
is MIT.

Fixes: QTCREATORBUG-25362
Change-Id: I70a6e1abc5600851d048f1590ca24204ce52a503
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-19 17:54:45 +00:00
Christian Kandeler
485bcc4b61 ClangCodeModel: Change default set of warnings
... to "warnings from build system".
It seems appropriate to respect the project settings by default.

Change-Id: I397c252409a012f4663f3752c5c097fa0e658da4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-19 16:09:37 +00:00
hjk
6bba37ab16 Analyzers: Re-enable switch between global and project settings
This was apparently always using project settings for a while,
even when "Use Global Settings" were selected in the Run settings.

Change-Id: I1293a617edcbfd6bc47c57102fa53096c717ec4e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-19 13:40:28 +00:00
Tapani Mattila
130e05845c QmlDesigner: Easen assert on non-fatal double qml node insert
Change-Id: I3ca0d0c5427f548e249bdc3af2fd1d8281544ba7
Reviewed-by: Michael Winkelmann <michael.winkelmann@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-19 13:25:52 +00:00
Jarek Kobus
31d3e3252f Use QMutexLocker for lock/unlock
Change-Id: Ib8c6cdc71a3d82785619260c4ace7362c6847f99
Reviewed-by: hjk <hjk@qt.io>
2021-02-19 12:38:30 +00:00
David Schulz
2fe3ce93ae LanguageClient: Do not handle messages while shutting down
Fixes crash of todays demo...

Change-Id: I0af3edd098b5c05d7d74ff336739f1180a1ec348
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-19 11:43:27 +00:00
David Schulz
30e1387130 LanguageClient: clear extra selection when diagnostig gets hidden
Change-Id: I3b10301193e988eacc23eb9e55576eef5f69fb3f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-19 11:43:06 +00:00
David Schulz
94ee80b222 JLS: add special java client that can execute jls commands
the java language server uses special "java.apply.workspaceEdit"
commands that already contain the workspace edit that should be applied
when triggering the command.

Change-Id: If7c53b9b097aaeca289e3958a39be37a9725d395
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-19 11:42:59 +00:00
Jarek Kobus
cb7b3dd817 ClassView: Move delaying of update into the main thread
Minimize the communication with parser's thread.
Don't call getParseDocumentTree() multiple times
when subsequent request for the same document comes
before the timeout.
Don't queue again already queued documentUpdated()
signal (it's emitted form non-gui thread).
Prepare for moving the calls to SessionManager out of the
parser's thread.

Task-number: QTCREATORBUG-25317
Change-Id: I5d4898b5addbb589d415e00c66de5cba7b96d512
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-19 10:29:45 +00:00
Jarek Kobus
aeac17ecf5 ClassView: Reparse the tree when files are removed
In order to refresh GUI, call reparse after files are removed.

Task-number: QTCREATORBUG-25317
Change-Id: I8f29c042c9002587dd791800597af0e42e19856e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-19 10:21:25 +00:00
Jarek Kobus
38bc3dd308 Remove unneeded Q_UNUSED
Change-Id: Ia773eb99e1d50bf6ecdc128e5c75dc5e1c5a1459
Reviewed-by: hjk <hjk@qt.io>
2021-02-19 08:46:47 +00:00
Jarek Kobus
aef1bb943d Use QMutexLocker in conjunction with QWaitCondition
Change-Id: Ia5d55b9161a58387b0806e792f0fb1b21f118330
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-19 08:20:09 +00:00
Jarek Kobus
ee77958998 Use atomic_bool and drop QMutex locking
Change-Id: I70d472b0de717467c53bbb29cc407367b7e80e7f
Reviewed-by: hjk <hjk@qt.io>
2021-02-19 08:02:16 +00:00
Mahmoud Badri
43eaa09b11 Add components library expand/collapse all context menu options
also change import name from "library" to "module" and relevant tweaks.

Task-number: QDS-3589
Change-Id: Ib467dda61b6720cebe843e34cb807aee6221f5cb
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-18 18:43:57 +00:00
Christian Kandeler
d3deefc3a4 Core: Streamline SearchResultWindow interface
That is, make SearchResultItem the one data type for adding search
results.
This will allow us to add additional properties to search results
without adding more and more parameters to a bunch of functions.

Change-Id: Ic2740477ae47449cee75caa2525727fe2b460f91
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-18 16:46:08 +00:00
David Schulz
fa5fdef6e1 LanguageClient: clean up client interface declaration
Change-Id: I18b5b8a5b39a6be7c538054385c7dca188676eef
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-18 16:15:24 +00:00
hjk
a2d6c2b34a Utils: Consolidate more aspect functionality
The concepts of 'value', 'defaultValue' and changed signals are present
in a few aspects, with varying implementations. Time to get things
sorted out.

The values are stored now as QVariant in the base, with typed accessors
in the derived classes, keeping the user visible interface the same.

Change-Id: I4d37ef5c7a9795f46ce1bbbabc6a251222b1d54e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-18 15:55:25 +00:00
David Schulz
acd33a45d8 Java: add java language server settings
Change-Id: Ic8e8ce5833052fcbb3acb004ae577722e2ef8fc3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-18 13:56:42 +00:00
Cristian Adam
fc411cd0d1 CMakeProjectManager: Make backup of CMake configuration before starting CMake
CMake's fileapi functionality will save the project structure in json
files in the .cmake/api/v1/reply directory.

When issuing a cmake command with -D variables CMake will update its
CMakeCache.txt file even if cmake will fail.

This commit will rename .cmake/api/v1/reply as .cmake/api/v1/reply.prev
and make a copy of CMakeCache.txt before starting CMake, and if
something fails, replace the existing files with the previous values.

Also make sure the changed values are not dissappearing when the
old .cmake/api/v1/reply gets parsed.

Fixes: QTCREATORBUG-24593
Change-Id: I82141786fea7068699e0f761a8978ba1f3203e47
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-18 13:21:11 +00:00
hjk
2fb9d08082 Utils: Don't use ptrace in the process stub
Previously, ptrace was used to keep a tight hold on the spawned process
across the exec(), followed by raising a SIGSTOP to allow un-racy
attaching a debugger.

This makes implementation of 'Run as root' more difficult and is
apparently not needed: instead of the ptrace use, the SIGSTOP can be
raised directly, before exec().

Change-Id: I36025ac547b2a335e2a203c728d221830e4c0a7d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-18 13:18:21 +00:00
Christian Kandeler
63cd4c1b58 ProjectExplorer: Improve MSVC output parsing
- Recognize "note:" messages as continuations.
- Do not remove leading spaces from continuation messages, as that
  hurts readability.

Fixes: QTCREATORBUG-25321
Change-Id: Ia8eebb688296ad4829648bc66e8afcd0198cf2d4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-02-18 10:33:05 +00:00
David Schulz
032407a6fe LanguageClient: select current client when opening inspector
Change-Id: I4bfd74e7e9a8c0f4b60ed034faac86c2fb9bb018
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-18 09:39:01 +00:00
David Schulz
f9502a3ba6 LanguageClient: move capabilities widget to inspector
The capabilities are not changeable for the user, but only there to
check whether a server is capable of a specific task. This will also
allow us to have more specialized settings widgets for specific servers
like for the java language server without the need to add the
capabilities to each of those special widgets.

Also add the dynamic capabilities to the widget so users have a complete
overview of the capabilities.

Change-Id: I9f2ed6ed11b458f0d4c67be3df632fd810023286
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-18 09:38:56 +00:00
Alessandro Portale
c697b503e9 QmlDesigner: Add missing "const" and "&" in range-basd for loops
Change-Id: I93821f97fb1d8c3154bc03b8f54c504a6f712269
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-02-18 09:35:38 +00:00
Alessandro Portale
e2dd9639e5 QmlDesigner: Use qAsConst with non-const Qt containers in range-loops
Change-Id: I7fb1c012b4e6b0608c5888d58c7752b194baf78b
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-02-18 09:35:31 +00:00
Alessandro Portale
ae5255cebd Android: Fix android-*-deployment-settings.json detection
Qt 6.0 + CMake: The name for the Android deployment settings file needs
to be determined by using the build key of the current run configuration
rather than by using the display name of the project root node.

Since in contrast to qmake/Qbs, CMake does not supply us with the file
name and we have to contruct it ourselves. Therefore, it makes sense to
move the value into the Android plugin.

This change adds AndroidQtVersion::androidDeploymentSettings which lets
qmake and Qbs still provide the value as before while handling the CMake
fallback.

Fixes: QTCREATORBUG-25209
Change-Id: I12314d06a45d6e045cb654d9140f9d2ed4602f67
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-02-18 09:34:48 +00:00
Eike Ziller
768d4321f9 Merge remote-tracking branch 'origin/4.14'
Change-Id: I214b8d59e8ff7fe0511cd6116ec7725ddc4376ee
2021-02-18 09:26:22 +01:00
Christian Stenger
1133e26d3a AutoTest: Do not mix up sanitizer results and normal results
If a test framework uses stderr for output we might end up adding
real test output to a not-yet-sent sanitizer result.

Fixes: QTCREATORBUG-24328
Change-Id: I389c09da626229aa8985b2f99671b6ba8b6c467c
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-18 08:25:03 +00:00
Jarek Kobus
d74edd2806 Remove unused includes of mutex classes
Change-Id: I5a34cda0b27786cb37e642479b11fbd24b8b5c36
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-18 07:02:07 +00:00
Leander Schulten
213ad8368a Fix build
Change-Id: If4593342cd92716fb2238d633e5b25135a02ce57
Reviewed-by: hjk <hjk@qt.io>
2021-02-18 06:28:55 +00: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
Jarek Kobus
144f46bb54 ClassView: Remove unused includes
Amends a513f25c39
Amends 23047f16f7

Task-number: QTCREATORBUG-25317
Change-Id: I19a817ddfead6a123116efe05f24131973cea7ac
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-17 17:23:14 +00:00
Christian Kandeler
7d4a632cb2 qbs build: Remove code for creating deployment packages
Not a use case anymore, and if it were, we'd do it using built-in
capabilities.

Change-Id: I4c588ad7fb282530880210cb4c5795677074b1e0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-17 16:11:49 +00:00
Christian Stenger
185598f303 QmlDesigner: Fix qbs build
Amends 151184a609.

Change-Id: Iccc6232a0b9fa4a06fcb6b14420e41380a9c3dea
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-02-17 15:33:29 +00:00
hjk
c5cc771656 Valgrind: Allow specifying extra arguments to valgrind etc
Fixes: QTCREATORBUG-18693
Change-Id: Ibb968dcd82b118340a45329b4a14b28d85700661
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-17 14:59:03 +00:00
Christian Stenger
5b9d8f0061 QmlDesigner: Fix compile on Linux and macOS
Amends 151184a609.

Change-Id: I5f898434e60560a97d8c4155906fdb77f0fc8d24
Reviewed-by: hjk <hjk@qt.io>
2021-02-17 14:58:07 +00:00
Alessandro Portale
72d91dc94a Use qAsConst with non-const Qt containers in range-loops
... in various places

Change-Id: Ic6c0c1b9437a1ed402105c7a14a1f5f9454a68d4
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-02-17 14:43:29 +00:00
Cristian Adam
1d27f894bb QtCreator: Add ability to specify text codec for default locale
On Windows you get one locale for unicode applications, and one
for old non-unicode applications.

Qt Creator uses QTextCodec::codecForLocale(), which would result
in the "System" codec, which is mapped for the default language
in the system.

Task-number: QTCREATORBUG-24776
Change-Id: I64496cc440931d3bf6f09314bdfc7c29e01b9f4f
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-17 14:29:27 +00:00
Alessandro Portale
38a38cd0ed Utils: Fix output formatter "new searchDir found" signalling
Change-Id: Id9bc5cb0641dbac902b7d5af8ee3d00e0308478e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-17 12:55:34 +00:00
David Schulz
5cbf323014 LanguageClient: track clients again
Amends 166fce5036.

Change-Id: If78ca6a15fd5b5f809ef7693b3b31131a0973df3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-17 11:30:52 +00:00