Commit Graph

3443 Commits

Author SHA1 Message Date
hjk
72e30b69c5 CMake: Use new PagedSettings
More compact.

Change-Id: Ie800e52b98d23e1acd1deba9d6b6e5f778c016bb
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-10 15:22:39 +00:00
Jarek Kobus
7ce40a7691 CMakeLocatorFilter: Remove the old matchesFor() implementation
Since the base class vanished, rename the filters so that they have
the common prefix now.

Change-Id: I164c7c17229f5c5b05649afe9e7aa79069a82f82
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-10 12:34:42 +00:00
Alessandro Portale
9c31267e58 Remove ineffective resize() calls
This removes apparently unnecessary resize() calls on QWidgets based
forms which get anyways added to layouts and resized. Most of these size
values looked "accidental", i.e. neither divisible by 2 nor by 5, in
most cases a remnant from the ui inlining.

Change-Id: I95da3b93f2915ef955b5235e5c2ecc94b51f813a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-10 11:14:10 +00:00
Jarek Kobus
c75b59f9b4 Process: Rename QtcProcessPrivate -> ProcessPrivate
Rename the logging category for Process.
Fix inline comments accordingly.
Adapt warning/debug messages accordingly.

Change-Id: I2b1f0f558701def3afa3c1b04adf629833dba9e7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-05-10 06:07:22 +00:00
Cristian Adam
a8f288fc9e CMakePM: Store CMake Autorun state for all tools
Amends 2f39b51bdc

The default tool's value is taken as default global value,
then will be saved for all tools.

This fixes the case when the false Autorun value for the default
CMake tool would always be set as global autorun with no option
to actually set global Autorun value due to the "upgrade" path
mechanism.

Change-Id: I17076bc0c77b087c5d4048fdfe74ddf91d837fd4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-08 14:52:48 +00:00
Eike Ziller
bd660aaf27 CMake: Fix setting additional project files for file watching
Amends d8be2491a5

The change above introduced FileApiReader::takeCMakeFileInfos and uses
it to move the information about additional CMake files out of the
FileApiReader. But that now emptied variable was later used to inform
the project about these additional files. So, that broke the automatic
running of CMake when project files (except the toplevel one) changes.
Instead use the list of additional files that now lives in the
CMakeBuildSystem for that purpose.

Change-Id: I1062593029880af9d4c70e72e1bd101d40ad0c00
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-05-08 12:23:10 +00:00
hjk
62f3d29be4 Layouting: Introduce Ids for Items
Intenally just wrapping a 'bindTo' result, but less trigger potential
for pointer related peladophobia

Change-Id: I25171a2675fb0474ce97c04552ac1cf5ffd6ee56
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2023-05-05 15:08:23 +00:00
Eike Ziller
7724f8653f Merge remote-tracking branch 'origin/10.0'
Change-Id: I7a3925ad8e4f97461b64a70217102ed900430253
2023-05-05 10:39:47 +02:00
Cristian Adam
8854f53a42 CMakePM: Fix duplicated CMake presets kits
QTC_KIT_DEFAULT_CONFIG_HASH was introduced in order to match the
previous CMake presets kits.

This would hash the Qt and the C/C++ compiler paths.

Unfortunately on Linux CMake would pick "cc" and "c++" by default,
whilst Qt Creator uses "gcc" and "g++". The compilers would match from
the Qt Creator point of view, but the hash values would be different.

On mac there is a similar issue with compiler launchers.

This patchset fixes this by removing the hash and fixes also the issue
of allowing broken CMake presets kits (without any compilers), which
were the reason for introducing the hash key in the first place.

Fixes: QTCREATORBUG-29075
Change-Id: Id8dc081febba7bc7023c98055afc6ebfcdc55542
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-05-04 15:19:44 +00:00
Jarek Kobus
a0f6e8dc04 Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}
Follows QtcProcess -> Process rename.

Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 05:52:26 +00:00
Jarek Kobus
470c95c94b Utils: Rename QtcProcess -> Process
Task-number: QTCREATORBUG-29102
Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-04 05:52:16 +00:00
hjk
c99d848e53 CMake: Use LayoutBuilder in CMakeInstallStep
Change-Id: Idfc836d04afa29a133d87506d5542716d5d9f542
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-05-03 14:15:06 +00:00
hjk
99f7679564 Layouting: Make aspects operate on parent items, not LayoutBuilder
LayoutBuilder is meant to be an implementation detail nowadays.

Change-Id: I777ab934d3d405873e819eeddd27428d8c652f9a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-03 13:44:28 +00:00
hjk
50084f6b0e Layouting: Handle attach types via setter
Change-Id: I862f5cd109db3582b4f029787ec0cded2da39ce6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-03 13:44:19 +00:00
Jarek Kobus
a3a5b8f806 Utils: Rename asynctask.{cpp,h} -> async.{cpp,h}
Follows AsyncTask -> Async rename.

Change-Id: I37f18368ab826c9960a24087b52f6691bb33f225
Reviewed-by: hjk <hjk@qt.io>
2023-05-03 13:24:20 +00:00
Cristian Adam
c2e657bbf6 CMakePM: Allow file rename / remove for QtQuick projects
qt_add_qml_module was not consided when looking for existing project
files.

This would fail when qt_add_executable and qt_add_qml_module were used
with the same target name.

Change-Id: Ib7374a3e1213c23aaf12d100a8817a46d57a4303
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-03 12:20:54 +00:00
Cristian Adam
71b3c6950f CMakePM: Parse the CMake file before adding new / existing files
This way the functionality would work even if autorun CMake is disabled.

Change-Id: I54ab47d72664cb42486b260b895f58d37a885cce
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-03 12:17:57 +00:00
Cristian Adam
3dd4b98c0c CMakePM: Better Qt import detection
Qt6_DIR and Qt5_DIR CMake variables are additionally checked for
existence.

Qt6_ROOT and Qt5_ROOT are taken into consideration for both environment
and CMake variables.

CMAKE_PREFIX_PATH is also returned from the qmake probe. This fixes the
case when qt.toolchain.cmake is used exclusively.

Task-number: QTCREATORBUG-29075
Change-Id: I6e0c3adf7f5d9860a1cb776371e66dea1dfc26cc
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-03 11:38:07 +00:00
Cristian Adam
874b1133d9 CMakePM: Allow file rename / remove via variables
Lookup any variables found in the target definition function in order to
find the source files.

This works for something like this:

  set(SOURCE_FILES myfile.cpp)
  add_executable(myexe ${SOURCE_FILES})

Change-Id: I8a47ea64b4efa467074f03ed5e1d1d05b2b1bf00
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-02 19:04:39 +00:00
Cristian Adam
5c2b2966e7 CMakePM: Enable "Add Existing Directory"
This works via "addFiles" and it's supported.

Change-Id: I18d193878c9549581a77d74fd8eb9761c4b08271
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-02 19:04:15 +00:00
Cristian Adam
e2f83c74f4 Revert "CMakePM: Fix compile for gcc 7"
This reverts commit ca04d9afcd.

GCC 9 or later is the minimum required version nowadays, so this piece
of code can be more readable.

Change-Id: I939ee6cd62572d23d5b1de8d113472136752a590
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-02 15:25:22 +00:00
Eike Ziller
66c0c36bc1 Fix compiler warnings
Change-Id: I9b0b4a60d1152142f62bf3f76885cf8019714623
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-02 09:05:16 +00:00
Cristian Adam
3aec6b776c CMakePM: Fix presets condition with a const value
Fixes: QTCREATORBUG-29077
Change-Id: If1ebaa22c07eaa39fb8d4f24c33f26249f17d793
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-04-27 09:50:24 +00:00
Jarek Kobus
fad8ed8e28 ILocatorFilter: Simplify Sync's onSetup in matchers
Remove no longer necessary bool return value from onSetup
functions and from refresh recipe functions,
see df5e3c587a.

By default, when no return bool is specified inside a function
passed to Sync element, it's assumed that the return value is true.

Eliminate passing "=" captures in 2 lambdas.

Change-Id: I5005821444a386f70c0f05322812f98d3fd49926
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-04-27 08:42:34 +00:00
Cristian Adam
65a1637d61 CMakePM: Fix presets transitive inheritance
Fixes: QTCREATORBUG-29076
Change-Id: Ibe4c3eebb3fcebeabafc485949a19e696ecad2de
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-04-27 08:00:53 +00:00
Jarek Kobus
7db28e788f CMakeTargetLocatorFilter: Reimplement matchers()
Change-Id: I1d515da13ca2b9c84b4b21565926d6df8ca8db99
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-27 06:16:03 +00:00
The Qt Project
3a70cb2870 Merge "Merge remote-tracking branch 'origin/10.0'" 2023-04-26 09:12:23 +00:00
Christian Kandeler
02d86516c7 ProjectExplorer: Optionally show run environment in app output pane
Fixes: QTCREATORBUG-28427
Change-Id: I1022a377d3728ad5e91fa62514082110b86db9f4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-26 09:11:53 +00:00
Eike Ziller
fd93ad897f Merge remote-tracking branch 'origin/10.0'
Change-Id: I02df4ad5e4a074f572cd6dd33551864e7c82f51c
2023-04-26 11:07:54 +02:00
hjk
3edc491b2a Utils: Simplify SettingsAccessor constructors
Use setters instead.

Change-Id: I912234fa832eeb80519740ca011921f1e71d70b4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-04-26 06:32:52 +00:00
hjk
b4a6af026e Utils: Remove displayName from SettingsAccessors
It was not used.

Change-Id: I7c0927698bf31548ec076c39881561d72e8495e6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-04-26 06:23:21 +00:00
hjk
8cf500c5bc Utils: Make Layouting a top level namespace
The whole machinery is now almost only layoutbuilder.{h,cpp},
mostly independent of the rest of Utils. Idea is to finish the
separation to make it stand-alone usable also outside creator.

Change-Id: I958aa667d17ae26b21209f22412309c5307a579c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-04-25 13:31:25 +00:00
Cristian Adam
fa5c352668 CMakePM: Fix boolean cacheVariables parsing
Fixes: QTCREATORBUG-29078
Change-Id: I652343d6d688e36b6d5ecc23e91243b4cecbb87d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-04-25 12:21:54 +00:00
hjk
b7ca84c5ee Utils: Remove one LayoutBuilder::addRow() overload
The flexibility here is getting in the way later when trying to
remove the dependency on aspects.

Change-Id: I7221e80f2067292c7c80aead8f6d739fb7878f7e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-25 10:07:26 +00:00
Cristian Adam
411b2e05b8 CMakePM: Allow project files to be removed in project view
Removal of a project file is done as a rename with an empty filename.

Fixes: QTCREATORBUG-25922
Change-Id: I4443d4a31723eb1ac93f02bad633bcfaf99a9573
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-04-25 09:22:40 +00:00
Cristian Adam
54af6bd5b3 CMakePM: Allow files to be renamed in project view
This includes both with source files explicitly specified or
resulted from a file(GLOB|GLOB_RECOURSE) call.

Fixes: QTCREATORBUG-27538
Change-Id: I5ee113af168bdb8cd0a96e8ab2ae603c0607fb0b
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-25 09:22:08 +00:00
Eike Ziller
c9696fbabb Merge remote-tracking branch 'origin/10.0'
Change-Id: I8b36c1812b61dbe08fe3e7930f950e6b8e8a7079
2023-04-24 08:52:35 +02:00
Eike Ziller
5125ccf03f Merge remote-tracking branch 'origin/9.0' into 10.0
Change-Id: Ifbb14e33104b39de8ca2e1495301a53e71496ef9
2023-04-24 08:10:39 +02:00
Christian Stenger
128d40e179 CMakePM: Fix qbs build
Change-Id: I96ea5f4130c9a5449ad7c0f97f63494ecf5b0e01
Reviewed-by: hjk <hjk@qt.io>
2023-04-21 05:29:08 +00:00
Cristian Adam
039baab6e7 CMakePM: Add new / existing files for QtQuick projects
Fixes: QTCREATORBUG-28904
Fixes: QTCREATORBUG-28985
Change-Id: Id05f13cc69b8afffafba1b956ee1c90dc88c6d57
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-04-20 17:28:14 +00:00
Thiago Macieira
d1d893f098 Fix dangling references, found by GCC 13
Lifetime extension via const-ref only applies to functions that return
by value. For those that already return by reference (such as
QList::constLast()), no extension happens and we end up with a dangling
reference.

cmakebuildconfiguration.cpp:1473:25: warning: possibly dangling reference to a temporary [-Wdangling-reference]
cmakebuildconfiguration.cpp:1473:61: note: the temporary was destroyed at the end of the full expression ‘ProjectExplorer::BuildStepList::steps() const().QList<ProjectExplorer::BuildStep*>::constLast()’

Change-Id: I3b169860d8bd41e9be6bfffd1757167b7348be9b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-04-20 14:29:31 +00:00
Cristian Adam
ea94891f6b CMakePM: Only parse CMake files with the CMake parser
Change-Id: Ifc962a54ec9bf6ba0db4ec7813cb81d7c81a7d2c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-04-20 14:03:08 +00:00
hjk
7e919a07b6 CMake: Remove odd but unused assignment
Change-Id: I052baddc82b7bef24e656c35be1a4edd97a85007
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-04-20 13:09:53 +00:00
Cristian Adam
d8be2491a5 CMakePM: Add new / existing source files to project
This will add the new added source files (.cpp, .h, .qrc, .ui) to the
corresponding CMake source file as last arguments for known CMake
functions like add_executable, add_library as well for the Qt
counterprarts qt_add_executable or qt_add_library.

For custom functions the code will insert a target_sources() call.
Subsequent calls will add the files to the last target_sources.

The previous copy to clipboard mechanism and settings have been removed.

Fixes: QTCREATORBUG-26006
Fixes: QTCREATORBUG-27213
Fixes: QTCREATORBUG-28493
Fixes: QTCREATORBUG-29006
Change-Id: Ia6e075e4e5718e4106c1236673d469139611a677
Reviewed-by: hjk <hjk@qt.io>
2023-04-20 12:43:33 +00:00
Cristian Adam
d41365610f CMakePM: Integrate CMake's lexer
Kept only the needed bits to parse the CMake files.

Change-Id: I7c4aa0779846fcee91469a38f84d801513e3aa63
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-20 11:34:38 +00:00
Cristian Adam
71eb0ab9f8 CMakePM: Add CMake source file parser
Files taken from the CMake repository https://gitlab.kitware.com/cmake/cmake.git

624461526f4707a2406ebbd40245a605b6bd41fa (tag: v3.26.3)

Change-Id: I9ef388908cd22eb2748b5c17d039848ee23585b9
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-20 11:34:29 +00:00
Jarek Kobus
8175f96e50 CMakeTargetLocatorFilter: Use Acceptor for LocatorFilterEntry
Change-Id: I5f82853bab8fdc38ae0793e9865c6d1da10f8ccd
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-19 11:09:09 +00:00
Cristian Adam
a37b0f0e6c CMakePM: Add .h header files to .c source files
Utils::mimeTypesForFileName would only return "text/x-c++hdr" for .h
files.  This is perfectly fine for C++ source files.

The ancestor "text/x-chdr" is required for C source files though.

Fixes: QTCREATORBUG-28991
Change-Id: I21f038787e48e88b5e4b9e8ca386b3af80d098ea
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-19 09:40:04 +00:00
Eike Ziller
5adb656550 Show locator filter descriptions more prominently
- Sort items in the menu.
- Disable items for disabled filters.
- Show a tool tip when hovering over the magnifying glass menu.
- Add descriptions to all filters and make them more consistent.

Change-Id: Ic03e303c50422f9de5dd3c512fe32bbdc958d2ba
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-18 11:19:17 +00:00
Eike Ziller
4e6877753a Merge remote-tracking branch 'origin/10.0'
Conflicts:
	src/plugins/android/androidrunnerworker.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp

Change-Id: I1628528dbc0ffe874b49bbe022da5933b1348057
2023-04-18 12:53:45 +02:00