Commit Graph

3443 Commits

Author SHA1 Message Date
Cristian Adam
e12d7e863c CMakePM: Allow "Force to ..." context menu entries also for keys
Previously the "Force to ..." context menu entries were enabled
only for the items on the second column (values).

There is no reason not to have the same behavior for the items
on the first column (keys).

This way the user doesn't have the impression that something is
wrong if they trigger the context menu on the key and not on
the value in the list.

Change-Id: I02fcaf25340f2dbcbb808be8f27047acaaee5471
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-05 13:03:45 +00:00
hjk
16c25d99c8 Docker: Provide a means to select search paths for auto-detection
A combobox in the device dialog to select between the (docker image's)
system path and a semicolon-separated set of user defined paths.

Use it for cmake and gdb detection; qmake and toolchains currently missing.

Change-Id: I3c478ca914a1bf02dcb69ebcb9ea6e358d24aaf9
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2021-12-14 11:15:21 +00:00
Christian Stenger
1cc50c8dcc CMakePM: Prevent device cmake becoming default
When auto-detecting cmake on device ensure any found
cmake will not end up as default cmake as this would
update even desktop related kits to use this if they
had no cmake configured before.

Change-Id: I27960fc1f76d95bd7ddef6bff40f163aa46a610d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-12-09 13:48:07 +00:00
Kai Köhne
11435ebedb CMake: indent closing ) one level down
Fixes: QTCREATORBUG-26700
Change-Id: I1b6609d0adea4a2093ca2afabac72b02a2f496f9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-12-09 07:34:55 +00:00
hjk
104ea4accc Make some qHash and comparison operators overloads hidden friends
Restricts lookup scope more to necessary bits.

Change-Id: Ia42c95aaa70534843b7f6a90bfc56d2a1202c612
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-12-06 17:10:49 +00:00
Eike Ziller
421d8038dc Merge remote-tracking branch 'origin/6.0'
Change-Id: I2ae142f02ee184d756932bf594c25addd3c2676c
2021-12-02 09:31:03 +01:00
Oliver Wolff
beb167a963 Add qt's toolchain file to initial cmake arguments for Windows on ARM64
Fixes: QTCREATORBUG-26636
Change-Id: Id9fc9f3c2242136d2fa4d42e7e64b038a50b1809
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-12-02 05:19:46 +00:00
Eike Ziller
d62d0f305b Merge remote-tracking branch 'origin/6.0'
Change-Id: I71b19dd8ecd96a7a2a58622f68283b8635264e48
2021-12-01 09:24:05 +01:00
Cristian Adam
63fcd6812b CMakePM: Disable "Run CMake" menu entry while building
Configuring a project during build is a recipe for disaster.

Fixes: QTCREATORBUG-26606
Change-Id: I041d9bd76315647439100cadba809d6664d268fa
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-26 15:58:22 +00:00
Eike Ziller
eba4115b82 Merge remote-tracking branch 'origin/6.0'
Change-Id: I3bab4e31bc5993c59c7025ebde0846bf6c75810e
2021-11-19 10:44:15 +01:00
Alessandro Portale
9cc2b7aaf3 qmake/qbs/CMake builds: Remove "recommended" dependency on Designer
Recommendation of Designer is the artifact from an earlier solution
for adding code of .ui files to the code model. The refactoring of
extra compilers made that superfluous, this change removes the
left-over traces.

The CMake build of Qt Creator breaks because of the recommendation
if the qttols module is not installed.

Amends: 78d3191363

Change-Id: I64827492d79a9238dc8512047abd581f9da3189e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-11-17 13:46:07 +00:00
Cristian Adam
be9f7313b6 CMakePM: Remove UNINITIALIZED SOFT_ASSERT
Fixes: QTCREATORBUG-26582
Change-Id: I2a453a3044f2cb6eed0fd3f27ceae97fe347fdba
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-11-17 11:18:08 +00:00
Eike Ziller
531f3ada2c CMake: Add xcodebuild parser for "Darwin" targets
Similar to the qmake make build step, so build issues are parsed for iOS
builds.

Task-number: QTCREATORBUG-26541
Change-Id: Ie71a3087feab2720f6d8b4974d221a70c3fe76fa
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-11-16 13:02:33 +00:00
Jonathan Mouchou
6efcd09063 Android: Fix AndroidManifest wizard invalid package source dir
Fix the wizard from inserting the filename for the file path leading to
an invalid directory.

Example invalid path: /projectpath/projectname/projectname.pro/android
With fixed path: /projectpath/projectname/android

Fixes: QTCREATORBUG-26580
Change-Id: If82a6f795ca400beddc26b959e65ea066ad79433
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-15 18:41:58 +00:00
hjk
652b9844e6 Utils: FilePathify Environment::{ap,pre}pendOrSetPath etc
Change-Id: Idfa5ec247337570936b0236cab9d3a5669792ca0
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-11-10 07:26:31 +00:00
Eike Ziller
3b9b9bdc0b Merge remote-tracking branch 'origin/6.0'
Change-Id: Ia7fc255ee8680e6beac5d4d878f446fe40873183
2021-11-08 09:46:57 +01:00
Cristian Adam
06410dcb80 CMakePM: Fix importing of Qt projects
Amends ca04d9afcd

Fixes: QTCREATORBUG-25767
Change-Id: I099662a52bbae40541698edb80ba0576eda70884
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-04 17:26:49 +00:00
Eike Ziller
195abefe7d EditorManager: Remove QString openEditor(At) overloads
In favor of the FilePath/Link ones.

Change-Id: I5caf9e0f8de304ff4ee12329557aa50a6f3a0c69
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-11-02 08:11:14 +00:00
hjk
13807ff021 CMake: Drop use of FilePath::mapToDevicePath()
That's implicit in .onDevice() since c82e3cf6a8, doing it twice
is not good.

Change-Id: I8c1d5d31d155d3a7c4af8bd874fbba5ab3e8cf72
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-10-27 14:24:32 +00:00
David Schulz
665285b981 Docker: Map build directory to device in cmake calls
Change-Id: Ibcd2e1aebac337e880a28a2a22b35d8ca60b6dcf
Reviewed-by: hjk <hjk@qt.io>
2021-10-26 07:38:55 +00:00
Orgad Shaneh
3871e40f43 Fix qHash-related size compatibility warnings by MSVC
Change-Id: I3b7981ce78b67db4b996f99682284a0b911d8cd7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-10-20 15:03:51 +00:00
Jarek Kobus
2948d282ce Don't call DocumentManager::addDocument() from non-main thread
Detect that constructor of ResourceTopLevelNode is being
run from non-main thread and omit creation of ResourceFileWatcher
in this case. The construction of ResourceFileWatcher
will be postponed until the node tree returns back
to the main thread. This happens later inside
Project::setRootProjectNode() when ProjectTree::applyTreeManager()
is called for the second time - this time it's done from the main
thread. In order to setup the lacking resource file watchers
we install an additional folder node visitor only in case when
the handler is called from main thread. The visitor
sets up the lacking resource watchers if that's still needed.

Amends: 0bcab32657

Fixes: QTCREATORBUG-26417
Change-Id: Ia1bfb7f284afb833b6b4291accc4d0a91bd0d6c5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-10-20 12:35:22 +00:00
Jarek Kobus
39b36bf773 Remove unneeded terminating of failed process
Since we employ QtcProcess, the reaping of possibly
running process is done internally by QtcProcess already.

Change-Id: Ie65314a4aecf5bb1808b0f2c46a50503d82fd6fb
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-10-19 12:57:35 +00:00
hjk
f58663ce1c CMake: Use FilePath::mapToDevicePath for construction cmake line
Change-Id: I178803f39b5fa7707c1e4338ff02b9de18b22858
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-13 08:07:59 +00:00
Cristian Adam
fded7e4edd CMakePM: Add headers only on compiler groups without PCH sources
The change that treats header files as projects added all sources for a
certain language for every compiler group.

This meant that for the target that has precompiled headers, the source
files would be added multiple times.

This change reverts to adding only the source files from a compiler
group and the header files for a language type, but only for non PCH
compiler group.

Fixes: QTCREATORBUG-26383
Change-Id: Ib328e0a0331e0f373d5a5981489bc17c58b8eed6
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-10-11 14:17:30 +00:00
Jarek Kobus
dfb5ab475e Optimize addTargets() method
Don't lookup for matching targetDetails on every iteration.
Before we start a loop we prepare the appropriate hash and
use it on every iteration instead.

This shortens the total time spent on findOrDefault
from about 2 seconds to about 10 miliseconds now.

Change-Id: I89bb3f472bc9071a54f9900fa057f87b57d4742d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-08 16:27:02 +00:00
Jarek Kobus
de3e33a76b Optimize setupLocationInfoForTargets()
Don't search for each target separately in the node tree,
but do a one search for all targets at once.

This makes searching for nodes much faster, as in case
of loading a Qt6 project (5 main modules only) with debug build
of Creator, the searching time went down from 36 seconds into
30 miliseconds (just 1000 times faster). The number of targets
in this case was more than 5000.

Change-Id: I015f6fd2a2d5e613307cc7b65746c01a5b14c6dc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-10-08 12:09:20 +00:00
Christian Stenger
4bea534c62 CMakePM: Do not register qch files from device
Change-Id: Ie6f8ce74d500d18b69fd5017ddd820356515c21a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-10-07 13:26:56 +00:00
Assam Boudjelthia
91117a1c36 Android: Clean up for extraData constants
clean, rename and delete unused constants, we well as unify the
usage between qmake, cmake, and qbs.

Change-Id: I8827ac2f2f7660e337694fef17f744e727bd776a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-06 08:07:42 +00:00
Cristian Adam
89d0239cd8 CMakePM: Do not treat generated source files as project source files
Also mark the CMake configured generated precompile header files as
generated, so that the "Hide Generated Files" filter menu entry would
take them into account.

Fixes: QTCREATORBUG-25125
Change-Id: I0ec1cc923e361ae9b599eef1a039695e749a033a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-10-05 12:41:16 +00:00
Christian Stenger
95259ae79d CMakePM: Be more graceful regarding cmake tools
Otherwise we may easily lose registered tools if the device
is currently not available.
This happens e.g. if the docker daemon is not running.

Change-Id: I10156d749bf33d7d789c3fad78bf3acdf1f6fd74
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-10-04 10:59:21 +00:00
Cristian Adam
0665a9151c CMakePM: Scan files only on CMake configuration failure
The file tree scanner will only be started on CMake configuration
failure to generate the <File System> fall back project node.

Change-Id: I873ef1189fd43dc9bffa03aeafabb00bb3b8b6af
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-10-01 10:26:37 +00:00
Cristian Adam
d341ab6371 CMakePM: Remove <Headers> virtual project node
CMake projects need to add the headers as source files in order to get
exported from the CMake file-api json export.

Having header files that are not part of the project displayed in the
<Headers> node is error prone and confusing.

This also means that you won't get bogus files when doing git commit
for example.

Fixes: QTCREATORBUG-18206
Fixes: QTCREATORBUG-24609
Fixes: QTCREATORBUG-25407
Change-Id: I89ac4f8a80f452119f8a991b9e4ef14efb7a86b9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-27 12:25:53 +00:00
Orgad Shaneh
74713e5ef1 Merge remote-tracking branch 'origin/5.0'
Change-Id: I7ca9791b95032a1f276c520f8eefde3801510eb9
2021-09-27 13:22:58 +03:00
Alessandro Portale
fcf9537dc5 Various FilePath::fromString -> fromUserInput changes
Change-Id: Ic9c5e2f5c0375468651557f504b101572b72ac06
Reviewed-by: hjk <hjk@qt.io>
2021-09-23 16:28:54 +00:00
Cristian Adam
4cad094066 CMakePM: Treat header files as project files
CMake doesn't associate header files in a compiler group in the
file-api export. But it does list them as source files if added
to the source files of a target.

By using the CppEditor::ProjectFileCategorizer we can sort the
header files to the right compiler group.

This way one could have the clang-tidy and clazy run on a header
file. Or the TODO plugin find TODOs in header files. Or the Autotest
plugin finding Google Tests in header files.

Fixes: QTCREATORBUG-23783
Fixes: QTCREATORBUG-23843
Fixes: QTCREATORBUG-26201
Fixes: QTCREATORBUG-26238
Change-Id: I8acace48e89fd9b3da8bce1c479dec7891e1bbd4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-23 13:52:05 +00:00
Cristian Adam
3922b1a917 CMakePM: Add issue icon and tooltip description on project failure
If a project fails to load it will be displayed with a warning icon.

If the CMake configuration fails and the backup configuration is
restored, the project is also marked with a warning icon.

Change-Id: I95ccc5d171f5b789fe317fbb1da9e13dcd81a5dd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-23 08:50:24 +00:00
Eike Ziller
b53512352e CMake: NinjaPath was never supposed to be written to the settings
It is a value written by the installer, and to be read from the install
settings. Writing it to the local user settings breaks it if the user
uninstalls Qt and installs it at a different location.

Also add a temporary fixup, removing the setting from the local user
settings, if it was already written there.

Amends beda749326

Fixes: QTCREATORBUG-26289
Change-Id: I27652031b13aaf17a5daff3bfba1312bf1158ec7
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-09-23 08:13:03 +00:00
Christian Stenger
6a5340175b CMakePM: Improve cmake default generator setup
Docker images with UNIX on a Windows host should get a proper
default generator.
This allows to build projects with a default set up kit for docker
out of the box without modifying the kit values or the project
setup.

Change-Id: Ic32e72c28d98a367e71f19d4e1c211ec7a4e613e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-09-22 12:53:17 +00:00
Cristian Adam
11fd8232b7 CMakePM: Display <File System> tree node only on failure
Fixes: QTCREATORBUG-25994
Fixes: QTCREATORBUG-25974
Change-Id: I383fe5c28d1f71c8f7939bc9fe4f1f0bf1d6a01b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
(cherry picked from commit 36a0151c6d)
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-09-22 10:46:46 +00:00
Cristian Adam
36a0151c6d CMakePM: Display <File System> tree node only on failure
Fixes: QTCREATORBUG-25994
Fixes: QTCREATORBUG-25974
Change-Id: I383fe5c28d1f71c8f7939bc9fe4f1f0bf1d6a01b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-22 09:25:47 +00:00
Cristian Adam
87c1f597e3 CMakePM: Display CMake project loading errors/warnings in issue pane
Currently the errors / warnings were visible only in Project mode.
Now they will appear in the build system issues pane, so that the
user knows that something is wrong with the project.

Change-Id: I4e0e6aebed86fdb9ea757692255cdbde37cf58a3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-21 12:49:07 +00:00
Assam Boudjelthia
7bf268114d Fix issue with deploy step not getting valid abi with CMake
With CMake, it seems that the abi was being empty string because
looking for ANDROID_ABIS is not defined and instead there's ANDROID_ABI.

Also make sure to handle the case of ANDROID_ABIS, which might be
declared in future versions like Qt 6.3 which can support multi-abi
builds.

Change-Id: I805c5c25409a4e20a237b8747082d256bd72e275
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-09-21 06:07:41 +00:00
Cristian Adam
67b8e8f9b1 Reaper: do not disconnect process before reaping
AbstractProcessStep is relying on signals which breaks with
the disconnect call.

Amends ebae255e49

Fixes: QTCREATORBUG-26271
Change-Id: I16ebaad68352be5c41492e5c4d4fbc3f032e2e39
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-17 10:26:16 +00:00
Cristian Adam
69475d37fe CMakePM: Populate targets list on add new build step
The target list was recreated when the parsing of CMake project
finished.

But for already configured projects, the list was not used when
a new build step was added. This new step will only get the
targets list when the CMake project would be reparsed.

Fixes: QTCREATORBUG-25759
Change-Id: I54d12a71dacf9fcec2ad0f3e341fe8057880251d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
(cherry picked from commit a88f1426c3)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-17 09:16:30 +00:00
Cristian Adam
845230166b CMakePM: Allow loading of projects that do not have any targets
Fixes: QTCREATORBUG-25509
Change-Id: I4e56576f0d9fdffa50c81f4901fb30d17952553e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
(cherry picked from commit 86825283ed)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-17 09:16:12 +00:00
Cristian Adam
86825283ed CMakePM: Allow loading of projects that do not have any targets
Fixes: QTCREATORBUG-25509
Change-Id: I4e56576f0d9fdffa50c81f4901fb30d17952553e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-09-16 17:35:18 +00:00
Cristian Adam
a88f1426c3 CMakePM: Populate targets list on add new build step
The target list was recreated when the parsing of CMake project
finished.

But for already configured projects, the list was not used when
a new build step was added. This new step will only get the
targets list when the CMake project would be reparsed.

Fixes: QTCREATORBUG-25759
Change-Id: I54d12a71dacf9fcec2ad0f3e341fe8057880251d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-09-16 16:35:55 +00:00
David Schulz
4324f3e8c1 Editor: pass AssistInterface to createProcessor
The interface can be used for checking the context of a codeassist
request to determine
the correct processor that has to be created.

Change-Id: I47ddb05c46399566e27bae21711f11a3a4132c3f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-16 08:25:36 +00:00
Eike Ziller
877bfa4056 Add FileSystemWatcher::clear()
Change-Id: I9f28e763c943a6d8c5cf3082755e64d7e4df7155
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-09-15 06:40:38 +00:00