Commit Graph

3443 Commits

Author SHA1 Message Date
hjk
77481f25ce ProjectExplorer: Base KitAspectWidget on BaseAspect
Enables re-using existing functionality.

The "Make mutable" functionality is still oddly placed. I doubt people
find and use it actively.

Change-Id: Ic6aae17e3a7df093f0f5f234f1e6e1afc196a087
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-04-19 12:02:19 +00:00
Eike Ziller
82bb6a3c72 CMake: Fix "Jump to File" with special characters
Fixes "Jump to File" from the context menu and the ctrl+click navigation
for files that contain special characters.

Fixes: QTCREATORBUG-25572
Change-Id: I7c26c6d517ced26f803c2224f0c09397f373b3b5
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-04-13 12:32:29 +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
Eike Ziller
2800f3b51f Merge remote-tracking branch 'origin/4.15'
Change-Id: I0afcf51d354ffd73a8f2956a7f78b1e4f032677b
2021-04-09 12:42:03 +02:00
Eike Ziller
d01c86d36d Fix label inconsistency in options
Fixes: QTCREATORBUG-25540
Change-Id: I9c710dce916569813347ca60d70a1a410f4f410b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2021-04-08 07:08:18 +00:00
Cristian Adam
dbb5a70f93 CMakePM: Remove non existing targets from cmake --target list
Testing with a hello project like this:

1. Go to settings select "hello" target, deselect "all"
2. Go to CMakeLists.txt and rename the hello target to hello2
3. Run CMake <-- important, this will rescan the file-api target structure
4. Build

Step 3 will notice that hello target is missing and remove it, since
no targets are there "all" will be inserted and step 4 will work.

Fixes: QTCREATORBUG-25477
Change-Id: I6a4461341550931006558e5fdecb5a4323afaf35
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-04-07 09:04:14 +00:00
Cristian Adam
85e2368b38 CMakePM: Reparse CMake project when the file-api json files change
CMake will reconfigure itself if you have modified the CMakeLists.txt
files. Qt Creator needs to reparse the file-api json structure even
if the "Auto-run CMake" is being disabled.

"Auto-run CMake" will run CMake when the project files themselves
have been changed e.g. modify and then save.

CMake will use ninja / make to reconfigure itself, generate the file-api
structure and Qt  Creator needs to keep up.

Change-Id: I12d8683b86f35bd6e0ebccec5300cd7ae8dce0b2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-04-06 15:46:07 +00:00
Eike Ziller
c0cfafdd3d Merge remote-tracking branch 'origin/4.15'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp

Change-Id: I403b236c40d73a61ae22304e289e9d4374366395
2021-04-06 15:17:40 +02:00
Cristian Adam
3da99f7832 CMakePM: Filter out utility targets from target configuration list
In the build target list there is no reason to have <target>_autogen
or <target>_autogen_timestamps targets.

Also do not sort the target list, so that the special targets stay
at top (all, clean, install etc)

Change-Id: I3107150bb40d68cc95246d4d09abc300a6e3d3fc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-04-06 12:15:52 +00:00
Cristian Adam
ca430f2a8b CMakePM: Copy the header file name to clipboard after adding class
Fixes: QTCREATORBUG-25212
Fixes: QTCREATORBUG-24301
Change-Id: Idf6104548223f6d26820bc395ee60c1a8c794c6d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-03-31 14:39:10 +00:00
hjk
341132dd0a CMake: Code cosmetics
- use newer approach to settings page layout building
- no SHOUTING enums
- namespaces
- proper dialog parent for message

Change-Id: I7adfb7487d502b8fd706c4a0c5645f4d2153e39c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-03-30 08:57:31 +00:00
Cristian Adam
a862c7b354 CMakePM: Fix "Build type" for multi configuration generators
The multi configuration generators (Visual Studio, Xcode) had an
empty "Build type" which caused failures to parse the CMake file-api
information.

Change-Id: I70ee4978cee4d43e980edf4cd512d1ca95275638
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-03-26 19:36:19 +00:00
Alessandro Portale
07f1aa7ed1 CMakeProjectManager: Remove left-over qDebug()
...from CMakeBuildSystem::updateQmlJSCodeModel

Change-Id: I2f0db764266d5580c47fb99bc6637bcd0ba508ca
Reviewed-by: hjk <hjk@qt.io>
2021-03-26 15:19:25 +00:00
hjk
beda749326 CMake: Aspectify CMakeSpecificSettings
Change-Id: I2e094c5a392964fdaf49ac30c2e0ae0f57a3b11d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-03-26 12:40:08 +00:00
Tasuku Suzuki
3bd490acdb Improve grouping and order in the build menu
Build related menu items are sorted by tasks, then configurations.
e.g.
+ Build
  + Build All Projects
  + Build All Projects for All Configurations
  ...
  + Rebuild All Projects
  + Rebuild All Projects for All Configurations
  ...
  + Clean All Projects
  + Clean All Projects for All Configurations
  ...

This patch changes the order to configuration > task like below

+ Build
  + ...
  + qmake / cmake
  + -
  + Build All Projects
  + Deploy
  + Rebuild
  + Clean
  + -
  + Build Project
  + Deploy
  + Rebuild
  + Clean
  + -
  + Build Subproject
  + Deploy
  + Rebuild
  + Clean
  + -
  + Build File
  + -
  + Build All Projects for All Configurations
  + Rebuild
  + Clean
  + -
  + Build Project for All Configurations
  + Rebuild
  + Clean
  + -
  + ...

Change-Id: I95844e51d2ae164ed9f29fdb1c51509611c514fe
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-25 14:57:37 +00:00
Eike Ziller
b213c87cf4 Merge remote-tracking branch 'origin/4.15'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp

Change-Id: I722a94f37bdd1d78625cfae503ba6d02ff083c63
2021-03-25 11:06:59 +01:00
hjk
baa794a7ba Utils: Use a full layout row for an aspect for Columns and Forms
Avoids some boilerplate on the user code side.

This seems to be the only existing case. If there'd ever be a case where
this is not appropriate, an extra Row { ... } would solve it.

Change-Id: I1ae1102e895640c0acc03b4949e3baabecfcdc49
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-03-25 04:53:05 +00:00
Alessandro Portale
460d446c61 CMakeProjectManager: Set CMAKE_TOOLCHAIN_FILE for WebAssembly
Like for Android and iOS, CMake also needs a CMAKE_TOOLCHAIN_FILE when
configuring a WebAssembly project. We pass it "qt.toolchain.cmake",
which is part of Qt6, just like we do for iOS.

Fixes: QTCREATORBUG-25519
Change-Id: Ia02cafc163da6cd94c483e860922b08a35284c71
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-03-23 18:23:43 +00:00
Cristian Adam
c9053256d3 CMakePM: Better error message when CMake file-api config is missing
Now the available configuration list is displayed, alongside with
the hint that CMAKE_BUILD_TYPE or CMAKE_CONFIGURATION_TYPES needs
to match / contain the "Build type" field.

In order to test this just clear (or set a random value) in the
"Build type" field and click "Re-configure with initial parameters"
button.

Fixes: QTCREATORBUG-25506
Change-Id: I44558c45c7050d03e72a3a0b9ce2c8d89bd6e4bc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-23 15:27:08 +00:00
Cristian Adam
9d2fab7c17 CMakePM: Clear CMake configuration to remove backup files
Also remove the CMakeCache.txt.prev, .cmake/api/v1/reply, and
.cmake/api/v1/reply.prev which might cause problems in
case of CMake configuration failure.

Change-Id: I24f049e5e0338b78393b68ab3680276388ffc6bf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-23 10:51:11 +00:00
Eike Ziller
072607962d Locator: Add longer description to filters
This is shown as tool tips in the location options, and if any platform
supports this also as tool tips on the menu actions of the locator input
field.

Change-Id: I8b439e45e6097a16a5f932d25d4e5d3e9bddb6ad
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-23 08:29:30 +00:00
Cristian Adam
bc518cf353 CMakePM: Disable Add and Batch Edit buttons when the file-api parsing failed
For a project that failed to generate a valid CMake file-api reply
the manual added variables could be lost when the new state doesn't
result in a valid CMake file-api reply.

The user will have to edit the initial CMake parameters to generate
a valid CMake file-api reply.

Task-number: QTCREATORBUG-24637
Change-Id: I091a301ceee3cd41ec59b6282bb9515a49c1a366
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-23 08:29:19 +00:00
Cristian Adam
1a4c7abb22 CMakePM: Keep CMakePM error messages meaningful
If CMake project parsing is failing for some reason, it's better
to keep the error message with the actual error than just replacing
it with "The project was not parsed successfully."

This error message was also issued when the project was loading,
which is a bit misleading.

In order to test this:
1. Set the build type to "" (nothing)
2. Clear CMake Configuration from menu
3. Run CMake

This will re-configure the project with initial cmake parameters,
but "-DCMAKE_BUILD_TYPE:STRING=" will set the build type to empty,
and CMakePM would try to parse 'Release' and issue:
"No 'Release' CMake configuration found".

The commit resets the error message when the project is loaded.

Change-Id: I1a586ec19f324d75a25e8f282cab02a6934fce2b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-23 08:25:37 +00:00
Eike Ziller
e9bf841dc9 Fix lupdate issues
Some wrong tr calls / missing tr functions.
Some places where we need to bring lupdate to the right track with
regard to namespace resolution.

Change-Id: Idf552054a34e24d9671db68c816bf37f4d403dbc
Reviewed-by: hjk <hjk@qt.io>
2021-03-22 15:00:37 +00:00
Cristian Adam
49a2e14357 CMakePM: Add "Re-configure with Initial Parameters" button
This makes it easier to configure a CMake project with initial cmake parameters
when parameters are added or if the configuration fails.

Task-number: QTCREATORBUG-24637
Change-Id: I880ac6ad82f7cc5e1df2e34e9bcc28e67c3d716e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-22 12:04:35 +00:00
Eike Ziller
863260f1fd Merge remote-tracking branch 'origin/4.15'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
	src/plugins/debugger/gdb/gdboptionspage.cpp

Change-Id: I4149e860b6842ea63bff3a7eb9632b7a6c2919d8
2021-03-22 09:52:14 +01:00
Cristian Adam
637d45c66a CMakePM: Make "Build type" aspect visible
For single configuration projects if you change the build type
aspect you will change the CMAKE_BUILD_TYPE variable.

When switching the build directory the existing CMAKE_BUILD_TYPE
will be set as build type aspect.

Fixes: QTCREATORBUG-25451
Change-Id: I13519e95c316c556cc1348fba6121637d2fd4275
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-19 13:38:18 +00:00
Cristian Adam
8eaf24a694 CMakePM: Fix assert with UNINITIALIZED build type
The typename needs to be STRING and not String

Change-Id: I2bddc4d7df17ff72b7e7e6ee2fa9947f2dfc1e6e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-19 13:36:04 +00:00
Erik Verbruggen
5ad724a3ac Support for QML module mapping
QUL uses module mapping for theming of QtQuick.Controls: during
code-generation the compiler is pointed to the Controls implementation
it should use. This is done by rewriting any import of QtQuick.Controls
with the given module name. The CMake build scripts will write a file
for each target to the directory "qml_module_mappings" in the build dir,
and those files will contain the mappings used.

Fixes: QTCREATORBUG-25356
Change-Id: I3f74897836dde7717b03bd6dffa46dcc0689ffdd
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2021-03-19 10:43:23 +00:00
Erik Verbruggen
2361f26732 Support merged QML import paths with header paths
QUL does not have separate QML import paths, but (re-)uses the include
paths for this purpose. Support this behavior by adding all include
paths to the QML import paths before handing the project information off
to the QML code model.

Change-Id: Ic2e39ab69ac27776f5070b7b8b7c66d53a83210b
Reviewed-by: <christiaan.janssen@qt.io>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2021-03-18 14:33:55 +00:00
Eike Ziller
5c713d624c Merge remote-tracking branch 'origin/4.15'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: I309fe2a4ea7afac85481fc6466a9a6e58e340019
2021-03-18 09:41:37 +01:00
Eike Ziller
f348e952b8 CMake: Make sure file node from project is selected
instead of node in file system tree, if it is available in the project.
For that, the nodes in the file system tree must have a higher priority
value than also the project file node.

Fixes: QTCREATORBUG-25493
Change-Id: I984adc0d205b2bac27782135772e49a6df2bbd0f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-03-18 07:51:42 +00:00
hjk
a388769c00 CMake: Use LayoutBuilder in build configuration widget
Drop intermediate widget layers, also fix the QML debugging and profiling
aspect misalignment.

Change-Id: I5ee5041ab7db2c05efdd66598c39b589e3d4f56a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-03-16 11:37:56 +00:00
hjk
035a6ff031 Utils: Avoid intermediate widgets when using LayoutBuilder
In most cases, the layout constructed in the builder was set
on a widget which in turn was put into a vbox in the actual
widget. This is not necessary, but needs some re-ordering.

Also make sure that using not-yet-parented widgets during
layout construction does not cause visible artifacts.

Change-Id: I75727a571da093d3131ea6fba467c2c646cdb6f1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-16 11:37:44 +00:00
Eike Ziller
bce64778c5 Merge remote-tracking branch 'origin/4.15'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qtcreator_ide_branding.pri

Change-Id: I009308451e1c6276692412f498125d79a8f12a07
2021-03-11 14:10:14 +01:00
Eike Ziller
8ac091abf8 CMake: Improve layout of "Apply configuration changes" dialog
Show the CMake parameters that would be passed in a mono space font, one
option per line.

Change-Id: I462792736960b33fea669b5b753c89d21cd087fd
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-03-11 07:47:01 +00:00
Erik Verbruggen
9d90efee8b Add QML import path supplied by the kit
Although QUL has merged the QML import paths and the include paths, the
convention for C/C++ is to have the headers for a project under a
subdirectory of the include path, and do imports relative to the include
path. For example:
  #include <qul/SomeHeader.h>

The QML code model doesn't know about this convention, so for the kit
has to supply an extra QML import path for this case.

Change-Id: I82d4375dd8a1f510180f81b011a715dee8c10d60
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-03-10 14:33:06 +00:00
Cristian Adam
99dd3a0260 CMakeProjectManager: expand variables for Batch Edit
The Batch Edit dialog is offering the ability to use expanded
variables, but these variables were not expanded upon acceptance.

For the CMake command line they were expanded, but there was a
conflict between what the settings dialog as value had and what
CMake returned via file-api.

Change-Id: Ia4a64e99676c43f7b182e059f9051393aa184c19
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-10 10:30:03 +00:00
Cristian Adam
f7d729f0b5 CMakePM: Treat empty build as empty when importing CMake builds
Qt Creator 4.15 with the CMake multi-config support it parses the
correct CMAKE_BUILD_TYPE file-api json export.

With the empty build Qt Creator was giving it a name: Build, which
was not part of the file-api json export.

Fixes: QTCREATORBUG-25387
Change-Id: Id0b5f1077f6473fa5aef09397a8257b253557597
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-10 10:29:55 +00:00
Jarek Kobus
675a72e296 Fix a deadlock when closing Creator while loading a project
Replace the call to SynchronousProcess::run() by asynchronous
call that invokes a process.

This change may be tested by applying the additional patch
mentioned in QTCREATORBUG-25385 description.

Don't call the SynchronousProcess::run() from the main thread when
the Quit event was already scheduled for qApp, since the Quit event
will get removed from the awaiting queue by a call to
QEventLoop::exec().

Fixes: QTCREATORBUG-25385
Change-Id: I8af39552443bfa9b3af6e31ddce85a01b91bbbd8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-09 11:13:01 +00:00
Eike Ziller
5e1f40a3af CMake: Don't add standard Linux paths to LD_LIBRARY_PATH
If a project specifically links to a library in a standard path (like
/usr/lib/...), we do not need to add that path to LD_LIBRARY_PATH.
Actually adding it can be harmful if the build needs to link against
some other library in a different version than is available in the system
path.

Common case is linking the application against a Qt version from the
online installer. If /usr/lib/... ends up in the LD_LIBRARY_PATH before
the path to the Qt from the online installer, the system Qt is picked up
at runtime instead of the Qt from the online installer.

Fixes: QTCREATORBUG-25292
Change-Id: Ib080e41f5893fb68e9d65cc9c9f11d1a9a60f485
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-03-05 14:53:41 +00:00
Cristian Adam
69afdcd290 CMakePM: Use case insensitive search for file-api configuration
Fixes the case of CMAKE_BUILD_TYPE=RELEASE on Linux, when the project
loading would fail due to "Release" build type name used by Qt Creator.

Change-Id: I2b1a643df190fd02acc422d154a717ed5cd9ce31
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-05 12:16:22 +00:00
Cristian Adam
8c9faaf3e5 CMakePM: Do not issue error message when CMakeCache.txt is missing
Only do the backup of the CMakeCache.txt and the file-api json
reply directory when they exist.

Change-Id: I0fe1098968c5b6b3a8285745452d5a24d7ded638
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-05 11:36:54 +00:00
Cristian Adam
6fa671b329 CMakePM: Use UNINITIALIZED for -D<var>=<val> in Batch Edit
CMake is setting the UNINITIALIZED type if you forget to set the
type of a variable when you do it from command line.

Qt Creator was setting INTERNAL, which had the effect of not
being displayed in the UI at all, giving the impression that the
value has been dropped.

Change-Id: I9a6b487bf5062d288365938fd7ef99b49de42884
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-04 10:09:11 +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
Cristian Adam
8f2db9fcbe CMakePM: Ask for configuration save if the user has changed variables
If the use has forgotten to click "Apply Configuration Changes"
button in project settings but it tries to build or run the
project, then the "Apply Configuration Changes" dialog box pops
as a reminder.

Change-Id: I26728ee3c79af72125be3bede759620c2cf3d7a1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-02 14:18:53 +00:00
Cristian Adam
fe540e8828 CMakeProjectManager: Remove isCmakeChanged state
Since CMake's file-api cache is the only source of truth for
CMake configuration, there is no need to keep track of such
a state.

Qt Creator will issue -D<var>=<value> -U<var> command line
parameters for CMake, which will update the file api json files.

Change-Id: I08e7041a95422549502eb7961f96570225e942fa
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-02 09:54:27 +00:00
Cristian Adam
3c3e9a97fd CMakeProjectManager: Write cmake configuration into qtcsettings.cmake
The parameters sent to CMake are also saved as qtcsettings.cmake,
this allows Android Multi-ABI CMake projects apply the settings
for all ABIs.

This was part of 196b0da08a

Task-number: QTCREATORBUG-25183
Change-Id: I6d4f210247d5377cab855a1a051cf7aa815192c7
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2021-03-02 08:15:37 +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
Cristian Adam
faa21ef378 CMakeProjectManager: Allow copying of CMake variables
In the context menu of the CMake variables there is now a "Copy"
entry that will copy to clipboard the -D<var>:<typ>=<val> or -U<var>
values.

Task-number: QTCREATORBUG-22482
Fixes: QTCREATORBUG-24781
Change-Id: Iaa70e64fd0593398732ccb8d9036571b308b5f12
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-26 12:18:58 +00:00