Commit Graph

3443 Commits

Author SHA1 Message Date
Eike Ziller
209ecc91a0 CMake: Fix configurations tab bar appearance
A tab bar should span completely above the group that it "tabs", and
have no spacing to it. Otherwise there are funny visual artifacts, and
the visual correspondance is not clear.

Add an option for spacing to LayoutBuilder for that.

Change-Id: I5ca9dc713fff95599c9ec1cf90abe8473bc67c2a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-16 13:38:41 +00:00
Christian Kandeler
fde7b90ee9 Fix some warnings
Change-Id: I2991f0ab84b26c93c0dbe2ec79f7638d299e3d39
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-11 12:14:27 +00:00
Eike Ziller
b98de260e3 Merge remote-tracking branch 'origin/6.0' into 7.0
Change-Id: I61bc71d3a4e786b5392aed408f0efe4d28fe7e67
2022-02-11 10:49:15 +01:00
Alessandro Portale
26bf18e1fe Core: Turn LocatorFilterEntry ofn ILocatorFilter::accept to const &
In ILocatorFilter::accept and all the overrides.

Change-Id: I27cd6babb66d91aad57e85572a1cdc77aef4fd79
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>
2022-02-11 07:35:30 +00:00
Eike Ziller
5d675ff533 Remove QTC_ASSERT because unset toolchain is a valid condition
Change-Id: I2ba710cf4e0af31138787bb7859302ad3a3f3d03
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-02-10 11:48:11 +00:00
Cristian Adam
2eef90e86f CMakePM: Update generator kit value after Kit Configuration dialog
The CMAKE_GENERATOR variable in "Initial Configuration" didn't get
the Kit value after a change in the "Kit Configuration" dialog.

Change-Id: Ieb9d634e2e9b1a5522b189e16bb66f8cea4c63b1
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-02-10 11:08:39 +00:00
Cristian Adam
a204ad3236 CMakePM: Do not reconfigure project on KitUpdated
Initial Configuration will get the updated kit values and it's
up to the user to react.

The reconfiguration doesn't help at all, since none of
the variables / options ends up in the Current Configuration.

Change-Id: I5ee75fce1a33ce30a011ce6f1b6399fd79727ca6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-02-10 11:08:26 +00:00
Cristian Adam
4075b793c0 CMakePM: Use the right type for the few kit CMake variables
Use FILEPATH for CMAKE_C|CXX_COMPILER variables, and PATH for directory
variables like CMAKE_PREFIX_PATH.

Task-number: QTCREATORBUG-27005
Change-Id: I906de43ab97d2dbad0374469c4576d901d2f6339
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-02-09 09:15:21 +00:00
hjk
2962da2255 CMake: Prevent crash if kit has no toolchain
Amends beb167a963.

(cherry picked from commit b3375cfd56)
Fixes: QTCREATORBUG-26777
Change-Id: I65feee771a21bdfbb2a102419a0d778af97a22eb
Reviewed-by: Christiaan Janssen <christiaan.janssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-02-08 18:01:19 +00:00
Cristian Adam
93f4659533 CMakePM: Add "Close" button for Kit Configuration dialog
This looks more in sync with other dialogs that we display.

Change-Id: I445da900982b7bdcc12d810e69170b0a7695b30c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-08 15:47:29 +00:00
hjk
57afbae543 CMakeProjectManager: Move some markup out of translated strings
Eases the pain of translators.

Change-Id: I7327958ee0628698ab326b3c8d6518d3330b83dd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-08 08:57:59 +00:00
hjk
347265a969 CMakePM: Use more direct access to SourceDirectoryAspect
Change-Id: Ifc91b13fcdc9c42ad4a9521656a2bf63e08aaf78
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-02-07 17:16:58 +00:00
hjk
c6643dad65 CMakeProjectManager: Some code cosmetics
Move non-exported classed to Internal namespace, move some functions
out-of-line.

Change-Id: I3a2135104d09c0c3f799c5b8d795c93059b1ae95
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-02-07 17:16:33 +00:00
hjk
363849a372 CMakePM: Also show type of options in configuration tooltips
Change-Id: Ie6b6b270c83d7c5df117c16d637f362e8c01eaad
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-02-07 15:40:24 +00:00
Cristian Adam
612529f2a7 CMakePM: Update generator label in Kit's CMake settings
Now only the parts of the generator that have a value are displayed.
Previously the label had "<none>" for the missing values.

Change-Id: I666bd04c94c47410ee71912dc0cebbcc6c6c79d2
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-04 19:37:45 +00:00
Cristian Adam
924862093e CMakePM: Apply Kit CMake configuration to Initial Configuration
When the user changes or adds new CMake Kit parameters, the changes
are reflected in the Initial Configuration.

Change-Id: Icca1c76749c772e946ff250f94b7965cf7cf9ee8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-04 19:37:20 +00:00
Cristian Adam
201f91b867 CMakePM: Mark as changed only the changed values in "Batch Edit..."
Previously all values coming from "Batch Edit..." would be considered
as user changed values and be displayed with bold font.

This means that if I had -DMY_VAR:BOOL=ON and do a Copy and paste
in "Batch Edit..." I would have it displayed as user changed and
it would be passed to CMake as changed value.

Also it should be possible to start with -DMY_VAR:BOOL=ON, click
the check box to make it OFF and then do a "Batch Edit..." with
-DMY_VAR:BOOL=ON to set the value back to original value.

Change-Id: I5f6cb915b32a3288c1339135dabfd182ca16feda
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-04 19:36:10 +00:00
Cristian Adam
577ad6fa3e CMakePM: Fix crash when switching CMake tools and clicking help links
The crash scenario:
1. Switch CMake tool in Kit CMake Configuration in Settings
2. Click on the "options" help link

Change-Id: Ifdb2809789748926a5ee0e127db0c87a22efa9dc
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-04 18:11:43 +00:00
Cristian Adam
869b7810db CMakePM: Add "Help" context menu entry for CMake variables
This way one could easily jump to the documentation of a CMake
variable e.g. CMAKE_BUILD_TYPE.

Change-Id: I1b348f0a1b6c18f0f7cee29ff6409b43c6263f44
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-04 18:11:17 +00:00
Cristian Adam
270d448eb1 CMakePM: Add "generator" link to the kit's CMake settings
This way the user can access all the details from the CMake's generator
documentation.

Change-Id: I90990bf7ec0062122bc3f32d611e19da8f5f9afc
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-02-04 17:24:24 +00:00
Cristian Adam
d408e4c22c CMakePM: Add "variable" link to CMake offline/online documentation
This way an user can find quickly a CMake variable if needed.

Change-Id: Ie885a34321cf2ce31ee662659e669de88b28801c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-02-04 15:34:07 +00:00
Cristian Adam
68cb80f276 CMakePM: Add options link to the CMake offline/online documentation
This way a user can quickly find out which options can be used.

Change-Id: I6347759689a4a1431a82ff9414da0c79e357eb45
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-02-04 13:12:15 +00:00
Cristian Adam
8d12fd07e2 CMakePM: Rename "Additional CMake parameters" to "... options"
CMake documentation calls them Options, and we should use the same
terminology.

See https://cmake.org/cmake/help/v3.22/manual/cmake.1.html?#options

Change-Id: Ibb8ed9dd5a830290770a7fa89e7e5e1ce2d8c74a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-03 17:46:20 +00:00
Cristian Adam
633a9a04e2 CMakePM: Add "Kit Configuration" button in Settings page
This "Kit Configuration" button opens a dialog with the kit's
CMake settings.

This way a user can change all CMake related settings in the
project's Settings page.

Change-Id: I76b6e69ea7a9b96823f6583aef007cf413410407
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-03 17:18:30 +00:00
Cristian Adam
bc160ebe63 CMakePM: Revert selectedRows back to selectedItems
As it turns out changing to selectedRows resulted in having
the keys copied twice to clipboard.

The change would require some code adaptation.

Amends 0020ef7e30

Change-Id: Ie1decd154f7d22825f4d4eecd0bf544ecac7aa26
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-02 21:21:26 +00:00
Alessandro Portale
ccafc11fa6 Utils: Remove unused theme role TextColorHighlight
TextColorHighlight is a harsh "egineer red" #ff0000 in all themes except
one, where it is grey. Actually, TextColorHighlight was used in one
place, which now instead uses TextColorError.

Change-Id: Idcd61637edaa045fc718cf35a9d34ff1d5a64dad
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-02-02 21:19:03 +00:00
Cristian Adam
0020ef7e30 CMakePM: Settings list UI changes
The CMake parameters QTreeView has now:
- alternating row colors
- row selection

Both key and value get the same font and foreground stylings.
- bold when the key is new or the value has been changed by user
- italic when the key has been inherited from kit or initial config
- red when there are differences between the inherited value and
  the current value

Change-Id: If09bb2c3e25f59938c5f56e6dd0d6817dfe442cc
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-02 20:20:00 +00:00
Cristian Adam
9c8f46a173 CMakePM: Add "Appy Kit/Initial Configuration Value" context menu entry
Now the "Initial Configuration" and "Current Configuration" displays
in red the mismatches between kit / initial value and respectively
initial and current configuration values.

By having a "Apply Kit / Initial Configuration Value" context menu
entry the user can resolve the mismatches if needed.

Change-Id: I2e272821c3ba396cd8a6b7c81e1437cb3fd4bbad
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-01 20:27:41 +00:00
Cristian Adam
dc825e11bd CMakePM: Fix "Reset" on changed values in Settings
Previously the reset button would only work on new items being removed.
User changes on existing items would not be reverted.

Change-Id: I8d9bde058487c9568bfb802f131a29ec32fc1f8c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-01 19:10:50 +00:00
Cristian Adam
d5eed0480d CMakePM: Save initial configuration changes on "exit"
Previously the changes to "Initial Configuration" would be done only
after pressing "Re-configure with Initial Parameters".

Now the settings are saved when the widget is closed:
- a different kit is selected
- a different build type is selected
- project is closed
- switch between build and run settings

This way the changes are not lost.

Change-Id: Ia2c1c10c59bfa101332066205f98684843266f94
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-01-31 16:43:04 +00:00
Cristian Adam
a7d3f9fdba CMakePM: Display current value in CMake settings as tooltip
If you change the value of a CMake parameter in CMake settings the
new value was not displayed in the tooltip, the old value was.

Change-Id: Ie182ef42f8bf48651d170da8054d7f60f9080088
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-01-31 15:14:07 +00:00
Cristian Adam
ff66f501f2 CMakePM: Do not flush CMake parameters model on parsing complete
The flush there was as a "hack" for the case:

1. failed initial configuration (CMAKE_GENERATOR as Ninja2)
2. successful configuration

The current configuration would get current items with unexpanded
values e.g.: QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}

But flush also removed the expanded values of the selected
initial parameters from CMakeBuildSystem::updateInitialCMakeExpandableVars

This is useful when CMAKE_CXX_COMPILER changes or
CMAKE_PROJECT_INCLUDE_BEFORE gets a new path to the new Qt Creator.

Change-Id: I480ce141d043d8ba6001fa47a54b066762b6a128
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-01-28 13:54:28 +00:00
Cristian Adam
0923d8676e CMakePM: Display CMake kit mismatch values in Settings page
updateFromKit() is now called on parsingFinished and the configuration
values that differ from the ones in the Kit's CMake configuration
will be displayed in red.

The "Initial Configuration" page will display the mismatches between
kit's CMake configuration and initial parameters.

The "Current Configuration" page will display the mismatches between
the initial parameters and the current CMake parameters.

The Tooltip is displayed with a bit of more space between values
for more readability.

Change-Id: I6ebfa71951cf979ab08f097befed2d43b74e4d6e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-28 12:42:25 +00:00
hjk
abbd6cdc8c CMake: Use CommandLine to create the initial default parameters
This has at least theoretically the potential to get quoting in
"cross" configurations right. Since the consuming side is not ported,
there should be no noticeable differences yet.

Change-Id: I933ded4b1c9645055d3114d53f3d1b95b5c5539c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-01-26 18:09:31 +00:00
hjk
1fc83d2a56 Utils: Wrap various file system iteration flags and filters
... into a single class.

This makes passing them around as a whole easier, and opens a path
to have "generic" filters in form of a lambda or such.

Change-Id: Ibf644b2fedcf0f1a35258030710afff8f5873f88
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-26 13:13:41 +00:00
Eike Ziller
2fab827782 Support external editors for locator, projects and file system tree
When setting an external editor as the default editor in the MIME type
settings.

Other operations like File > Open, or when using navigation shortcuts
like Follow Symbol, and stepping with the debugger will still always
open the file within Qt Creator. The Open with... menu can still be used
to explicitly open a file in an external editor afterwards.

One of the use cases is to be able to open some files that would
otherwise unhelpfully be opened in Qt Creator's binary editor in the
systems default editor.

Fixes: QTCREATORBUG-13880
Change-Id: I852f097da8badd10de78b74e7078987447eebe98
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-01-25 12:35:55 +00:00
Cristian Adam
761e1fb13f CMakePM: Add additional CMake parameters to the Kit's CMake config
This way one could pass --warn-uninitialized in the kit's configuration,
which will be transferred to the "Initial Configuration" and so on.

Fixes: QTCREATORBUG-26826
Task-number: QTCREATORBUG-26869
Change-Id: I6d9833a065ea790fc298a75b1120dfa360f885e8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-24 13:29:40 +00:00
hjk
25f5771aa4 Rename QtSupport::BaseQtVersion to QtVersion
... and the Utils::QtVersion enum to Utils::QtMajorVersion to avoid
conflicts.

Change-Id: Ib688c67388272b7204a91444155f60b8c18a56bd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-01-24 12:13:19 +00:00
hjk
b3375cfd56 CMake: Prevent crash if kit has no toolchain
Amends beb167a963.

Change-Id: I65feee771a21bdfbb2a102419a0d778af97a22eb
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-01-21 14:11:48 +00:00
Eike Ziller
9d8a419d10 Remove qmake build files
Removes qmake as a build system for building Qt Creator itself.
Keep them for some tests that are not completely moved to CMake yet.

Change-Id: I846c6ef65626b6dfae6375fdc85d00677aa8c2fb
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-01-20 12:18:15 +00:00
Jarek Kobus
d6f56254d1 Get rid of QtcProcess::workingDirectory() overload
Adapt all callers' code so that it passes the FilePath
instead of QString. As a consequence introduce
TemporaryDirectory::masterDirectoryFilePath() and use
it where easily possible.

Change-Id: I14564949b3b916921e32a2957c84c03d1da43af2
Reviewed-by: hjk <hjk@qt.io>
2022-01-18 17:18:34 +00:00
hjk
f9c97d23c7 Utils: Add optional recursion for file system iteration
Change-Id: Icded897b129aebd7132376cff55717e16dffc040
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-18 11:52:29 +00:00
Eike Ziller
6914deb0da Merge remote-tracking branch 'origin/6.0'
Change-Id: Ie8406c1854738cabcc85ef6ddaee7559d5227bec
2022-01-17 16:52:31 +01:00
Cristian Adam
a0836a29c7 CMakePM: Refactor "Initial Parameters" as a tab bar item
Now we have "Initial Configuration" and "Current Configuration"
as tab bar buttons.

This way the UI can be shared between the two configuration states.

Task-number: QTCREATORBUG-26869
Change-Id: I8206032a2a5ac076629865057816edb99706f2ff
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-01-17 15:23:19 +00:00
David Schulz
22f4e9497d CMake: Fix build dir scan filter
Fixes: QTCREATORBUG-26846
Change-Id: I54f0249410cf0dd5cc6703767cea187a2d843868
Reviewed-by: hjk <hjk@qt.io>
2022-01-17 12:25:52 +00:00
Cristian Adam
5effbc836f CMakePM: Do not sort kit CMake parameters
As a user when I add CMake parameters in the Kit's CMake section
I expect the order of parameters not to change.

If I add something at the end, I expect to find the value at
the end.

Change-Id: I4f0e2d9b845dddb7c9d6b012945ab61b0135267c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-17 11:29:16 +00:00
Eike Ziller
6a5fccd676 CMake: Show more variables in config widget
By reducing the height of the editors for the items. At least shows 10
instead of 9 items in the same space on macOS now, and looks less
wasteful.

Change-Id: I422a772cad52a2fcc8223d188b32d8d8adf9bf95
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-01-10 14:26:40 +00:00
Cristian Adam
dfacdbefa8 CMakePM: Add ability to stop CMake run in Settings
Previously the only way to stop the CMake run was to click on "x"
button of the "Configure" progress bar.

Now you can click in Settings on "Stop CMake".

Change-Id: I167b86ba62679f197c194148b122ff0c87e87162
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-07 11:13:54 +00:00
Cristian Adam
2d9dde30dc CMakePM: Remove "Clear selection" button in Settings
The "Clear selection" button doesn't add much value in the list
of buttons.

If you have a selection it doesn't really matter, and you can
simply click on an item an the new item will be the new
selection.

Change-Id: Ie64bc379773219392c12da4c256afd462d4081a9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-05 15:05:26 +00:00
Cristian Adam
3c7d0c5c98 CMakePM: Remove grouping of cmake cache variables
Having groups made from the first underscore is not necessarily
helpful.

In some cases it creates empty groups, which can confuse users.

We have filter and search functionality in the list, which can
help with finding the right items.

Fixes: QTCREATORBUG-26218
Change-Id: I751a59b49184ea57f55d3832ef4edc8a3c33e0da
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-05 13:04:19 +00:00