Commit Graph

3443 Commits

Author SHA1 Message Date
Jarek Kobus
6b588d7227 Remove unused variables
Mark some of them with Q_UNUSED, since it looks like
sometimes the copy is done on purpose, to force detach
or used for some hack with memory management.
In one case make unused variable used again.

Change-Id: I3825cd3399fa63bf6e12173c64509287d4a125e5
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-11-20 13:58:46 +00:00
Alessandro Portale
937850a292 CMakeProjectManager: Get rid of an unqualified friend
The latest libClang gives us following warning:

cmakebuildconfiguration.h:104:18: warning: unqualified friend
declaration referring to type outside of the nearest enclosing namespace
is a Microsoft extension; add a nested name specifier

Deleting is the right fix.

Change-Id: I4ccccf286044ca45ec78b0ea03a4ce8d979f06b4
Reviewed-by: hjk <hjk@qt.io>
2020-11-20 06:15:34 +00:00
Eike Ziller
5ca70bdcb3 Merge remote-tracking branch 'origin/4.14'
Change-Id: Iea84f23cf394de13e99a9ed777c8c113e4eff473
2020-11-19 15:38:13 +01:00
Eike Ziller
bdc74ea2a0 cmake: Show errors for unsupported CMake versions
Show an error icon in the CMake settings, and instead running CMake with
unsupported parameters show an error in the Issues pane.

Arguably it should not be possible to select an unsupported CMake
version in the kit settings at all (neither manually nor automatically
when setting up kits), but this is the less intrusive change for now.

Fixes: QTCREATORBUG-24553
Change-Id: I32caa2ce93d28cbd9db90e2004d60da93d32c68c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-11-19 09:51:27 +00:00
Jarek Kobus
b269066435 Use const iterator with std::find_if where possible
Make the resulting interator const.

Change-Id: I4aadcfff35f6b1015e506bc75bcfc2a1f1be4d65
Reviewed-by: hjk <hjk@qt.io>
2020-11-19 09:46:31 +00:00
Jarek Kobus
48c2afe157 Decorate some classes and methods with final keyword
This way we silence the clang warnings about calling
virtual methods from c'tor or from d'tor:
[clang-analyzer-optin.cplusplus.VirtualCall]

Change-Id: I8d6318b490152133da4833bda2ba28622bce30dd
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-19 09:45:53 +00:00
Alessandro Portale
b2a766a79a Don't access static functions/fields via instance
Courtesy of readability-static-accessed-through-instance

Change-Id: I71f54244f1e091315dac2943d9e1bfad6efa56a9
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-11-19 08:42:14 +00:00
Eike Ziller
f99e46c148 cmake: Fix version information about unsupported cmake tool
When registering a CMake version without fileapi support and setting
that in a kit, the kit shows a warning about unsupported version. It
didn't show the version of the registered CMake though. Make CMake tools
without fileapi return their version number.

Change-Id: I388d3e0a17ff4145238c5c90109522665a6f6fac
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-11-19 07:06:38 +00:00
Eike Ziller
953db51a15 cmake: Remove unused variable
Change-Id: I17d373088c3f2085c52ebf9230b3ce2f0f64074a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-11-19 07:06:31 +00:00
Alessandro Portale
30aec82285 Add missing "final" to unexported/unshared classes
Change-Id: I84d5fc39d7ef5588a20545854d0cfd0b993db090
Reviewed-by: hjk <hjk@qt.io>
2020-11-18 15:40:29 +00:00
Eike Ziller
1d2b5db02f Merge remote-tracking branch 'origin/4.14'
Change-Id: I2ae0eb18782224e48cd20d41907f9dfea6ee1771
2020-11-10 13:42:46 +01:00
Christian Stenger
564fa06399 CMakePM: Fix missing include
Change-Id: I7ed4045aa5b6b85fbf6a332161a3ad0e94bff348
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-11-09 12:27:35 +00:00
Christian Stenger
617a8aee2b CMakePM: Start integrating ctest
Gather some more information of a CMake based project to be
able to provide this later on to the AutoTest plugin.

Task-number: QTCREATORBUG-23332
Change-Id: I2beaf0a6456d57871dcf65832f0a79f37fe5fddc
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-09 11:02:37 +00:00
Dmitriy Purgin
53115259ba CMakeProjectManager: Add File System virtual folder
If a CMake project cannot be parsed by CMake, it is practically unusable in
Qt Creator. According to discussion in QTCREATORBUG-24677, a virtual
folder with the project's file system view is added to the project
manager as a convenience feature.

Fixes: QTCREATORBUG-24677
Change-Id: I48775bb89c704d3f7e5bb21ec6481bd5cc0f4b6c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-09 10:48:14 +00:00
Leena Miettinen
c742f0ac9a CMake: Fix UI text capitalization and punctuation
Task-number: QTCREATORBUG-24873
Change-Id: I2672d0360cc8a6b41f711ca9db0f76750639da4e
Reviewed-by: Asit Dhal <dhal.asitk@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-11-09 09:07:30 +00:00
Assam Boudjelthia
d604d5da18 Android: fix passing ANDROID_SDK_ROOT for CMake
Task-number: QTBUG-87991
Change-Id: I70ed0709caf339324af8c233f311a2db2945006e
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2020-11-06 10:58:32 +00:00
Christian Stenger
52c48ed232 CMakePM: Improve error output handling
This avoids a soft assert for a missing description
and correctly prints the error on the Issues pane.

Change-Id: Ieaeacf404b4a5b323bac215af72877480f627cf8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-11-06 05:21:41 +00:00
Nikolai Kosjar
888ea6bbbb CppTools: Take "-include" files into account
Fixes: QTCREATORBUG-20602
Change-Id: Ibfc518fc64ed75f93265db800558ec1d2e424bb4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-05 08:49:24 +00:00
hjk
97c6c13dcb ProjectExplorer: Remove BuildStepConfigWidget
After the previous changes it was only an empty wrapper around QWidget.

Change-Id: I58dcd82d8342c7de5e2df537044f6cf3de878a67
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-06 08:06:39 +00:00
hjk
b97b7dc6f2 ProjectExplorer: Move BuildStepWidget::summary etc to BuildStep
The step is the source of information anyway, and available at the
only place of use. No need to copy that over to the widget, neither
for keeping it up-to-date there when the mechanism is already
available in the step itself.

This creates quite some potential for the simplification of
the various createConfigWidget implementations in follow-up patches.

Change-Id: I4474665f194a1ff7c5792ad086ed53c8d3ce13e6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-05 08:16:51 +00:00
hjk
591e93316d Consolidate build/deploystep default display name handling
Use the display name from the factory as default, override if needed.

Change-Id: I03519c998432fea4120b0de8b2fc2686644635f2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-02 13:18:45 +00:00
Assam Boudjelthia
df52de2828 Android: get correct value for ANDROID_DEPLOYMENT_SETTINGS_FILE for Qt 6
CMake with Qt 6 which uses android-${target}-deployment-settings.json
file name, we use substitute ${target} with the root node target name
to get the correct file name.

Task-number: QTCREATORBUG-24678
Change-Id: Ib0c82b947b3217b6b763191b22d91ab9674fedce
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-10-02 07:13:08 +00:00
Assam Boudjelthia
a4f2779452 Android: use correct variable for Android SDK with CMake for Qt 6
Qt 6 for Android with CMake uses ANDROID_SDK_ROOT (similar to qmake),
instead of ANDROID_SDK.

Task-number: QTCREATORBUG-24678
Change-Id: Ic858b8d76b41b57ef35864a1981ebd142d0cccfd
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-10-02 07:09:15 +00:00
Assam Boudjelthia
9dcbb8ca01 Android: add prepare_apk_dir CMake target by default
Qt 6 CMake build doesn't execute prepare_apk_dir by default (this is
the equivalent of install step in qmake). Since we have the target
for installing the build artifacts to android-build already present
in the CMake targets list, it's better to just use it, instead of
using another custom step just for that.

Task-number: QTCREATORBUG-24679
Change-Id: I369d6ce513f9aaf917c5fcbb3f6aa44e36b97af8
Reviewed-by: hjk <hjk@qt.io>
2020-09-28 07:31:48 +00:00
hjk
2cabd2ceb5 Utils: Consolidate LayoutBuilder interface a bit
- the var args template for addItems was overkill creating a lot of
  instantiations. Use a temporary list instead.
- allow default constructed LayoutItems to be used for an empty cell,
  avoiding the use of a QLabel with empty text
- add an addRow({...}) overload as convenience shortcut for
  .startNewRow().addItems({...}
- rename startNewRow() to finishRow()

Change-Id: I6d49dacbac3d7acf140ca526884ba1ceeeca2e0d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-24 10:32:26 +00:00
Assam Boudjelthia
014b90f780 Android: Fix CMake parsing for Qt 6.0.0 kits
Qt for Android 6.0 with CMake requires QT_HOST_PATH to be provided for
CMake to properly parse and configure the project.

Fixes: QTCREATORBUG-24660
Change-Id: Id5d77f900698ef4d19ec8e37b14e4e3234c74ea4
Reviewed-by: hjk <hjk@qt.io>
2020-09-23 14:12:10 +00:00
hjk
cec468d78a Utils/ProjectExplorer: Move re-usabled bits of aspects to Utils
Classes involved are BaseAspect and some derived classes,
LayoutBuilder and VariableChooser.

This is mostly mechanical, with various include/using changes
to make it compile.

Change-Id: I624a457f3555f102e541c4c71e33a9423af32250
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-23 07:44:42 +00:00
Eike Ziller
3f42c989ee Fix Qt 6 build of ProjectExplorer and targets & build systems
QStringRef is gone.
qsizetype vs int.
QMultiHash::insertMulti is gone.
QXmlStreamWriter writes UTF-8 by default.

Task-number: QTCREATORBUG-24098
Change-Id: Id217e40a1f17993a84fc725976e9cb84618b0580
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-21 11:31:54 +00:00
hjk
0d185a0ad3 ProjectExplorer: Simplify use of AbstractProcessStep::init()
1. Systematically check for AbstractProcessStep::init() first in
   derived classes.
2. Use setupProcessParameters(processParameters()); by default in
   the base implementation.
3. Drop all re-implementations that are effectively the same.

Change-Id: I0ae54dd4909b354672a63ee56d0b7c2ea0732494
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-16 16:16:13 +00:00
Eike Ziller
20f51bc642 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	src/plugins/languageclient/languageclientcompletionassist.cpp

Change-Id: If12e1c532e5623ef063681309a918e7b51117b1c
2020-09-14 10:12:14 +02: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
Andy Shaw
e35af70d98 Android: Use c++_shared for STL as cxx_shared is not correct
This fixes a parsing problem from CMake as it will state:
"Invalid Android STL: cxx_shared." This amends
01b0d4f8f5

Change-Id: I315d36eac889ba53d76055814c6b43a453e1e2f7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-11 07:34:11 +00:00
hjk
d09ea40c25 CMake: Fix several issues with the CMakeBuildStep
- Store the selection of the "Current executable" target again
  (broke apparently with 2c822ae3)
- Display the resolved target of the "Current executable" seletion
  in the command line, instead of the fixed "
   '<Current executable>' text
- Make the "Current executable" translatable
- Add a tooltip explaining what it is
- Use a Utils::TreeModel instead of a QStandardItemModel for the
  target model
- As side-effect, searching in the target view using Ctrl-F seems
  to magically work again.

Change-Id: Ia4d0913f6e586f49f74da66651a9177437dad6d9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-09-11 05:00:04 +00:00
hjk
bd31ba0e09 CMake: Slim down CMakeStep interface
Change-Id: Ia2cce411647e434a9edd7ef2b66a187bad6d8c12
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-09 09:18:52 +00:00
hjk
4964d0bf81 CMake: Use StringAspect for cmake arguments
Change-Id: I18e9af5f630a2b0a11a427848368c9f980819717
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-09 06:50:17 +00:00
hjk
61bfd32438 ProjectExplorer: Introduce a ProjectConfiguration::kit() function
For convenience, and use it in some places.

Change-Id: I8f7cb502b37b2fbf4cf2d17cac9c6299558332dc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-09 06:27:21 +00:00
Alessandro Portale
a650997448 QtSupport: Add supportsMultipleQtAbis getter
Introduce bool QtSupport::supportsMultipleQtAbis().

Let AndroidQtVersion respond according to the QVersionNumber.

This allows to replace the version arithmetics in several
places with straight forward (and better findable) function calls.

Task-number: QTCREATORBUG-24471
Change-Id: Ib6e39fd6485a54e08ad66f84d4e2582989043419
Reviewed-by: hjk <hjk@qt.io>
2020-09-07 07:10:26 +00:00
Orgad Shaneh
e504d96934 Merge remote-tracking branch 'origin/4.13' into master
Change-Id: I8a2dca29595a0770f4162786b15a145f3f4133af
2020-09-04 16:11:12 +03:00
David Schulz
dba4bff703 TextEditor: use Utils::FilePath as file member in AssistInterface
Change-Id: I3bf9b013b9350411f918efdb9d1a36a2c22bf972
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-04 10:14:21 +00:00
Christian Stenger
f9600b7335 CMakePM: Fix removing cmake tools
The id might be destroyed with its parent before trying to
reference it again and put it into the list.

Change-Id: Ic7bb053293b24f0f0109a1c6479f73b7cbec2dc0
Reviewed-by: hjk <hjk@qt.io>
2020-09-04 04:32:49 +00:00
hjk
6c785c05ab ProjectExplorer: Remove ProcessParameters::resolveAll()
On all code paths, this was implicit in a ProcessParameters::setCommandLine()
which was on all code paths either called directly immediately before, or as
part of ProcessStep::setupProcessParameters().

With ProcessParameters::setCommandLine() as only user, this could be
inlined there. The effectiveWorkingDirectory() turned out to be out of
place and rather accidentally working there and was moved to
ProcessParameters::setWorkingDirectory().

Change-Id: I634f6086c2324e3cbecd3e5d50e22afc722abd3f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-08-25 14:19:04 +00:00
Eike Ziller
2a05186194 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	CMakeLists.txt

Change-Id: I799060da2cb299bb0c49a3da3530fad18427a23c
2020-08-21 10:08:55 +02:00
Wojciech Smigaj
795ccfbffc CMake: Register CMake tools detected while scanning build directories
Fixes: QTCREATORBUG-24502
Change-Id: Idf96e666e783edbf8b0fbe4216affb80b0464104
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-08-20 21:11:33 +00:00
Eike Ziller
9df06af9bd CMake: Fix comparison of source paths when importing
We need to check canonical paths with canonical paths.
Otherwise we get a mismatch when using e.g. a linked directory for the
source path on the command line and then try to import the build in Qt
Creator.

Change-Id: I153be74b6cfdf5070e023780604ce64c92df0e6d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-08-18 12:24:15 +00:00
hjk
e1d0b4cf48 CMake: Use new AbstractProcessStep convenience functions
This is actually a slight change in behavior insofar as
the summary now uses the same environment as the build
itself. This should not matter, or even be more correct.

Change-Id: I48e5be6cb7b97606f80f563ba399c4b6ff61c3bf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-08-17 12:21:04 +00:00
hjk
51e7bce109 ProjectExplorer: Rename Base*Aspect to *Aspect
In most cases they are used directly, so there's not much Base* in that.

Added the old name as alias as porting help for a while.

Change-Id: I494a8a560b8996bcf74915ea3570b504df6a6b4c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-08-14 07:35:43 +00:00
Eike Ziller
f296ed1328 Merge remote-tracking branch 'origin/4.13' into master
Change-Id: I1c426d95eedd82bd4470a64a9bafd734d23081ac
2020-08-13 11:41:32 +02:00
Alessandro Portale
2d61932387 CMakeProjectManager: Give InitialCMakeArguments a macroExpander icon
Change-Id: Ia1025f2fcecd018ff106fd6b8b9e1cc640af500e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-08-12 11:44:17 +00:00
Christian Kandeler
a7305a60e0 CMake: Parse project on initial load
When opening a project for the first time, the project has already been
added to the session when the BuildSystem object is created, whereas the
code expected a different order.

Fixes: QTCREATORBUG-24318
Change-Id: I8ccfeab7da4e566670f61bfe677a293033bdfe44
Reviewed-by: hjk <hjk@qt.io>
2020-08-12 09:13:33 +00:00
Alessandro Portale
a0463ba46c CMakeProjectManager: Give build config widgets the place they deserve
Change-Id: I10563b6b8820a9f4debbc4ca5fcbc50ba7f7a009
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-08-12 09:11:02 +00:00