Commit Graph

47434 Commits

Author SHA1 Message Date
Bernhard Beschow
c16f8ce988 AutoTest: Prefer ITestParser to ITestFramework in TestCodeParser
Preserves the level of abstraction.

Change-Id: I01354fc8fcdf846dd2ef2a20fce12f6e9c4756b2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-08 09:36:35 +00:00
Orgad Shaneh
2674e9c62e CppEditor: Fix MSVC warnings
Implicit size_t -> int conversions.

Change-Id: I8c792fb692d1c5f3572aa0037ca2f20192cdc903
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-08 08:46:28 +00:00
Orgad Shaneh
0566f4e5a1 CMake: Fix typo
Change-Id: I5a423060326aa69a8d63d97c6702034973117d4a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-08 08:44:19 +00:00
Jacopo Martellini
cc89f72fe5 TextEditor: Add option to prefer single line comments
Fixes: QTCREATORBUG-24017
Change-Id: Icf34710707b51ea9fbd348dd207950cffeedfdd3
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-08 08:36:50 +00:00
Orgad Shaneh
8a243aa6ca Meson: Fix tab order in item settings
Change-Id: I0ff2303c64f18fef30dd5e5f06ea47291b036096
Reviewed-by: hjk <hjk@qt.io>
2021-02-08 08:26:53 +00:00
Christian Kandeler
aec6126634 CppTools: Add dedicated filter option for declarations
... to the "Find Usages" result widget.

Fixes: QTCREATORBUG-25302
Change-Id: If957cbffe55f6f9288ceae9d64847e8a4a367765
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-05 16:55:06 +00:00
Aleksei German
d920c98b11 QmlDesigner: Integrate MCU example to welcome page
Task: QDS-3618

Change-Id: I65f6dc4ebd3a2f0ca97838ccc89e7054eb083941
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-05 16:18:10 +00:00
Christian Kandeler
1e3f970181 CppTools: Fix unit test
Amends 84865016ea.

Change-Id: Ia815152d2c19b17b1d11dd5c82fd7a74d0ac03cb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-05 14:12:56 +00:00
Cristian Adam
a8db7721eb CMakeProjectManager: Do not use dynamic allocation for CMakeTool
ammends 87197be604

Change-Id: I600c0c26b3301607360f93ff6075f7c7d4a1b438
Reviewed-by: hjk <hjk@qt.io>
2021-02-05 13:44:52 +00:00
Cristian Adam
87197be604 CMakeProjectManager: Do not report CMake as invalid when adding/cloning
Fixes: QTCREATORBUG-25250
Change-Id: Ic78a5645540145977c7ff0b05d8d7a5c3fc15fda
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-05 13:14:49 +00:00
Christian Kandeler
765f518de3 TextEditor: Support tooltips for buttons in text mark tooltips
In case users don't find the icon self-explanatory.

Task-number: QTCREATORBUG-25150
Change-Id: I481b1ea7f510f065f83badcb91e127ac1c81f5a1
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-05 12:43:17 +00:00
Miikka Heikkinen
2a94113352 QmlDesigner: Fix compile error
Change-Id: Ic52d29b6cba10ba00be2497b43490e5e1443ade2
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-02-05 11:54:41 +00:00
Eike Ziller
8875c59021 Core: Do not remove context objects during shutdown
Like we suppress context updates during shutdown also disconnect from
the context object's destroyed signal. At that point we don't care
anymore.

This also avoids issues if the context object lives as the child of a
widget in the MainWindow geometry. These widgets (and respectively their
children) are destroyed only in the QObject destructor, i.e. after the
MainWindow itself already destroyed all its members, including the
m_contextWidgets map.

Amends 6d97c1fcb1

Fixes: QTCREATORBUG-25310
Change-Id: I75db6f8783b5f62aa9805b69d4d2bba07b906a5b
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-05 11:27:43 +00:00
Miikka Heikkinen
dcc105bb21 QmlDesigner: Add necessary QML imports when importing 3d asset
Necessary missing import statements are generated when a 3D asset is
imported to a project.

Task-number: QDS-3683
Change-Id: I93da8ddaf5691d8ef66e167ea8b0fefd7e1c6c91
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-05 09:37:21 +00:00
Miikka Heikkinen
ee85d7f9ca QmlDesigner: Allow uppercase file suffixes in asset import
Fixes: QDS-3720
Change-Id: I2b4af981bed943e53847bb3480ced185e157b5e7
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-02-05 09:34:37 +00:00
Miikka Heikkinen
99a3ddbd23 QmlDesigner: Move 3D asset import to puppet
Moved 3D asset import to puppet to ensure import always uses the
correct version of the QtQuick3D.

Fixes: QDS-3154
Change-Id: I630a833e7231383b87bf8b7214d3545d12de15ab
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-02-05 09:34:04 +00:00
Miikka Heikkinen
f15fef7ee1 QmlDesigner: Add necessary import when dragging asset to navigator
When a sound asset or a shader asset is dragged to the navigator,
a necessary import to utilize the created item is added as well,
if it is missing and it can be found from possible imports.

Task-number: QDS-3683
Change-Id: I360af1342d5bd72b95d6988495851237694077a7
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-05 09:27:08 +00:00
Miikka Heikkinen
a57820f055 QmlPuppet: Register fonts at scene creation
Automatically register all fonts from 'fonts' folder at scene creation.

Fixes: QDS-3624
Change-Id: I38728e458952ea52c941244daaca715102a93c55
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-05 09:26:34 +00:00
Christian Kandeler
59d24fa268 Fix warnings about unused variables
Change-Id: I0bb76529a28c4288967cb79972c1863a0b1c84c6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-05 08:51:44 +00:00
Christian Kandeler
3d1b456dab CppTools: Fix parentheses mismatch
... when the ClangCodeModel is disabled.
The built-in highlighter's use of HighlightingResult::kind conflicted
with the ClangCodeModel's.
Amends d8c1e51bfe.

Change-Id: I79784679fd17d88cd543304de726f8576954b29c
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-05 08:51:31 +00:00
Christian Kandeler
6d1a6f573c GccParser: Also detect "In constructor ..."
In addition to "In function ...".

Change-Id: I307e63e9890bb2e2da2bed354b048f75dbbf952a
Reviewed-by: hjk <hjk@qt.io>
2021-02-05 08:50:36 +00:00
Leander Schulten
54e5ff7e05 Debugger: Fix build
Amends 2081038953

Change-Id: Ieae6945b2a856b8ae253bf3a49ce8a7613e88a1f
Reviewed-by: hjk <hjk@qt.io>
2021-02-04 17:18:22 +00:00
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
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
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
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
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
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
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
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
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
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