Commit Graph

67787 Commits

Author SHA1 Message Date
Christian Kandeler
84865016ea Locator: Use extra info as secondary sorting criterion for C++
... classes and functions.
The extra info is usually the scope or the file, so this effectively adds
some helpful grouping.

Fixes: QTCREATORBUG-2538
Change-Id: I2404fee1df88fc51871a72db0dcc9c75d6ba6dcb
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-04 16:20:55 +00:00
Alessandro Portale
c25afb1b59 McuSupport: Remove explicit appointment of Jom as CMAKE_MAKE_PROGRAM
Detecting the presence of Jom, setting CMAKE_MAKE_PROGRAM to it and
choosing "NMake Makefiles JOM" as CMake generator was implemented in a
time where the Qt SDK did not yet ship ninja.

By now, ninja is shipped and it *should* be automatically installed as
dependency of Qt for MCUs. Qt Creator will by default prefer ninja as
generator/buildtool if it is installed.

Task-number: QTMCU-18
Change-Id: Ia83ac3a454b90bb5b5b69ddefb3fbb8f23fa15c9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <christiaan.janssen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-04 15:27:58 +00:00
Jarek Kobus
319300aa6c Conan: Detect automatically conan file when adding a new build config
Add a conan install step to all build configurations for all
targets in case the conan file is present in the root of the
project source tree. Do this detection only once, when configuring
the project, but not when configured project is being opened / loaded.
In addition, perform this detection also when a new build
configuration is being added.

Task-number: QTCREATORBUG-25081
Task-number: QTCREATORBUG-21785
Change-Id: I872814a33234e20104046c848b95cdfca577ed7e
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-02-04 14:40:50 +00:00
Jarek Kobus
a3318e33db Make Class View interactive again
After you load the project, and after "Parsing C/C++ Files"
has finished, if you open the Class View and start
typing in cpp editor, a warning appears:
"QObject::killTimer: Timers cannot be stopped from another thread"
and changes to source files, like adding a new method or
renaming it, are not reflected anymore in Class View.

Short:
A fix is to give timer a parent in order to move it properly
into another thread.

Long:
Just after creating a Parser object we move it into another
thread by calling moveToThread(), inside constructor of
Manager in classviewmanager.cpp. All the children
of the moved object are moved together into the target thread.
Original intention of the timer object inside Parser was
that it should live in the same thread as its parent
Parser object. In meantime, after some refactoring,
that's not the case anymore and the timer is orphaned
(parentless in terms of QObject hierarchy). It means
it's not moved together with the parent Parser anymore,
while still being a member field of the Parser.
This is reflected in a warning message and class view
doesn't react to the changes in edited document anymore.

Amends 87b3ea9af4

Change-Id: I9cca7556d5b77aa31ce7b4ab426f84a478488a84
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-04 14:38:50 +00:00
hjk
1ca15fe2e9 Utils: Add a more user-friendly accessor to BaseAspects by Id
Change-Id: Ic99bd380008afaa88a346d0d5118a1af0a00f5ff
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2021-02-04 14:06:52 +00:00
hjk
f48716ec2a Utils: Let BoolAspect announce value changes
Change-Id: Ie8393e577a5ef1cb8626050a9a39bd4b48bda115
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-04 14:06:35 +00:00
Mitch Curtis
b5ff180f8c cmakeprojectmanager: save files before build
This code path (CMakeBuildSystem::buildCMakeTarget) is taken
when building a specific target, such as when activating
Build > Build for Run Configuration. Building via e.g. Ctrl+B
takes a different code path, so this shouldn't be called more
than necessary.

Fixes: QTCREATORBUG-25276
Change-Id: I362bafda43460eaeac9cbf0f053bf457a76702f1
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-02-04 13:34:40 +00:00
David Schulz
48422187fc Cpp: Also add closing parenthesis for doxygen comments
Change-Id: Iacef35d0cbbeda743f97dd79f40a37faa0c996ad
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-04 13:25:16 +00:00
Leander Schulten
4ae93a9d27 FakeVim: Fix Qt6 build
Amends f626e27370

Change-Id: Id4681dc771a132bc6143b7e1f0b566a3930706e2
Reviewed-by: hjk <hjk@qt.io>
2021-02-04 12:15:18 +00:00
Leena Miettinen
df8aec0c19 Doc: Add docs for Washing Machine UI example
Fixes: QDS-3569
Change-Id: Ie7b09c24c0db202ae7ed504d2b40451b4f8e0908
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-04 11:47:38 +00:00
Leander Schulten
29207e3eeb CppEditor: Add Base Class Support for Generate Constructor QuickFix
Change-Id: Idd92229134609c0ac87aad030a6bb645ff4cce1b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-04 11:40:05 +00:00
Bernhard Beschow
0e0c2ca91c AutoTest: Improve type safety in TestTreeItem
Ensures that the static_cast<>() in framework() always succeeds.

Change-Id: I6aff0cf12a565bd6f9791c67979698729d7143e5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-04 11:32:45 +00:00
Bernhard Beschow
ed6083b521 AutoTest: Improve type safety in TestParseResult
By having TestParseResults take ITestFramework rather than ITestBase as
parameter, some base->asFramework() casts can be avoided today which
could possibly fail in the future.

Moreover, it allows TestTreeItem to take ITestFramework rather than
ITestBase as parameter which improves type safety further. This shall be
done in a separate commit though.

Change-Id: I66594415d68c3423076a0830ecd11080d3b6c186
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-04 11:31:56 +00:00
Bernhard Beschow
3d075d30d0 AutoTest: Fix invalid static_cast
Test tools only create ITestTreeItems, not TestTreeItems.

Change-Id: Idb20844b80e351d4f0a472e4b97b074797ad6f99
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-04 11:31:09 +00:00
David Schulz
9e36689092 LanguageClient: anounce dynamic registration capabilities for formatting
Change-Id: I285c3b8d448a44e7e6e9b6ffcc6b6577d4b4b53f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-04 11:22:35 +00:00
Christian Kandeler
feefe3585f CppEditor: Make "Complete switch statement" quickfix more visible
Do not require the cursor to be on the "switch" keyword, but allow it to
be anywhere within the switch construct.

Fixes: QTCREATORBUG-5379
Change-Id: Ic25504237b3ef12958f339d7176dfeeac6bd3466
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-04 11:19:53 +00:00
Alexis Jeandet
303008a09a Meson plugin: Fix segfault when switching build type
Change-Id: I837e0a7ba8dd731438d36cfb766fd60c9643be73
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-04 09:28:41 +00:00
David Schulz
45fa8894bd LanguageServerProtocol: add new format options
see https://microsoft.github.io/language-server-protocol/specifications/
specification-3-15/#version_3_15_0

Change-Id: I6279ad9d8d4db706daab56efef45a13a3f8b06ae
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-04 08:53:14 +00:00
Eike Ziller
cb96b91dd4 Refactor Locator filter settings saving
Unify setting saving. Do not write settings that stay at the default, so
defaults could change and take effect.

For this we explicitly differentiate between default and user settings.
Make QJsonDocument the basis for saving settings, because QDataStream
cannot really handle structured data where parts could be missing.

Write locator settings to a different settings group, so we do not
destroy reading older settings from older Qt Creator versions.

Task-number: QTCREATORBUG-24762
Change-Id: I5909e2d79313f6fc26159bb644fdfb43781b6c38
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-04 07:33:10 +00:00
Eike Ziller
b47a80c5ce CMake/iOS: Set up CMake configuration
For Qt6/iOS we need to use the Xcode generator, and set
CMAKE_OSX_SYSROOT, CMAKE_OSX_ARCHITECTURES, and the Qt toolchain file
with CMAKE_TOOLCHAIN_FILE.

We also may not automatically add the CMAKE_SYSROOT and
CMAKE_C(XX)_COMPILER_TARGET variables, since this is handled differently
for iOS targets.

With this building, running and debugging on the simulator works, if the
CMake project correctly sets up a MACOSX_BUNDLE_GUI_IDENTIFIER,
MACOSX_BUNDLE_BUNDLE_VERSION, MACOSX_BUNDLE_SHORT_VERSION_STRING and
MACOSX_BUNDLE_LONG_VERSION_STRING.

For the device build the signing and provisioning details are still
missing.

Task-number: QTCREATORBUG-23574
Change-Id: I12be0d102b57d834d7cae06c87842638f693c087
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-02-04 07:28:02 +00:00
Christian Stenger
3468d30286 QmlDesigner: Fix build for Qt5.14
Amends 59488d9606.

Change-Id: I70fd3f962de5abb6254a406263df2ea61c7e9bcc
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-02-04 07:26:01 +00:00
Tom Praschan
f626e27370 FakeVim: Add emulation for vim-commentary
Change-Id: I34f222182835ae160e6c4c66ad0bada79d8abeff
Reviewed-by: hjk <hjk@qt.io>
2021-02-03 17:58:22 +00:00
Tom Praschan
b1f1ecb1b5 FakeVim: Fix dot command for pasting
Fixes: QTCREATORBUG-25281
Change-Id: Ic36b87672889442520941bcefa0f5ee14b77fbc6
Reviewed-by: Lukas Holecek <hluk@email.cz>
Reviewed-by: hjk <hjk@qt.io>
2021-02-03 17:58:02 +00:00
Christian Kandeler
bcde1ead55 Fix qbs build
Change-Id: I2e5e385a938343b2dbc487f79e3cf6c7fb2199fa
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 16:54:42 +00:00
hjk
108d06c83f Debugger: Fix attaching to certain processes
On platforms without /proc (Mac...) we use 'ps' to retrieve process
lists, previously with '-o pid,comm,args'. This cuts off parts of
the executable names that are 'too long' or contain spaces. Work around
by running ps twice to retrieve arbitrarily long lines.

Fixes: QTCREATORBUG-25286
Change-Id: I617b62ccb61e90a1b43b6bdd822be0f50657504e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-03 15:57:22 +00:00
Fawzi Mohamed
d5fc1acf67 qmljs: convert QStringView -> QString in +=
+= using QStringView is available only in newer Qt

Change-Id: I67e1cbbfcba07cca826ee4353d0cac08bf46defe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-03 15:05:29 +00:00
Fawzi Mohamed
7015ef04b7 qmljs: add check for comparisons not depending on values
currently we mainly try to warn about primitive == null/undefined or
primitive === non primitive.
There are other that we could warn about null==null null==undefined,
but I feel that they might be triggered too much by clean code.

Change-Id: Id43d838d60a4e13f361be34e4bb38211777a081e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 14:05:16 +00:00
Fawzi Mohamed
cc00af8334 qmljs: fix qmljscheck
* fix ASTVariableReference::value: correctly get reference value type
by using either initialiser of bindingTarget (broken since a codemodel
update in 2018)
* disable warning for casting in bool to null comparison (it does not
cast, is always false)
* fix property checks (where skipped without default of readonly)
* remove non relevant checks (ErrInvalidPropertyType for lowercase  now that custom
value types are supported, and for properties called data)
* updated import version

Change-Id: I38407acf327d0f773b38dda4c02fb4d95a420851
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 14:03:44 +00:00
Bernhard Beschow
4f96e397d2 Nim: Resolve duplicate code
Both NimParser implementations were exactly the same code but only one
got tested.

Change-Id: Icdd8badfe60c8d2d8d3184b8307bd3ab67aee95e
Reviewed-by: Filippo Cucchetto <filippocucchetto@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
2021-02-03 13:53:49 +00:00
Sergey Levin
4d1b7d4c3d Update run configuration after device change
The run configuration name defaults to "<executable> (on <device>)".
When another device is selected e.g. using the MiniProjectTargetSelector
or Kits->Device option, the <device> part in run configuration name is
not updated and keeps referring to the initially selected device.

Change-Id: Idda828b7f33b754d3b50268d7417c9a2790db30e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-03 12:45:07 +00:00
Tim Jenssen
59488d9606 qmlpuppet: call engine()->setUiLanguage
so qml components can react on it

Change-Id: I31dc46fabeef0936accd23ed22cbebfe2cd8663c
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-03 10:32:27 +00:00
Fawzi Mohamed
5c1cbf6b3f qmljs: support inline components
* add inline components to bind.
* inserts inline components in the component that contains them (makes
  Context:lookupType simpler)
* unify Context:lookupType overloads without adding extra heap allocations
  using a template (avoid code duplication)
* add tests for inline components
* warn about nested components
* use model manager to load dependencies in tst_check (old test did
  not load dependencies and simply skipped all checks on imports)

Fixes: QTCREATORBUG-24766
Fixes: QTCREATORBUG-24705
Change-Id: Ibcade7752cdaa08e960f66db3a724ab7fb3268cf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 09:53:08 +00:00
Fawzi Mohamed
b8d99af6fd qmljs: fix arrow function reformatting
This is mainly just making sure that token that are "empty" are really
empty (to avoid writing them out in the reformatter), but still
contain the correct location (for error messages using for example
firstSourceLocation()).

Introduce a SourceLocation::zeroLength() method to make this change
simpler to do.

QtCreator does not run qlalr automatically, so it is "polluted" by the
updated generated files.

Fixes: QTCREATORBUG-25198
Change-Id: I0ab19fb380ee3d9a7d9e05d104fe313468f52703
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 09:52:40 +00:00
Timon Riedelbauch
002db1fa42 add special characters \u \U \l \L to fakevim substitute command
vim substitute (:s/) hast the option to use special characters
\u \U \l \L in the replacement part to change the case of the
following letters. This was not present in fakevim.

Change-Id: I13785db24018283c242d94fd7892765657570176
Reviewed-by: hjk <hjk@qt.io>
2021-02-03 09:34:54 +00:00
Leena Miettinen
d1934fa1c4 Doc: Fix the path to Qt Bridge installation package
The Tools folder was missing from the instructions for Windows,
which confused many users.

Change-Id: I0bed62b8064456832d89bbce80c2b3955e730c06
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2021-02-03 08:22:46 +00:00
Denis Shienkov
e106fd0090 Debugger: Handle missing {lsb|msb} tags in SVD file
The SVD file format describes the possible presence of tags
`<lsb></lsb>` and `<msb></msb>` to describe the bit fields
of the register data:

 * https://www.keil.com/pack/doc/CMSIS/SVD/html/schema_1_2_gr.html

So, we need also implement parsing for such tags from the SVD files.

Task-number: QTCREATORBUG-24414
Change-Id: I968cdfb4c86bfed0aac212c3f3a4376c8ee93ffe
Reviewed-by: hjk <hjk@qt.io>
2021-02-02 15:03:54 +00:00
hjk
977b999248 Debugger: Initialize DumperBase.output
This was used uninitialized in some put call from lldbridge's
disassembler.

Change-Id: I5a3ecf075dfd4a6c4e8a483f9f8172e295329ad0
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-02 14:07:01 +00:00
Eike Ziller
b54ab67705 Merge remote-tracking branch 'origin/4.14'
Conflicts:
	src/plugins/mcusupport/mcusupportoptions.cpp
	src/plugins/qmldesigner/assetexporterplugin/componentexporter.cpp

Change-Id: I337d1b86f54ad4433a3ed0d73e2011654ef6b950
2021-02-02 12:20:00 +01:00
Eike Ziller
91db1b51ab Fix compilation by not using optional from std
Amends 874029809f

Change-Id: I7eee4700a67b429fa2012389c39a0c965443a065
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-02-02 11:03:45 +00:00
Miikka Heikkinen
cb1dc81c86 QmlDesigner: Generate icons and preview for HDR images
Copied HDR texture generation algorithm from QtQuick3D and modified it
to create pixmaps for asset icon and navigator preview images.

Fixes: QDS-3684
Change-Id: Ia7f1240bbeb4a23c00fb8cb2685e769c2b599abb
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-02 09:45:22 +00:00
Miikka Heikkinen
dd1c89aa22 QmlDesigner: Allow using assets from entire project in subfolders
If editing a subcomponent qml, assets tab now lists assets from the
entire project, and url/font choosers list appropriate resources
from entire project with correct relative paths.

Fixes: QDS-3638
Change-Id: I4a066c30d1bd696e8edbd17754bb9df2b7880873
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-02-02 09:41:57 +00:00
Jarek Kobus
8731325ce8 Use invokeMethod instead of single shot timer with 0 timeout
Change-Id: I3ffc4bfdbc6fc58d4b90aa53427eb80653c22b65
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-02 08:15:36 +00:00
Jarek Kobus
e3ae92bc5f TextEditor: Use invokeMethod instead of singleShot timer with 0 delay
Use QCoreApplication::instance() as a context object for the
IAssistProposal deleter.

Change-Id: Idf8cd1955dca146a500da1ea036298455c8a5da1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-02 08:15:28 +00:00
Mattias Johansson
2081038953 Add gdb tracepoint support for Linux
Change-Id: Id2e46bae576a730f8c1b64a247aeed12e6d721af
Reviewed-by: hjk <hjk@qt.io>
2021-02-02 07:36:07 +00:00
Christiaan Janssen
70670cad23 McuSupport: Do not add clang to PATH when creating a new kit (1.7+)
Fixes: UL-3591
Change-Id: I7ec618aeb28bb8e79733267056d5c4c0ff7ba382
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-02 07:34:52 +00:00
Jarek Kobus
874029809f Compile fix: use Utils::optional instead of std::optional
Amends d9cd74f06d

Change-Id: Ic4a971fa2fb4659784afdc19f5b8db6a378f611e
Reviewed-by: hjk <hjk@qt.io>
2021-02-02 07:34:46 +00:00
Björn Schäpers
25e7b2c5d6 clangformat: Fix build with LLVM 12
Change-Id: I493afce92b16291cf66fc510129f2154a7162847
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-01 21:04:47 +00:00
Marco Bubke
e34eb170dc QmlDesigner: Add an reason parameter to the image cache abort callback
Sometimes we abort the request, sometimes it failed. In the first case
we maybe want the cancel the imageprovider request, in the second we
return an empty image.

Fixes: QDS-3388
Change-Id: Iaef76aa09ac734795f86447e1a7cf6a5c7b5ae81
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
2021-02-01 16:24:16 +00:00
Marco Bubke
62582877f6 QmlDesigner: Fix flacky test AsynchronousImageCache.WaitForFinished
Change-Id: I94afa8ec2925b85f5dbf44e7b2ad5db484f48148
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-01 16:06:23 +00:00
Marco Bubke
6a0cfc0c6e QmlDesigner: Fix flacky test ImageCacheGenerator.WaitForFinished
Change-Id: I7c08ec68d20a54e125805ad98f87879c99b1aad3
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-01 16:06:19 +00:00