Commit Graph

87 Commits

Author SHA1 Message Date
Eike Ziller
04e50438eb Utils: Remove Utils::optional
Since we are now requiring macOS 10.14 we can remove our local
implementation of optional and use std::optional for macOS too.

Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2022-09-01 06:58:04 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
Marcus Tillmanns
3462bc67be filesystem: Add QFSEngine for filepaths
Change-Id: Ibd0c88c69863c0877138d8cc45541530c359bd9c
Reviewed-by: hjk <hjk@qt.io>
2022-07-21 13:14:01 +00:00
Cristian Adam
531288a715 CMakePM: Group CMake settings into one category page
CMake settings were split in two places, which complicates things.

Now they are both into one settings category, just like other build
systems Qbs, Meson.

Change-Id: I55f434d83604c9b3be111fc89014b720ee72b513
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-07-08 19:02:42 +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
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
Vladimir Serdyuk
5d1d6c83a4 iOS/CMake: Fix running non-Xcode targets and targets in subdirectories
Improve support for running iOS bundle built with CMake introduced in
3a294f670d.
Currently it supports only Xcode generator and does not work if target is
created in a subdirectory.

This patch adds support for non-Xcode generators (tested with Ninja) and
targets created in a subdirectories with any generators.

The solution is not pretty due to the need to keep qmake compatibility.
Would be glad to refactor if there's more correct approach.

Change-Id: Ieaf7e3186ab55cadc643d9bd3d94442f9ac72228
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-10 15:23:27 +00:00
Eike Ziller
bce81fd992 Projects: Create QIcons in the UI thread
Creating QIcons elsewhere is not safe because of image reader plugin
loading and the pixmap cache.

Fixes: QTCREATORBUG-25301
Change-Id: Ia22a0cd571f808d7f5c639353fdf2e548743f8ca
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-04-09 13:34:55 +00:00
Alessandro Portale
d38a49a9d6 CMakeProjectManager: Conform Modules icon
The Modules node in the tree of a loaded CMake project looks quite
different than the rest of the icons. Also, it is neither available as
High-DPI variant nor do we have the original vector graphics for it.

Thich change fixes the above issues.

Task-number: QTCREATORBUG-25412
Change-Id: I4ad5853330424f9fec2520b8b539a325b6c80176
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-03-03 10:45:56 +00:00
Alessandro Portale
9fbd1c26b0 CMakeProjectManager: Use the "gear" as project root item icon overlay
Replace and remove the pixel accumulation called "projectexplorer.png".

Fixes: QTCREATORBUG-25397
Change-Id: Idbf5e634bbe98d6eb9cc2cbaafd7f631cac18a83
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-01 08:23:51 +00:00
Alessandro Portale
9e2c6fbfca Android: Deduplicate string literals and use constants instead
Improves findability of identical string in code (via code model).
Reduces risk of typos.

Change-Id: I0e9d9af8eed5cd9b66bf303cfee99c53513bf314
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-02-10 10:32:15 +00:00
Eike Ziller
3a294f670d iOS/CMake: Pass correct bundle name
Task-number: QTCREATORBUG-23574
Change-Id: Ifb4b6d25a8542796af92c0d35523acd104daf2aa
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-02-01 12:08:14 +00:00
Assam Boudjelthia
e9c9440653 Android: allow passing apps arguments via manifest on non-debug mode
Uses 00a1e5da7e1aea373a7e6be1d51e1573ff167dd8.

Task-number: QTCREATORBUG-23712
Change-Id: I9a7e134420b608815589578f3851abf150674fd3
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2020-09-11 10:00:32 +00:00
hjk
430a33dcd9 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-07-06 06:07:13 +00:00
Tobias Hunger
5350288e45 CMake: Fix includes all over the CMake plugin
Keep internals internal, remove some unnecessary includes, add
some that should have been there.

This reduces the number of files that get rebuild when working
on CMake internals from over 1000 to about 200.

This patch also moves some code around that ended up being
in the wrong file.

Change-Id: Icd7366ac760dc85031040720418fbb16336dce9b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-20 10:05:24 +00:00
Tobias Hunger
74a07f906f CMake: Rename some constants
Rename some constants to get a bit more consistency into the
naming scheme. I am so tiered of missing a constant due to it
not having _ in the expected places!

Change-Id: Ibb5e82ea4e25ccb559352839b96c8a64394f3085
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-17 13:24:43 +00:00
hjk
fae66e781a CMake: Use IOptionPage convenience pattern
du -s .obj: 108344 -> 106748

Change-Id: I3c3ce0af0f0ba2e32e349d38e8a0a24feeb57485
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-01-14 11:01:29 +00:00
hjk
e097323817 ProjectExplorer: Fix compilation with MSVC
Amends 2758682723.

Change-Id: I005c6aa848cd15fef8b59e05681c6b49b1453202
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-11-19 14:59:30 +00:00
hjk
2758682723 ProjectExplorer: Move BuildSystem owership to BuildConfiguration
... or Target.

This patch moves build system from conceptually "one per project"
to "one per target (i.e. per project-and-kit)" or "per
BuildConfigurations" for targets where the builds differ
significantly.

Building requires usually items from the kit (Qt version, compiler,
...) so a target-agnostic build is practically almost always wrong.

Moving the build system to the target also has the potential
to solve issues caused by switching targets while parsing, that
used Project::activeTarget() regularly, with potentially different
results before and after the switch.

This patch might create performance/size regressions when several
targets are set up per project as the build system implementation's
internal data are duplicated in this case.

The idea is to fix that by sharing per-project pieces again in
the project implementation once these problems occur.

Change-Id: I87f640ce418b93175b5029124eaa55f3b8721dca
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-19 11:05:52 +00:00
Eike Ziller
04bd6e39c8 Merge remote-tracking branch 'origin/4.11'
Conflicts:
	share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quick3dnodeinstance.cpp

Change-Id: I8ea57eba526ab830608fd928c28771c5441749f8
2019-11-01 15:31:19 +01:00
Nikolai Kosjar
02a81b89c4 CMake: Simplify
Change-Id: I3e5fd3aebf8b11037d99ff367826ff8f8f436045
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-11-01 09:11:06 +00:00
hjk
66c7d75dbd Qbs, Qmake, Python, Generic: Introduce BuildSystem derived classes
... and move context menu action handling there.

This is a temporary measure to be able to move that functionality
alongside the actual BuildSystem to the BuildConfiguration.

There is a lot to be cleaned up left, to keep the patch small.

Change-Id: If4b0820a13b376fc97b70785052924972ce22705
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-10-25 07:55:10 +00:00
Eike Ziller
a0f3ce69bd Revert "Revert "Designer: Fix look-up of resources for UI files""
This reverts commit d907df0349.
The original change was pushed to 4.10 and reverted there for
binary compatibility reasons. Revert the revert here.

 Conflicts:
	src/plugins/projectexplorer/projectnodes.h

Change-Id: Ibfd84a30a6cfdd78e1fa1b1c61785d391a5a18be
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-10-04 11:17:16 +00:00
Eike Ziller
4f0ffcecbe Merge remote-tracking branch 'origin/4.10' into 4.11
Conflicts:
	src/plugins/projectexplorer/projectnodes.h

Change-Id: Ibd255105a01c53a1f81a1ec7b30495dfef1877a9
2019-10-04 12:19:32 +02:00
Christian Kandeler
d907df0349 Revert "Designer: Fix look-up of resources for UI files"
This reverts commit 736eef24ca,
which breaks binary compatibility.

Change-Id: I696ad3e6efc6f02f595356c9864d69629eeef8bf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-10-02 12:44:06 +00:00
Eike Ziller
ac014e3875 Merge remote-tracking branch 'origin/4.10' into 4.11
Conflicts:
	src/plugins/projectexplorer/projectnodes.h

Change-Id: I10a749cca38c2d0929cf4d2b74ab089e14b6157b
2019-10-02 07:32:57 +02:00
Christian Kandeler
736eef24ca Designer: Fix look-up of resources for UI files
Commit 81a643ec99, fixing QTCREATORBUG-22412, was too restrictive: UI
files in applications have access to resources of library dependencies,
so we must consider those. We now only exclude resources from other
applications.
Note that this will potentially list non-applicable resources, e.g.
those from libraries to which our product does not have access. This
cannot be reasonably prevented, because not all build systems provide
this information. It's also not as bad as missing resources.

Fixes: QTCREATORBUG-22909
Fixes: QTCREATORBUG-22962
Change-Id: I51a87402b43c156618982813c408060f300e4e58
Reviewed-by: hjk <hjk@qt.io>
2019-10-01 09:27:10 +00:00
Tobias Hunger
5bcd59c94f CMake: Simplify buildkey generation
Just use the target name as buildkey. This is unique in cmake projects, so
there is no need to mangle the source directory into the whole thing.

This is a problem since different readers might report different source
directories. That will then result in RunConfigurations getting duplicated
after switching the reader types.

Task-number: QTCREATORBUG-22129
Change-Id: I849ab68f221d732341e98faa9a4e757d3a495b2a
Reviewed-by: hjk <hjk@qt.io>
2019-06-20 14:41:04 +00:00
Christian Kandeler
0c74f6cc21 ProjectExplorer: Add "build for current run config" menu entry
This lets users build the executable corresponding to the currently
active run configuration. It's functionally equivalent to locating the
corresponding node in the project tree and choosing "Build" from the
context menu.

Fixes: QTCREATORBUG-22403
Change-Id: Ic2b729c7ce17f1ad944dc06746bb9d6db90b6c61
Reviewed-by: hjk <hjk@qt.io>
2019-06-06 15:05:56 +00:00
Orgad Shaneh
b500119fd7 CMake: Support building a single file
Fixes: QTCREATORBUG-18898
Change-Id: I0ec24b20bfa8d43093b6e6681ddd752fbdea2088
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-29 20:09:24 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
Christian Kandeler
e59bcd9962 ProjectExplorer: Add a "product" tag to the ProjectNode class
A product is a project node from which a target binary is produced, such
as a Product item in qbs or a .pro file in qmake.

Change-Id: I6a0e6bed6c02684cb03b2b18fed6a1b493fa78b2
Reviewed-by: hjk <hjk@qt.io>
2019-05-27 08:25:57 +00:00
hjk
f4c9e5e5c4 More FileName::appendPath() -> .pathAppended()
Change-Id: I403d34e4f52f758339c158efc7a11fd329e3e043
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-17 11:55:04 +00:00
BogDan Vatra
26463a2219 Say hello to Android CMake support
Requirements:
 - NDKr19 or newer
 - Qt 5.12.1 or newer

QtCreator supports the following variables:
 - ANDROID_PACKAGE_SOURCE_DIR
 - ANDROID_EXTRA_LIBS

Be aware, that there is a lot of magic done on QtCreator side, and you
can't use only cmake to build an Android APK.

[ChangeLog][Android][CMake] Add Android support for CMake projects.

Change-Id: I1d351976ed56f424c2bc972f4ff7b5968147a2ed
Reviewed-by: hjk <hjk@qt.io>
2019-03-06 14:47:27 +00:00
hjk
e3a7aa1ad2 ProjectExplorer: Flip default for ProjectNode::showInSimpleTree
Change-Id: Ibd4f91ad55b2be93d20dfc4f583de95274e981ca
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-01 08:57:05 +00:00
hjk
2aacf26a77 ProjectExplorer: Remove Node::m_id
It was only used within cmake, in a role that is nowadays covered by
buildKey.

Change-Id: I4fd77c06a3bb8965db5235315cb017c7b548fbaa
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-26 09:37:02 +00:00
hjk
f844f54cb7 ProjectExplorer: Use setters in ProjectExplorer::Node
Instead of constructor arguments. This makes it clearer on the
user side which value is actually changed.

Change-Id: I63ae8cd139a49700996c8874098111aad89ace22
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-26 08:26:43 +00:00
hjk
57a2e849b3 CMake: Implement CMakeTargetNode::buildKey()
This always sets a node id, that is reasonably unique. So use it.

Change-Id: I9b1cb978f0d6edffabee4eafa5ec078a6a6827a6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-12-18 09:16:09 +00:00
Pawel Rutka
190c5083b7 Add Specific settings page to CMakePLugin and create checkable dialog box for user after add new file action
Change-Id: If5702764fa81f2fdda3ef59780b217e47643b030
Reviewed-by: pawelrutka <prutka13@gmail.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-16 10:49:45 +00:00
Pawel Rutka
4aced20a21 Implement support for project file open after AddFile action
Change-Id: I5f5372498a34760976cea5b7d6f5f49dd04558db
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-02-23 15:15:22 +00:00
Pawel Rutka
5ea157f0b8 Support AddFiles same way as QMake project
Change-Id: Ib1b5e9ba201623b48144766048d3b404ff016131
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-02-23 15:15:12 +00:00
Pawel Rutka
b9bdacb27a Support basic behavior for AddFile in CMake project
Change-Id: Ib9c764908abc7daa9a3c614b93da98bc4e674862
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-02-23 15:14:48 +00:00
Robert Loehning
9e066c7b17 Move HTML out of translated strings
Change-Id: I4664427086619f33e9a882eb3f0a5f2f52e1b42a
Reviewed-by: Jochen Becher <jochen_becher@gmx.de>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-24 10:18:28 +00:00
Tobias Hunger
e037fe7e0c CMake: Hide nodes from project list
Hide nodes from project list so that they will not end up cluttering
the locator with directory locations (which creator can not open anyway).

Task-number: QTCREATORBUG-19346
Change-Id: I78d7d16b7cdacf5536e81c5001a292af0bd0c2df
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-11-22 13:16:34 +00:00
Tobias Hunger
de8e139413 CMake: Show "CMake Modules" node in simplified project tree
Show "CMake Modules" node in simplified tree. That keeps all the
Qt cmake code from mixing with the real project files.

Task-number: QTCREATORBUG-19040
Change-Id: I1a12c7f64db2c06982de1c66a6e54e4d936ae784
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-10-24 11:10:47 +00:00
Tobias Hunger
1cf1700d1c Core::FileIconProvider: Add helper method to get a directory icon with overlay
Add a helper method to request a directory icon with an overlay icon for the
project tree.

Change-Id: Idea2ea9ec2ea6790bf8d087723700364fbcafec6
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-08 11:18:09 +00:00
Tobias Hunger
68768d8e61 CMake: Get rid of <Source Directory> in server-mode
Change-Id: Ifa4f813d577ab64351d25eb4be1dc7981687da23
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-04 13:33:56 +00:00
Alessandro Portale
3624a663d8 Reduce usage of qApp in favor of static function calls
Q*Application classes have unusually many static functions. In many
cases in our code, these functions are unnecessarily called as instance
functions, using the qApp helper.

This patch replaces many occurencies of qApp with the according
Q*Application classname.

Change-Id: I6099a419fa7bf969891269c37ed7a9e817ef5124
Reviewed-by: hjk <hjk@qt.io>
2017-04-24 18:36:28 +00:00
hjk
bd5e2faa75 ProjectNodes: Handle supported actions one-by-one
Getting the full list for a node can get quite expensive e.g. in
cases of recursive calls of QMakeProjectManager::findPriFile.

However, the FlatModel needs to decide quickly on whether an item
is editable to potentially allow renaming.

So split up QList<Actions> supportedActions() into individual
bool supportsAction(action) calls and make sure Rename is not
on the critical path.

Task-number: QTCREATORBUG-17953
Change-Id: I31841847f8aa7d7b94c63d76ce71efb1c930fa69
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-04-05 12:47:03 +00:00
Montel Laurent
f3c8a2db1e Use isEmpty() vs "count() == 0"
Change-Id: I9b3103fbc4e881693039c1a5e81f0d2b97803978
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-02-22 10:27:14 +00:00