Commit Graph

3443 Commits

Author SHA1 Message Date
hjk
239f79fbec CMake: Use FilePath functionality to extract qml module files
Shorter and remote-capable.

Change-Id: If6b3a419eb78da2c2763bc45f4d1e33be7dbed17
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-02-08 11:22:57 +00:00
Alessandro Portale
9db70d8810 Translations: Fix stray QApplication::translate() calls
For references to the module-own context, use Tr::tr().
For references to other modules, use the right context name (with "::"
prefix).

Change-Id: I6dce8f1ceccb23c44d93f1826402cd3be8e98e5a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-02-08 08:32:42 +00:00
hjk
8a8b50e8b5 ProjectExplorer: Proliferate Utils::FilePath use
Move the .toString() uses into  DeploymentData::addFilesFromDeploymentFile

Change-Id: Ic9ef22da1918ca105c92f0231960dab27b0d80bb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-02-08 08:21:29 +00:00
hjk
432d918329 TextEditor: Use FilePath in Command
Change-Id: I0916204eefb49713f241dd43da662f258f8c99f7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-02-08 07:34:30 +00:00
Eike Ziller
3358f94cb7 CMake: Detect cmake from ARM homebrew on macOS
Change-Id: I67c539c9e9a42de086df9e0c12fa4e661494e121
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-02-07 08:01:33 +00:00
Eike Ziller
d278135497 Merge remote-tracking branch 'origin/9.0' into 10.0
Change-Id: I8d73198561f6ff7877d580681ca2a0018b7dc3b1
2023-02-06 10:14:18 +01:00
Christian Stenger
37a86061d8 CMakePM: Adapt to change in FilePath
Silences some soft asserts.

Change-Id: I4e39b66983552d85650062a3e8748e91936e8174
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-02-06 05:25:54 +00:00
Cristian Adam
2eb9338be0 CMakePM: fix presets sort assert with MSVC in debug mode
Amends 9deef74d9e

Change-Id: Id4e7fcbfa6bdc8ac65afc2c93510e8389d7e7fe4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-02-02 16:50:21 +00:00
Cristian Adam
51cbfd77db CMakePM: Improve CMake presets kit config hashing
Amends a3153c535d

QT_QMAKE_EXECUTABLE was not taken into consideration and this would
result in not matching kits.

Also Visual Studio generator will not have a CMAKE_C|XX_COMPILER values
in the cache.

On Windows there could be paths with "C:" vs "c:" and the hashes again
wouldn't match.

Change-Id: I5da5fafbd29f3d1fd8c9615c41b7659e63c30ff1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-02-02 15:56:46 +00:00
Orgad Shaneh
092209fa84 CMake: Fix potential null deref
Reported by Coverity.

Looks like it cannot really happen in real life though.

Change-Id: I92e09dbe7dc81e694e5450c598c649c956eb7fcc
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-02-01 13:54:43 +00:00
Yasser Grimes
862f484af5 McuSupport: Extend CMake targets tree for QtMCUs QmlProject projects
CMake project relies on the CMake's file-api to fill the Project View,

QtMCUs 2.4 will be using a different method to read input files (Qml,
Fonts, Images, Headers...) using qmlprojectexporter process, that
process is still called from CMake thus a CMakeProject is still used in
QtMCUs kits, but unlike previous versions add_sources is not called on
QtMCUs target making the list of input files read by the file-api empty
and as a result an empty Project Tree.

This commit extend uses the SessionManager to listen to when the the
projects are loaded and then use input.json file to populate QtMCUs
projects trees for projects using qmlprojectexporter the same tool
generating input.json .

Task-number: QTCREATORBUG-28516
Change-Id: I30a9daf1032e727692b8d71d01ab65634d0ae2a6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-01-31 13:25:07 +00:00
Christian Kandeler
97976fd3cb ProjectExplorer: Refactor BuildSystem::extraCompilerForSource
Factor out backend into more generic function to easily support new
accessors.
No functional changes.

Change-Id: I715ce2842d2c63574bdf6ada0d0e32fbfd5d08fb
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-01-27 12:42:23 +00:00
Christian Kandeler
0d909c353c Designer: Update C++ code model on an object name change in designer
We try to locate the old symbol name in the generated ui header and
rename the symbol in the background.

Task-number: QTCREATORBUG-1179
Change-Id: Iaf68e3922cd728cbc87d0dc97125e34b8bdaa6be
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-01-27 10:02:52 +00:00
hjk
3ff5661327 Move some FileSystemWatcher usages to FilePath
Change-Id: I72d24ae3f819e429009b0d7e42b21957f07cb00a
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-01-27 08:18:49 +00:00
Cristian Adam
83a86bc4fe CMakePM: Reuse EnvironmentAspect for CMake configure environment
EnvironmentAspect is used in the Run configuration page.

For a configuration not using presets the "Build Environment" will be
used by default. This is the pre Qt Creator 9 behavior.

With presets "System Environment" is used, which allows the environment
sepparation of configure and build steps.

Fixes: QTCREATORBUG-28513
Change-Id: Ie65c0a5ac67355642460fca9fc618a1d29f4b1bd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-24 13:24:23 +00:00
hjk
87c3f08e52 CMake: Move settings storage closer to class implementation
Simpler in use.

Change-Id: I8cc929001035974b9b73566b206410bfd77f73a6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-23 14:49:45 +00:00
hjk
642c593481 Utils: Flatten LayoutBuilder related hierarchies
Originally the idea was to only expose LayoutBuilder, but we
are getting more and more related items. Be consequent now,
and have everything in Utils::Layouting, but not in nested classes.

Change-Id: Ic0f98595882e5c60a25c30ec52df4a0ea79bc0ca
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-20 12:44:30 +00:00
hjk
118b84ffd6 Use simpler Plugin::initialize() when feasible
Change-Id: I567965d266f20526bda9f823e31a04b354d53fb1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-20 12:13:10 +00:00
Jarek Kobus
bad66c1fc2 CMakeBuildSystem: Run ctest process asynchronously in main thread
Instead of running it in other thread using blocking interface.

Amends 675a72e296

Change-Id: Ia4c7701fa4cd9efea4aeccd979dfb8cde28a889e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-18 13:33:25 +00:00
Eike Ziller
561b815d7b Merge remote-tracking branch 'origin/9.0'
Change-Id: I73396bcd07852ff5e01d73b06ebd64ab6af802e5
2023-01-18 10:02:35 +01:00
Tasuku Suzuki
ae59898aad CMakeProjectManager: Override 'Open Terminal' func to open build dir
88eda2322b did it for BuildEnvironmentWidget

Change-Id: I708dc8756564fb6aef85421e2e4663a29a7ffdd6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-01-17 15:28:45 +00:00
Eike Ziller
9256340e5b CMake: Fix missing path to Ninja from Qt installers
In the configure environment for MSVC toolchains.
The MSVC toolchain actually overwrites the PATH environment (triggered
via kit()->addToBuildEnvironment(result)), which it shouldn't.
But this is a minimal fix for Qt Creator 9.0 that also is in line with
what BuildConfiguration::baseEnvironment() does.

Fixes: QTCREATORBUG-28685
Change-Id: I0cb8e3c84419403672175bd581c16d90902e23ba
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-01-16 07:43:38 +00:00
hjk
e7c536011f Prefix Tr::tr contexts with ::
To make outliers better visible in Linguist

Change-Id: Ic35ea2a858b7e3576d9a416fb494fddb616eaaa1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-13 12:00:17 +00:00
Jarek Kobus
1e10161bf2 CppProjectUpdater: Reuse TaskTree
Change-Id: I7474e5a31d169bf435d94536cffd77d218320977
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-01-11 16:32:12 +00:00
Eike Ziller
0dfa542bee Merge remote-tracking branch 'origin/9.0'
Conflicts:
	src/plugins/cppeditor/cppcodestylesettingspage.h

Change-Id: I1aa4e2f9efc6d9cf9f284aef1abf148be9b93a60
2023-01-10 15:44:55 +01:00
hjk
4ddd28ae22 Utils: Rename QtcProcess::readAllStandard* to readAllRawStandard*
... and re-use the old QtcProcess::readAllStandard* names for
a QString-returning 'decoded' version.

For now, only use that in 'full Utf8' cases, to stay bug-compatible,
the plan is, however, to employ the QTextCodecs we have already
in the channel buffers. That will be one-by-one, though.

Change-Id: Id209e0671920d4ea4197918e872f441254112d52
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-10 12:08:53 +00:00
hjk
66c08a824d Utils: Rename most FilePath::{from,to}Variant uses to {from,to}Settings
Specifies the main purpose more clearly. The remaining ones a "true"
(internal) variants in models and as action data.

Change-Id: I8dd3c846e419f29d88283c2f48268ef6685b19fe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-10 09:00:30 +00:00
Christian Kandeler
ca4af940b1 CMakeProjectManager: Provide generators
Task-number: QTCREATORBUG-28149
Change-Id: Iaebc04d729ccb3ec14496ae74ca6aa3d9aca8bac
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-01-10 08:47:10 +00:00
hjk
68b7276f86 CMakeProjectManager: Keep using Tr::tr
Amends ac2ca7244.

Change-Id: I2373767d842c18f68c141a7dce3eab641dd5061d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-10 08:27:56 +00:00
Cristian Adam
a3153c535d CMakePM: Add default kit configuration hashing
This adds a QTC_KIT_DEFAULT_CONFIG_HASH variable containing the hash of
all the default Qt Creator CMake kit variables:
  * CMAKE_C_COMPILER
  * CMAKE_CXX_COMPILER
  * QT_QMAKE_EXECUTABLE
  * CMAKE_PREFIX_PATH

This way when a CMake preset changes any of these CMake variables a new
Kit will be created. Otherwise a previous kit containing different
values will be used.

Fixes: QTCREATORBUG-28609
Change-Id: I77b67e9c8fa15dc3ff2f22c5b63d4ca1c7670fdc
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-06 18:01:32 +00:00
hjk
fbb8d94e55 Utils: Use hidden friends for FilePath comparison, hash and debug
Change-Id: Ic458d64cecdc811bac6b1cfaeae344f1da1b8211
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 12:54:59 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Cristian Adam
2f39b51bdc CMakePM: Make "Autorun CMake" a global setting
The "Autorun CMake" is only visible in the Tools settings page when
the user clicks on CMake tool.

This is not very visible and it doesn't have to be per CMake version.

Change-Id: I57ded0b2e6a3ecb731bb8bc1495b6b61bc04c8b6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-05 14:37:50 +00:00
Jarek Kobus
ea35ed9ffe AbstractProcessStep: Merge finish() with processFinished()
Change-Id: Ied15ec3ee9d3bcc80b03b2589d101c65f2fd062a
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-05 08:43:21 +00:00
Eike Ziller
371dcc3f26 Merge remote-tracking branch 'origin/9.0'
Change-Id: I58ff80e0be838ef5f149c091b8f74cda415ed53f
2023-01-02 11:19:06 +01:00
Alexey Edelev
803fb4ce77 Replace ANDROID_NATIVE_API_LEVEL with ANDROID_PLATFORM
ANDROID_NATIVE_API_LEVEL is not handled by the android toolchain files
starting the NDK version r23b. We should set ANDROID_PLATFORM instead,
to specify the NDK platform version, that exists in all NDK versions
supported by Qt. Also the ANDROID_PLATFORM variable expects the
'android-xx' format as a value, so avoid cutting the 'android-' prefix
when adding the value to the CMake configure string.

Fixes: QTCREATORBUG-28624
Change-Id: Idd4ba472e46982162e5ad74e9fc6868e50e3b434
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-12-23 17:10:13 +00:00
Cristian Adam
44d2f15108 CMakePM: Update configuration failure message
The error message was not translated. Also expanded the failure message.

Change-Id: I79307d942d047311314f70d629ff443ee0a7b2a5
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-12-20 12:00:22 +00:00
The Qt Project
0cd9df5030 Merge "Merge remote-tracking branch 'origin/9.0'" 2022-12-20 10:59:15 +00:00
hjk
33eb5ff391 CMake: Move CMakeInstallStep definition to .cpp
It doesn't have to be a Q_OBJECT. Smaller interface. Also de-noise a bit.

Change-Id: I70c056e76646e9de166ded46f6fd4f448a804112
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-12-20 10:23:23 +00:00
Eike Ziller
3f4c3a3db4 Merge remote-tracking branch 'origin/9.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/texteditor/texteditor.cpp

Change-Id: I9c8f1331be3f5442f1fd28aeb0a9bc07128629d1
2022-12-20 11:05:01 +01:00
Cristian Adam
a0afd51f3f CMakePM: Add "CMake Install" deployment step
This commit adds a "CMake Install" deployment step, which is using
"cmake --install" command.

"cmake --install" command has been added in CMake 3.15, this is why the
minimum CMake version has been updated to 3.15.

Note that CMakeBuildSystem::makeInstallCommand is still using cmake --
build --target install due to a CMake bug regarding "Ninja Multi-Config"
generator, which doesn't intall all binaries via "cmake --install".

Fixes: QTCREATORBUG-25880
Change-Id: I504674c380055d8ef136d344a78b80c17ecf9765
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-12-19 13:57:43 +00:00
Cristian Adam
70b3388684 CMakePM: Allow relative compiler paths for presets
You can have a preset with the PATH environment variable modified and
with CMAKE_C|XX_COMPILER CMake variables only as "gcc.exe" and "g++.exe"

Qt Creator now will search in PATH after the compiler file names and
work as expected.

Fixes: QTCREATORBUG-28602
Change-Id: I8520f6fcf5e542600fab08228d04d3709d3a8e8f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-12-19 11:52:37 +00:00
hjk
e42d24fca9 CppEditor: FilePathify some of the refactoring operations
... and adjust surrounding code.

Change-Id: I1d36e5a0c6ba14a1d9b8fd59340f1bb2a1e45ad1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-12-16 14:27:50 +00:00
Xavier BESSON
676a4c1ee3 Fix CMakeFormatter
CMakeFormatter was executed on the file on disk before save, which messed things completely up (PipeProcessing seems to expect the file on disk already to be saved)

Change-Id: Idc7b475b5cddeaba4dc7bcc1b7899d73b2692310
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-12-16 11:43:00 +00:00
Marcus Tillmanns
eca7044361 Utils: Add std::expected implementation
Adds a std::expected implementation that is compatible with >= C++11.

FilePath::fileContents and FilePath::writeFileContents as well as
FilePath::copyFile are changed to return std::expected.

A couple of macros have been added to aid in using the expected types.

An auto test was added showing how to use the library.

Change-Id: Ibe3aecfc1029a0cf13b45bf5184ff03a04a2393b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-12-14 10:39:29 +00:00
Eike Ziller
92ab0c7f13 CMake: Fix startup warning
Accessing MimeDatabase for text/x-cmake before plugins are initialized

There is not much use for using QMimeType internally anyway, since they
are effectively only used as strings.

Amends ac2ca7244a

Change-Id: I4d7b1bb2f0ad4e857409e3ef287f5b9abe052193
Reviewed-by: Xavier BESSON <developer@xavi-b.fr>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-12-12 15:26:29 +00:00
Cristian Adam
1e122fa3a3 CMakePM: Have case insensitive locator filters for cm and cmo
There is no reason for preserving case. We filter out a predefined list.

Change-Id: I4aa6c70210e4ecdf896c7ecc48f01d475a0afed6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-12-12 10:28:57 +00:00
Christian Stenger
20d81d3e61 CMakePM: Fix qbs build
Amends ac2ca7244a.

Change-Id: I81ac9fda00e8fd3d468cc9ea27e32f6a0280cf8b
Reviewed-by: Xavier BESSON <developer@xavi-b.fr>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-12-12 07:39:32 +00:00
Xavier BESSON
ac2ca7244a Beautifier for CMake files
Fixes: QTCREATORBUG-25773
Change-Id: I30df110512553b28894427e4d473814400153923
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-12-09 15:23:31 +00:00
Marcus Tillmanns
b3f82887a3 Utils: Change browse button to OptionPushButton
Allows the user to choose whether he wants to browse local files,
or remote files.

Change-Id: I0d262034a5c2df56bea2efca876c9019099e3da9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-12-09 08:59:13 +00:00