Commit Graph

72385 Commits

Author SHA1 Message Date
Christian Kandeler
bcebf65bb1 ClangCodeModel: Make sure clangd sends all results
... for textDocument/references. The --limit-results option was recently
split up; we have to set --limit-references as well now.

Change-Id: I979aa21a11a08e829b6e843c0c135098aac7d3f5
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-11-01 14:19:46 +00:00
Christian Kandeler
4dfdbf91f6 CppEditor: Do not use clangd < 13
We will shortly need to use a command-line option that is new in clangd
13. Rather than starting to add checks for versions that won't work as
expected anyway, we simply refuse to use clangd < 13 now.

Change-Id: I42ec679e0f58449a2593cf92b4be7ed3101fa787
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-11-01 14:19:27 +00:00
David Schulz
a2cb1edb69 clangd: assert on starting client for project that already has a client
Change-Id: Ia50662063f7f7bdc26e5a842f7c25af4f4f4efdf
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-11-01 12:56:48 +00:00
Robert Löhning
91f4559720 Squish: Don't wait for nothing in tst_simple_debug
Change-Id: I74bb40b03fa13568571f4009618c523bf9c13c63
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-11-01 12:39:32 +00:00
Eike Ziller
662135bc07 FileSearch: Add some logging for search progress
Change-Id: I453b04eb3701035138900d699d4e69d5fd9b99df
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-11-01 12:11:42 +00:00
Jarek Kobus
3562c5e96e Remove unneeded includes of QProcess from cpp files
QProcess wasn't used in these files.

Change-Id: I24900bcf312eb6ea1ca3bc0c753cebb505ec552b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-11-01 12:04:41 +00:00
Mahmoud Badri
fe20c60c69 QmlDesigner: Support dnd bridge files to the assets lib
Fixes: QDS-5278
Change-Id: I2e77ddcbdd6d97ca9d63ee2c8e4871302e8636b1
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-11-01 11:15:45 +00:00
Mahmoud Badri
7ca826e2f3 QmlDesigner: Close component library's context menus when layout change
Fixes: QDS-5351
Change-Id: I06e02b7c137d2398528e6d4120d9ffbc7632c7a7
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2021-11-01 11:07:35 +00:00
David Schulz
33cfb7ebfc LanguageClient: add a human readable version of client state
Change-Id: I650e4b4932f32ad86505e9be2fc85eef6bcd6edd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-11-01 10:22:11 +00:00
Eike Ziller
a64912dad8 Keyboard settings: Update item in list when resetting
Explicitly update the item in the list when resetting a single shortcut.
This was implicitly happening if the action has a shortcut by default
(via the update of the shortcut input), but not if the action's default
shortcuts are empty.

Fixes: QTCREATORBUG-26502
Change-Id: Ic48accf6d2061e692ece9a1b756d004bac92f609
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-11-01 10:08:27 +00:00
Christian Kandeler
691acb8f87 Fix build after qbs submodule update
Change-Id: I195111ecb26dd0d313aeed5b8df3806a394d8d00
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-11-01 09:56:02 +00:00
Christian Kandeler
6e5ec9a939 ClangCodeModel: Prevent indexing with fallback client
There is no project to index.

Change-Id: I6d3ad2f894a45e2a7934cfb3c10c525299bfd34b
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-11-01 09:38:31 +00:00
Christian Kandeler
4fe5be2565 ClangCodeModel: Try harder to find out whether a function is virtual
... when following symbols with clangd.
The textdocument/implementation request is expensive, so we'd like to
make sure we only run it if we are sure that we're really dealing with a
virtual function. We re-use the information gathered during highlighting
for this purpose.

Change-Id: Id92a9a92fe2ac7fd5acf903a9ade711223ee401b
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-11-01 09:38:13 +00:00
Christian Kandeler
b403258c87 ClangCodeModel: Try to correct unexpected ClangdClient count
Ideally, it should not happen that there is more than one client per
project, but if it does, try to fix the situation by choosing the "best"
one and shutting down the others.

Change-Id: If00924925afabf6bc7efe7f33da693db323a00d8
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-11-01 09:37:39 +00:00
Eike Ziller
4dac32d661 Merge remote-tracking branch 'origin/6.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: Id5e67457e2c8c96cfcd29fb5469b6650ec7bcc94
2021-11-01 09:46:02 +01:00
Eike Ziller
00eabac565 Merge remote-tracking branch 'origin/5.0' into 6.0
Change-Id: I35236948503b2a15a56766018d3ba1c4d2530c83
2021-11-01 09:29:51 +01:00
Eike Ziller
ff2d00727c Add nullptr initialization
Amends dc5717bd06

Change-Id: Ic59db603d08054e98cbbab97151c6c1630aca71e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-11-01 08:27:40 +00:00
Miikka Heikkinen
7ea6492a17 QmlDesigner: Add imports to subcomponent manager whenever they change
Possible imports were never added to subcomponent manager after
initial design mode activation, and imports added manually via text
editor were also not added to subcomponent manager.

The old implementation also added duplicate imports to subcomponent
manager if imports were removed and readded to the document via
item library.

Fixes: QDS-5345
Change-Id: If45884f50b68282630af1d472af2816640b81c04
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-11-01 08:09:14 +00:00
Eike Ziller
3e83122888 Themes: Do not force Fusion style, use macOS dark mode instead
We forced Fusion style on all platforms if the theme was a dark one, so
the dark appearance would be handled correctly even if the "native"
QStyle didn't.

On macOS, use the system's dark mode instead, which handles window
decoration correctly and uses native controls. Switching the QStyle also
messed up things like labels of standard buttons.

Remove the hardcoded "Fusion" style from all themes and set the
preferred style to Fusion automatically on Windows and Linux if the
theme states a DarkUserInterface and no PreferredStyles is set.

Fixes: QTCREATORBUG-22477
Change-Id: I91c9143a8703fcec7aa08201de9fc33d1799196d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-01 07:54:04 +00:00
David Schulz
3b62755061 LanguageClient: additional log output for the semantic highlighter
Change-Id: Idc4d71bd988b9a23a6718932b4102a00fb94488e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-11-01 07:16:25 +00:00
Jarek Kobus
91605c3613 Use QtcProcess inside fake vim handler
Change-Id: I14af193bbf9e7fda9e5b0ba0a1647e19069c40e2
Reviewed-by: hjk <hjk@qt.io>
2021-10-29 18:54:05 +00:00
Jarek Kobus
80798f4bf4 Use QtcProcess in PdbEngine
Change-Id: I997aa8bee3422992620dcf58679e77e5b280f3ef
Reviewed-by: hjk <hjk@qt.io>
2021-10-29 18:53:31 +00:00
Ivan Komissarov
403da35f9d Update Qbs submodule to the top of 1.21 branch
Change-Id: Id5fc2c8ad40a5252582a118b1792977c0f03b988
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-10-29 15:45:24 +00:00
Assam Boudjelthia
4e3658cfa4 Android: report am start errors in case process returns success
Somehow "am start" command can output to stderr even if the process
reports success, this can cause the activity launch to fail silently.

For example calling "am start -n package/activity --user 2" can fail
if the device has no user 2, however the process result will be success,
and the stderr will contain something like:
 Error type 3
 Error: Activity class {org.qtproject.example.scroll_example/
org.qtproject.qt.android.bindings.QtActivity} does not exist.

And the app won't start.

This concerns mostly extra am start args provided by the user, but not
sure if it might happen in other cases, so make sure to report the
stderr nonetheless.

Change-Id: I9317e118fcf4fe0c3ed83dcc53c1c00564c5148e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-10-29 15:08:24 +00:00
Eike Ziller
38af447ee0 Fix context help for e.g. CMake
CMake documentation links do not have Qt's version style. So, if our try
to find "the highest version" fails, we still need to provide the link
to open.

Amends 128c7dfbef

Fixes: QTCREATORBUG-26455
Change-Id: I3e7588cac5d4ef8ee912b3f5511e63da0b8a0f52
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-10-29 15:07:48 +00:00
Alessandro Portale
5cde121aaa Debugger: Enable detection of Android Studio's lldb frontend
Android Studio (at least on Windows) ships an LLDBFrontend(.exe) which
differs in file name and version output, so that the code in
DebuggerItem::reinitializeFromFile needs to be tweakd a bit.

Fixes: QTCREATORBUG-26504
Change-Id: Ic989a6110e03088148c28a7fe6248e5f836ea2ea
Reviewed-by: hjk <hjk@qt.io>
2021-10-29 14:15:36 +00:00
Robert Löhning
5ba3eb7fcf Squish: Update for running tst_generic_highlighter
Change-Id: I262fb7a7223e235708cbc7e8e382a2448a2f8c84
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-10-29 13:20:00 +00:00
Andre Hartmann
78a1beb06e Debugger: Improve handling of stdint types
* Make (u)intX_t known as integral type
* Handle uint8_t[] the same way as char[] and unsigned char[]

Task-number: QTCREATORBUG-26501
Change-Id: I1eac21be198f8107f088e56daf435b5bb3217120
Reviewed-by: hjk <hjk@qt.io>
2021-10-29 13:12:02 +00:00
Eike Ziller
d1b78efaf6 Add "Show in File System View" to more menus
And add a shortcut for editor manager for that, similar to "Show in
Finder/Explorer" and "Open Terminal Here".

Change-Id: Iddc287106e194c856501bf38e53b3c738a2aed1a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-29 12:57:47 +00:00
Eike Ziller
03bcdc9186 Fix RPATH of Qbs binaries when built with Qt 6
The build system for Qt Creator ensures that we have the right
relative RPATH to Qt for the packages.
We still check if we need to fix the RPATHs when deploying Qt, and
the Qbs build relies on that.

That part was broken for Qt 6 since it looked for libQt5* to decide
if the relative RPATH to Qt must be added. Remove the Qt version
number from the check.

Change-Id: Ib9d0408943d61364bfe9c8813a55bf60145b7972
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
2021-10-29 12:54:26 +00:00
Christian Stenger
39d04fa886 Utils: Clean path when transforming into QFileInfo
Fixes icons for relative paths inside locator.

Fixes: QTCREATORBUG-26411
Change-Id: Ia34d3b4af791ef79be4f349bd416df1190678557
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-10-29 12:38:04 +00:00
BogDan Vatra
fd0291df92 Make TextDocument::cleanWhitespace super fast
On documents with a lot of lines of code (e.g. ~30k) saving the
documents takes ages (+6 seconds).
With this change the time is reduced to less than 150ms.

Change-Id: I8a40253a91ae40a6681d5acf1f09711c9b63bd6f
Reviewed-by: hjk <hjk@qt.io>
2021-10-29 12:17:53 +00:00
Eike Ziller
a8bc9774f9 Qt 6 build: Fix Restart button for Link to Qt
Qt 6 ignores the call to close() for the main window, if the options
dialog is still open, so explicitly close it if the user chooses
"Restart Now" from the "Link to Qt" button in the Qt options.

Fixes: QTCREATORBUG-26279
Task-number: QTCREATORBUG-24098
Change-Id: Iaa1c4774dde5e20a7f40b03e0b8768fc9c22dd6c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-29 12:08:42 +00:00
hjk
84f6b8891b Core: ExternalTool: Use FilePath also for executables
Change-Id: I6ec914b68ae41f9ee5eb28416c29d0431c5ab880
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-10-29 11:54:29 +00:00
Knud Dollereder
6d32550459 Improve 2d view navigation
- Get rid of lag when two-finger-swiping
- Enable one finger swipe and scroll gestures for the magic mouse
- Fixed a bug where the toolbar zoom slider from the transition.-
and timeline editor where not updated when zooming with a gesture.
- When scrolling the curve editor, its toolbar was scrolling together
with the rest of the view. This is now fixed in order to be
consistent with the timeline view and transition editor.

Change-Id: I611015af134976588fbcada0bc5ccfdcf8039c27
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-10-29 11:35:40 +00:00
Robert Löhning
73405cc089 Squish: Update for running tst_APTW01
Change-Id: I95ac2d2209dbc47e316b746313e4545a1b80ab55
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-10-29 11:23:37 +00:00
David Schulz
d5467917d0 Editor: Collect keyboard selections to the clipboard
Fixes: QTCREATORBUG-26492
Change-Id: I36c3ae73d8d5b2ea92cee3fd7c568b958c3235ae
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-10-29 10:57:53 +00:00
hjk
17a545115b QmlJS: Proliferate FilePath use, part 3
Change-Id: I3c293a9974414b669a1af8b98afb76a4eb4fbd11
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-10-29 08:55:29 +00:00
hjk
45a716bd0c Debugger: Use FilePath in DebuggerEngine::gotoLocation()
Change-Id: Ic3a278de7f70af677547f00bc6de4d7bd15502bd
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-29 08:40:34 +00:00
Christian Kandeler
c3a1193969 TextEditor: Add highlighting category for namespaces
... and make use of it in the built-in code model and with clangd.

Task-number: QTCREATORBUG-16580
Change-Id: I8c331f56aa1bbf91c9f768be82a779a72f40c4c7
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-29 08:36:20 +00:00
Miikka Heikkinen
dc9dc6b002 QmlDesigner: Adjust ComponentTextModifier offsets on doc text change
ComponentTextModifier offsets were set at modifier creation time, and
were not adjusted for changes on the document before the subcomponent
code. Added rudimentary change detection logic for code additions and
removals before subcomponent code and adjust offsets accordingly.

Fixes: QDS-5305
Change-Id: I816adc1fc867b7135b992fb50a5d96e2cfd3f0d2
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-10-29 07:39:15 +00:00
Thomas Hartmann
4ad8890b88 QmlDesigner: Use AuxiliaryData as cache for NodeHints
Evaluating the NodeHints can become a bottle-neck in large scenes.
The columnCount depends on the filter and is called many times
during painting.

For large scenes with many nodes this becomes a real bottle-neck
turning QDS unusable.

Task-number: QDS-5277
Change-Id: Ifbd9ec8024e30541bfaafba4c44db47f5c426bfc
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
2021-10-28 19:00:23 +00:00
hjk
761ce1feb1 QmlJS: Proliferate FilePath use, part 2
Change-Id: I631df6ba5e782e2db9e03de4e5df843d15c19f37
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-10-28 14:08:13 +00:00
David Schulz
b59c374217 Utils: sort the cursor before copying or inserting text
The user shouldn't care about the order of the individual cursors inside
the MultiTextCursor, so the order of selected texts should always be the
same as in the document.

Fixes: QTCREATORBUG-26494
Change-Id: I0d5199bda4e48f8482e20018b8f05020e16da3f6
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-10-28 13:26:27 +00:00
Cristian Adam
e51ee5e0ee GitHub Actions: Update Qt version to 6.2.1
Change-Id: I0b1bda8880620a17c51e43e5278dda5ced6be145
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-10-28 12:30:50 +00:00
David Schulz
a442d275fc Editor: hide old proposal if new proposal is empty
amends 28447355ba

Change-Id: Ica1b95e205be4328e675714dbf81f813a76ec9a3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-10-28 12:18:02 +00:00
Henning Gruendl
a9bb006442 QmlDesigner: Fix CharacterSection
* Add enabled state to Weight and Emphasis label
* Rearrange controls in character section

Change-Id: Ie90935a09e1644f642abb232c7e44db7f3a6c8d8
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-10-28 11:35:23 +00:00
Christian Kandeler
1311244832 ClangCodeModel: Do not always consult clangd for the symbol name
... when doing "find usages".
The symbol info request follows typedefs, which will result in confusing
search window contents. So do the symbol info request only if the cursor
is not on a normal identifier.

Change-Id: I0d3bd8bfd47879c59e6656a4da73344406c97a21
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-28 11:27:12 +00:00
Mahmoud Badri
5d3bc6a0c3 QmlDesigner: Execute assets adding in 1 transaction
When dropping external assets, create the items in 1 transaction so
that 1 undo press undos all assets creation.

Change-Id: I45b38542f41964a18fd6095eea9bf61b9dca4392
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-10-28 11:23:37 +00:00
Miikka Heikkinen
1f7ada8066 QmlDesigner: Remove default properties removed from model also from QML
If default property has actual value, binding, or inline node set,
it should be removed also from the QML doc when removed from the model.

Fixes: QDS-5239
Change-Id: Iffc27685321f96af46148ab877566c2026cc47d5
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-28 11:23:13 +00:00