Commit Graph

47434 Commits

Author SHA1 Message Date
Christian Kandeler
90a07eca28 LanguageClient: Add the possibility to override progress messages
... and make use of it in the clangd client.
We want the progress bar for background indexing to have a better title
than the plain (and non-translated) "indexing" that the clangd server
sends.

Change-Id: Ib75eac370e7c22f0c5bd477f4a4c423283b27e1f
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-04-26 08:13:21 +00:00
Eike Ziller
c1f90aeca2 ICore: Change some path API to use FilePath
Change-Id: Id841d6177206a021c9e606ce560b47d1ae6e52b9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-04-26 08:03:47 +00:00
David Schulz
7dab5bd550 ProjectExplorer: Fix msvc toolschain abi compatibility
According to MSDN: "You can mix binaries built by different versions of
the v140, v141, and v142 toolsets. However, you must link by using a
toolset at least as recent as the most recent binary in your app. Here's
an example: you can link an app compiled using any 2017 toolset (v141,
versions 15.0 through 15.9) to a static library compiled using, say,
Visual Studio 2019 version 16.2 (v142), if they're linked using a
version 16.2 or later toolset. You can link a version 16.2 library to a
version 16.4 app as long as you use a 16.4 or later toolset."

https://docs.microsoft.com/en-us/cpp/porting/binary-compat-2015-2017?
view=msvc-160

So don't try to assign an older msvc toolchain to a kit that contains a
Qt build with a newer version of msvc.

Fixes: QTCREATORBUG-25618
Change-Id: If58676da5f61add1eed7e786862ee475e180b7dc
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-04-26 08:03:07 +00:00
David Schulz
b2c0554733 LanguageClient: add global action to open inspector
Change-Id: I3dcd6cdf716e68e2d7bedb24e1db372d93683698
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-26 07:01:22 +00:00
Eike Ziller
86f0d72b2a Look for jom also in "jom" subdirectory
Jom is currently installed into the Qt Creator bin/ directory directly,
but it can be considered unsafe if we add that to the PATH. Look in a
subdirectory for it as well, as preparation for moving it there instead.

Task-number: QTCREATORBUG-25585
Change-Id: I85b379fa093c57639875872868c16b5cc964f4aa
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-04-26 07:01:12 +00:00
Christian Stenger
1effc86642 AutoTest: Fix crash on closing a project
If the check state of a tree item changes due to closing
the project and there is no other project open we access
a nullptr.

Change-Id: Ib08031e19eaae0837d1dc0485a05756cd8d0c0dc
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-04-26 06:22:42 +00:00
hjk
cac3736b52 QmakeProjectManager: Un-export QmakeMakeStep
Not directly used in leaf plugins (iOS?) anymore.

Change-Id: I5fcf7e0d976e99b5d9eb8b0e6404651b35d5db43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-26 06:22:00 +00:00
Miina Puuronen
ca3b8f3b32 QmlDesigner: Fix Component Library category collapsed state
Set category collapsed state only after checking the status of category
and not during it.

Fixes: QDS-4227
Change-Id: I4771a8641174ac2f0413b3ff2380dd8dbb77742f
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-04-23 14:36:57 +00:00
hjk
a916c0a235 QmakeProjectManager: Code cosmetics
Namespaces...

Change-Id: I8014c932895ebaea78319b22d2693de16f270fc4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-23 14:30:40 +00:00
Eike Ziller
eef041a1a8 QmlDesigner: Fix build with Qt 6
error: non-constant-expression cannot be narrowed from type 'qsizetype'
(aka 'long long') to 'int' in initializer list

Change-Id: I743f942fb0bef9f907b4facbb346264dfeaad778
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-04-23 10:30:05 +00:00
hjk
77fd9661ec ProjectExplorer: AbstractProcessStep code cosmetics
Namespaces.

Change-Id: I7781bcf7125ad854e05a3b3a6a97d0c39b76df69
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-23 10:10:29 +00:00
hjk
9dfdb9f0a2 QmakeProjectManager: Some code cosmetics
Namespaces, foreach, parantheses.

Change-Id: I641811d66970cbb275688a73c8765be00ba295bb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-23 10:10:23 +00:00
hjk
29ac812cf4 Clang: Compile fix for qmake
Change-Id: I88fa2c995a22a2fe3bf3a0aac05c0432e4b3d379
Reviewed-by: hjk <hjk@qt.io>
2021-04-23 02:06:38 +00:00
Christian Kandeler
7b408a9a7a ProjectExplorer: Tighten the LdParser a bit
Just a hotfix. This parser is still much too eager, and a lot of unit
tests only pass because it wrongly matches things that should be caught
elsewhere.

Fixes: QTCREATORBUG-25617
Change-Id: I91161a103b41239c3aac9e119c21e152b0437a32
Reviewed-by: hjk <hjk@qt.io>
2021-04-22 13:50:28 +00:00
Thomas Hartmann
5d9405a8ed QmlDesigner: Assign default to NumberAnimation
Task-number: QDS-4215
Change-Id: I62831276b36767c290e2be29f9a87b94079b7552
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-04-22 13:33:20 +00:00
Eike Ziller
45602754d9 Only globally suppress "Link with Qt" if explicitly requested
If the user actually links with a Qt installation, the note is not shown
again. But if the user installs a different Qt Creator that is not
linked, it should be shown again.

After the user presses "Do not show again", it really will never be
shown again.

Fixes: QTCREATORBUG-25502
Change-Id: Ic3b6f46c318e4b8aa6b189e712b01f2c3d4a2b1d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-04-22 12:26:09 +00:00
Christian Kandeler
e27b367bdc ClangCodeModel: Introduce dedicated class for clangd LSP client
Makes sense for modularization purposes, and it will soon get additional
functionality.

Change-Id: Ie8163d352fc408b4167ee2ce6147aa1fb19528eb
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-04-22 12:07:49 +00:00
Eike Ziller
63f7ba0427 Toolchains: Improve warning message for wrong language ID
State the ID and where it comes from

Change-Id: I8bdf9e38b2a1d3a00409cfa680f1079e5a048eba
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-04-22 09:14:17 +00:00
Christian Kandeler
ecafdb7543 ClangCodeModel: Add experimental clangd support
If the user has enabled clangd (default is off), we start up one instance
per project when it is opened/changed (including build config switches),
and trigger background indexing.
So far, the index is used to provide results for locators and "Find
Usages".
Per-document functionality such as semantic highlighting and completion
is still provided by libclang.

Change-Id: I12532fca1b9c6278baab560e7238cba6189cde9f
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-04-22 07:32:58 +00:00
Christian Stenger
44a33d4c2c LanguageClient: Fix possible nullptr access
Fixes: QTCREATORBUG-25528
Change-Id: I23d50b8bb0a3112eab3eac6a9300e2783b8bb939
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-04-22 04:36:42 +00:00
David Schulz
b3c2120dff Editor: add specialized snippet overlay
Split out the snippet functionality into a new derived
overlay implementation.

Change-Id: I2d7fffabe16ce6348ed067eb52ff221420a23285
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-22 04:14:19 +00:00
Alessandro Portale
8b59604bd4 Docker: Add a build step
Let's have a build step which allows running a command on a registered
Docker image, which is defined by the Kit's build device.

If the build device is the Local PC, run the command locally.

This specialized build step will most likely be removed after the
existing steps have been taught to run on the Kit's build device.
For now it is part of a POC that allows to experiment with non-local
build commands.

Task-number: QTCREATORBUG-22362
Change-Id: Ifda503ee346b67857a5b82c05cb38cf7f63698d0
Reviewed-by: hjk <hjk@qt.io>
2021-04-22 00:10:12 +00:00
Alessandro Portale
176122fa94 ProjectExplorer: Make APS::setupProcessParameters const
Change-Id: I357505131cff5c98b5c9fe0a3967c79d009167e6
Reviewed-by: hjk <hjk@qt.io>
2021-04-21 13:32:17 +00:00
Thomas Hartmann
46fedb7697 QmlDesigner: Do not disable TimelineView
Change-Id: I8d45b887985778a3a8d0da2cf664666cca8b553d
Reviewed-by: Knud Dollereder <knud.dollereder@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-04-21 12:09:10 +00:00
David Schulz
f1bb3b6811 LSP: add semantic tokens
Change-Id: Ia6865ec6991ec62ae9f0dc2dfa692f1f27318ed1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-21 11:33:56 +00:00
Mahmoud Badri
767ce26ef2 QmlDesigner: Optimize adding QtQuick3D and asset imports
Update subcomponentmanager only for the needed imports when:
- Adding the QtQuick3D import via the link in the 3D editor.
- Adding 3D asset using the assets importer.

Also few renamings to make things clearer.

Change-Id: I4eb55f64307498f3dbb400e947667dfe9e42ff8e
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-04-21 08:59:56 +00:00
Miina Puuronen
8c5ba8b987 QmlDesigner: Fix hiding categories with similar names
Fixes: QDS-4144
Change-Id: I045a7457f0d5c949f4e3a445d7679108dd0b8495
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-04-21 08:52:26 +00:00
Michael Winkelmann
9753fb2ef9 AnnotationEditor: Update default annotations
Change-Id: I0e196bcc72dfe6df5edc36618dfcbb8d21507128
Reviewed-by: Michael Winkelmann <michael.winkelmann@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-04-21 08:30:55 +00:00
Eike Ziller
9c2980f65d Merge remote-tracking branch 'origin/4.15'
Change-Id: Ide723c45dcd7e39e4e54432f2dc265c5d53c38eb
2021-04-21 08:41:20 +02:00
hjk
09d24face0 QmlProject: Use new RunConfiguration::setRunnableModifier
Change-Id: Idb729996b979effc96d97bfe7220668dfb904bb2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-21 06:24:06 +00:00
Marco Bubke
12762e5102 QmlDesigner: Use more secure friend declaration
The shorter form is not declaring any class implicitly. The class have
to be declared before. So you avoid the mistake of declaring a new class
instead of make one friend.

Change-Id: Ia035e2f5967c24cdb053ac8b91aa61bbbd5ea20d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-04-20 12:50:21 +00:00
David Schulz
d66b410adb LanguageClient: do not auto-assign documents to all clients
Only assign documents to a client if the client was started by a
setting. Programatically started clients should handle assigned
documents manually.

Change-Id: I192c4c011a48e0406f267d3cab3c860f740ddad7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-04-20 11:44:12 +00:00
Christian Kandeler
d9c1ee211a OutputWindow: Reset "scroll to bottom" to default value
... on new build/app start.

Fixes: QTCREATORBUG-25605
Change-Id: I3f478db4c63cf0100c42342deedab9db5ba12042
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2021-04-20 10:36:53 +00:00
Eike Ziller
c2e4f9f2a2 Fix build issues with C++20
- "ISO C++20 considers use of overloaded operator!= to be ambiguous
despite there being a unique best viable function with non-reversed
arguments"

- std::erase(std::vector, ...) takes preference over Utils::erase if not
fully qualified

Fixes: QTCREATORBUG-25598
Change-Id: Ib9d0574ff46d2ab415437c0c044c51e8c9f37caa
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-04-20 10:10:12 +00:00
Christian Kandeler
743ef263c9 GenericProjectManager: Make sure we parse for the right configuration
Fixes: QTCREATORBUG-25592
Change-Id: I5f03fa799f693c16d842cf8279d664194684884d
Reviewed-by: hjk <hjk@qt.io>
2021-04-20 08:56:30 +00:00
Eike Ziller
3d1ad9db60 Merge remote-tracking branch 'origin/4.15'
Change-Id: I1d13f3543ab4bb17f0cbfe26bbea3f154f856ca6
2021-04-20 10:42:55 +02:00
Christian Stenger
3f7877bc37 QmlDesigner: Fix compile on Linux and macOS
Do not use MS extensions on a cross platform build.
Amends 5203c478a5.

Change-Id: Ia4dc014ccb21ffed60dc6a6a54dc63340242349c
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-04-20 08:40:22 +00:00
Christian Kandeler
b1758b1eb2 CppTools: Another parentheses highlighting fix
Amends c80c724b52.

Change-Id: I2691791d40c84bbc1fa6c2525676ef3955b4ffd3
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-04-20 08:27:30 +00:00
Tim Jenssen
080d479101 qmlpreview: remove PUBLIC from DEPENDS
- it does not work as expected

Change-Id: I91530103b661e8dbed5d9391590995fb0401c826
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-04-20 05:47:01 +00:00
Mahmoud Badri
88739db142 QmlDesigner: Fix searching hidden item library categories
Task-number: QDS-4136
Change-Id: I6ba2109015914af1435a03bd7a346c0eba0a8100
Reviewed-by: Miina Puuronen <miina.puuronen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-04-19 13:03:52 +00:00
hjk
eed24bd268 ProjectExplorer: Introduce a build device kit aspect
To be used with docker.

Change-Id: If6c8c67210257724aed31df3f07c7ac1bb1fa452
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-04-19 12:34:47 +00:00
Marco Bubke
51e8256e86 QmlDesigner: Remove unused member function in NodeMetaInfo
Change-Id: I568ebdce5a01b0f6185ac5dcb74676c727651ebe
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-04-19 12:25:35 +00:00
Marco Bubke
5203c478a5 QmlDesigner: Add some useful iterator algorithms to NodeListProperty
Now there is iter_swap, rotate and reverse in the node list property. With
that methods we can implement slide too.

Task-number: QDS-4159
Change-Id: Ie7f80f64fd26e517ca696158a878262928dc82c4
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-04-19 12:25:29 +00:00
Marco Bubke
040854c6f1 QmlDesigner: Add node list iterators
Task-number: QDS-4159
Change-Id: Ie6635d87beb66f766b9995f68972b80baa100ed6
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-04-19 12:25:15 +00:00
Marco Bubke
2e8e47622c QmlDesigner: Split nodeOrderChanged notifier
For swap we cannot provide all the arguments and they are only used in the
rewriter. So we use now a simplified notifier for all views except the
rewriter view. After the introduction of the new rewriter we can remove
the old notifier.

Task-number: QDS-4159
Change-Id: Idc91a618ea40da0bda9856888d115a84016597d5
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-04-19 12:25:02 +00:00
hjk
7eb9d8cb60 ProjectExplorer: Introduce a KitAspect::createManageButton() function
Saves some repetition downstream.

Change-Id: Ied58586572d3e70669c9172c5076bbd12e211aa7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-04-19 12:05:35 +00:00
hjk
77481f25ce ProjectExplorer: Base KitAspectWidget on BaseAspect
Enables re-using existing functionality.

The "Make mutable" functionality is still oddly placed. I doubt people
find and use it actively.

Change-Id: Ic6aae17e3a7df093f0f5f234f1e6e1afc196a087
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-04-19 12:02:19 +00:00
David Schulz
2727016f1d DiffEditor: Use unique action group id
Change-Id: I36e381518250b00cc8cbd9ac8630b2aa5c2fc631
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-04-19 10:56:18 +00:00
Jarek Kobus
7beee7fa99 StringTable: Ensure only one GC() thread is running at a time
The possible issue with the current implementation is that
in theory many possible GC() are being executed in parallel.
In this case just one of them is really working and others
are waiting on the locked mutex (first line of the GC()
method). In such a scenario when a call
to StringTablePrivate::insert() is being executed from one
more thread, it may happen that the working GC() thread
is stopped (since m_stopGCRequested.fetchAndStoreAcquire(true)
was executed from insert()) and later the mutex lock may be
granted to the other awaiting GC() thread instead to the
thread which executes insert() method. In this unlikely
scenario the GC() thread won't be canceled and the lock
inside the insert() method may be locked for considerable
amount of time, what is not desired.

The goal of this patch is to resolve the possible issue above
and to simplify the code by eliminating the m_stopGCRequested
variable and make use of QFuture.cancel() / QFuture.isCanceled()
API instead. In addition, since we control now only one
possible thread that executes the GC(), there is no need for
future synchonizer anymore.

GC() function can't be run in parallel in different threads,
as the whole body of GC() is protected with mutex. This means
that whenever a new scheduled call to GC() is being executed,
this new call waits on the mentioned mutex at the beginning of GC().

So, instead of protecting the whole body of GC() with a mutex,
we ensure that the old call to GC() is already finished (if not,
we also cancel the old call) while preparing an asynchronous
call to start a new GC() from inside startGC() method.

Whenever we are calling the insert() method, we still protect the access
to m_strings with a mutex (as insert() is designed to be called
from different threads in parallel). Just after locking the mutex
we are canceling any possible ongoing call to GC(). After canceling
the GC() call, we are sure that no new call to GC() will be executed
until we unlock the mutex, so it's safe now to modify the m_string
data.

Change-Id: If72d0a6f98fb414c6c63117bc9baa667d17e1ffe
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-04-19 10:24:30 +00:00
hjk
2a1742b289 AutoTest: Use LayoutBuilder for GTestSettingsPage
Change-Id: I7449732a77e1cb2635df3bb45c7ebb24955209d2
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-19 09:45:26 +00:00