Commit Graph

68765 Commits

Author SHA1 Message Date
Christian Kandeler
89b589c0ea CppEditor: Add quickfix adding a member declaration from assignment
Fixes: QTCREATORBUG-1918
Change-Id: I92c409ba0831edb056d23ae3244f5155876c039b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-03 08:58:44 +00:00
hjk
4704dab394 Core: Allow functors for apply and finish in IOptionsPageWidget
Change-Id: Ibe9f1c3853497885510b9b2493d976812fbe2f93
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-03 08:56:44 +00:00
hjk
f8012b7ac9 TextEditor: Use IOptionPage::setWidgetCreator() for behavior settings
Change-Id: I24629e64b48c08b1321f0ebf3fca21e17a1f69a1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-05-03 08:49:29 +00:00
Jarek Kobus
b5492953e2 Barrier: Fix the missing export
Amends e46a4eba8d

Change-Id: I72d451151796b342fe97375abb30f9ef433c897e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-03 07:59:43 +00:00
Jarek Kobus
d4f022be6a LocatorWidget: Turn the new LocatorMatcher implementation on by default
Change-Id: Id9dab7ff68a710a8406879ecf4658cfb09e8f76e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-03 07:40:07 +00:00
Jarek Kobus
4b129df44f TaskTree: Enable the fluent interface for Tasks
Make it possible to use the default Task c'tor
and add selected handlers with onSetup/Done/Error()
methods.

Change-Id: I94f5806f347931faa07cff0ade620a3d30777cfe
Reviewed-by: hjk <hjk@qt.io>
2023-05-03 07:05:28 +00:00
Jarek Kobus
5c414c1043 JavaScriptFilter: Reimplement matchers()
Add JavaScriptRequest class that runs evaluation
for a given input data and for a given JavaScriptEngine.
The JavaScriptFilter holds the running JavaScriptEngine
instance.

Features:
- It creates, destroys and runs evaluation of QJSEngine
  always in one, separate thread.
- In case of a busy run of evaluator (e.g. because
  an input data contains a script with an endless loop)
  it's possible now to cancel the task before the timeout
  came. Useful when typing fast inside locator widget.

Add also the JavaScriptRequestTask to be included in
TaskTree.

Change-Id: I866069c72bad17ab899f4aca9a3f6d928738f3a3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-03 07:00:11 +00:00
Alessandro Portale
7be8bd07b2 Core: Don't change height of FancyToolButton for target chooser
A freshly started Qt Creator showed a smaller target chooser button
until a project was loaded. When loading a new project, the button
changed its height which caused a noticeable jumping of the layout in the FancyActionBar. After closing the project the higher height
remained.

This change has the effect that the button has the final height right
from the start of Qt Creator and that the jumping disappears.

Change-Id: I6c9ac57c661398ba03d0b31269f62db28672ec91
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-03 06:50:30 +00:00
Cristian Adam
874b1133d9 CMakePM: Allow file rename / remove via variables
Lookup any variables found in the target definition function in order to
find the source files.

This works for something like this:

  set(SOURCE_FILES myfile.cpp)
  add_executable(myexe ${SOURCE_FILES})

Change-Id: I8a47ea64b4efa467074f03ed5e1d1d05b2b1bf00
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-02 19:04:39 +00:00
Cristian Adam
5c2b2966e7 CMakePM: Enable "Add Existing Directory"
This works via "addFiles" and it's supported.

Change-Id: I18d193878c9549581a77d74fd8eb9761c4b08271
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-02 19:04:15 +00:00
Cristian Adam
e2f83c74f4 Revert "CMakePM: Fix compile for gcc 7"
This reverts commit ca04d9afcd.

GCC 9 or later is the minimum required version nowadays, so this piece
of code can be more readable.

Change-Id: I939ee6cd62572d23d5b1de8d113472136752a590
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-02 15:25:22 +00:00
Christian Kandeler
6bf6b89fe8 GenericProjectManager: Do not make every subdir an include dir
Large projects can have thousands of subdirectories, only a tiny subset
of which are supposed to be include directories. Use the directory name
as a heuristic instead.

Fixes: QTCREATORBUG-29099
Change-Id: I207ea2b7d2739c4f6c27fa96865dfde2570caf8a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-02 15:04:30 +00:00
Orgad Shaneh
a548587a0b QbsPM: Fix clang detection in toolchainList
We should only care about the file name. If the file's directory
contains "clang", the compiler is not necessarily clang.

Reported by hjk.

Change-Id: I079c59eca37a9dbaa2ef5d669aee8e185db528f9
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-05-02 14:02:41 +00:00
Alessandro Portale
bdabb68810 Examples: Adapt line color between title and tags to category hr color
"Welcome_ForegroundSecondaryColor" is less likely to burn a permanent,
straight line into user's retina.

Change-Id: Ie6c6f02d8b53c340b322945f0d735177f22ddd56
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-02 13:19:43 +00:00
David Schulz
ba5e09f03f TextEditor: always return a valid assist interface
It is required for updating currently visible proposals. Also guard
against potential null assist interfaces.

Amends 0bd6d7a69f

Fixes: QTCREATORBUG-29096
Change-Id: Ic34d70561b471e7e529f2fb7c239b49712aca502
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-02 12:08:04 +00:00
Pranta Dastider
89acb035af QmlDesigner: Update 3D tooltip for Component 3D component
Since this was in another repository, had to put it separately
as update. This would let the Component 3D to have tooltip in the
3D components space.

Fixes: QDS-9757
Change-Id: I91bbfbcd54776774989a12d4bbefe8c8deb93ab1
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io>
2023-05-02 11:49:54 +00:00
hjk
1c2b29b31a Layouting: Introduce a 'bindTo' LayoutItem
... to 'export' the widget being operated on.

The 'Tab' related changes are related, as they affect the order
of execution.

Change-Id: I7aa079f12e49a1dab7c6a49acfae9dc684cfb479
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-02 11:44:03 +00:00
Alessandro Portale
c192536b64 Examples: Use theme colors for section separator + link
Change-Id: Ia5706dd81c0494f0a7c1a1df346918462b52ba53
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-02 09:23:41 +00:00
Eike Ziller
66c0c36bc1 Fix compiler warnings
Change-Id: I9b0b4a60d1152142f62bf3f76885cf8019714623
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-02 09:05:16 +00:00
Ali Kianian
5074c424f1 QmlDesigner: Update material preview images instead of whole refresh
Task-number: QDS-9485
Change-Id: I865c8d39dea4ec0c451f41cbe8c5f603deae4f25
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2023-05-02 08:33:19 +00:00
Jarek Kobus
3e0a179d24 ResultsCollector: Fix destructor
It may happen that still running LocatorMatcher is destructed
from the LocatorWidget destructor (i.e. from CorePlugin d'tor).
In this case the global future synchronizer is already reset,
so the d'tor of ResultsCollector can't put running deduplicator
task into the global synchronizer.

Check this case and place the deduplicator task into the global
future synchronizer only when it still exists. Otherwise, blocking
wait for the deduplicator to finish.

Change-Id: Ie788db923808dd91bdfdc4f1f53d336baf7c672a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-02 08:11:50 +00:00
Jarek Kobus
a5db02c9a7 AllProjectsFilter: Reimplement matchers()
Change-Id: I963929ce121e1dd22e0ea3ef4a72f1654b195066
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-02 08:00:22 +00:00
hjk
c3a213cc65 FakeVim: Remove QtcProcess use from fakevimhandler.cpp
fakevimhandler.{h,cpp} are meant to be re-usable outside of Qt Creator.

Amends 91605c3.

Change-Id: I569a393d13049ef92ed3ef0c4f69de5232b2fa32
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-05-02 07:45:43 +00:00
Jarek Kobus
a35fe27188 DirectoryFilter: Reimplement matchers()
Change-Id: I8891d253ba4f2409f3547b49293a35de12c3ee3c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-02 07:43:10 +00:00
Jarek Kobus
5299bca359 CurrentProjectFilter: Reimplement matchers()
Change-Id: Iec838504aa0fc1a08754779a55acb53f57b5bf6c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-02 07:42:14 +00:00
hjk
fbe9366498 LayoutBuilder: Cut remaining dependency to utils
layoutbuilder.{cpp,h} can now be re-used outside Creator

Change-Id: I306d2d8168d8a09658ea008f4606ca37a0dbbc01
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-02 07:40:55 +00:00
Jarek Kobus
68d05b05d9 TaskTree: Remove the old WaitFor, Condition, ConditionActivator
Remove it from internals of TaskTree. It's replaced with the
new mechanism consisting of Barrier, implemented outside of
TaskTree.

The change mostly reverts 29f634a8ca.

Change-Id: I1f2f4100e7c992389a19c3cc9132c3f2980b9bf8
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-02 06:54:10 +00:00
Jarek Kobus
36dad70ab0 TaskTree: Replace the usages of old WaitFor with new Barrier
Adapt the TaskTree tests and the usage in FileStreamer.
The FileStreamer may be tested by running the
FileSystemAccessTest.

Change-Id: I1d8086dd359c458b7bdd3d4d47cf249184b04c65
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-02 06:53:59 +00:00
Marcus Tillmanns
015d12ccf3 FakeVim: Accept suggestion with Tab Key
* Changed signals to callbacks as only one receiver was ever added
* Added "tabPressedInInsertMode" callback to allow accepting
  a suggestion with the Tab Key

Fixes: QTCREATORBUG-28830
Change-Id: Ie70ba595b8802b6100fff495164d8e0471b1354c
Reviewed-by: hjk <hjk@qt.io>
2023-05-02 06:53:54 +00:00
hjk
8f345bbc35 Layouting: Drop compile dependency on BoolAspect
Change-Id: I4068048f470db126a2583d6b1b90245205cfd601
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-02 06:09:04 +00:00
Marcus Tillmanns
9f0919c4a3 FakeVim: Block Suggestions
Block suggestions when FakeVim is enabled and the mode
is not "Insert" or "Replace".

Change-Id: I778eb25d9570b76e42652f9d938a8c580033c462
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-05-02 06:04:53 +00:00
Jarek Kobus
e46a4eba8d Utils: Introduce Barrier primitive
This primitive is going to replace the TaskTree's built-in
mechanism consisting of Wait, Condition and ConditionActivator
elements.

When combining 2 barriers, one placed in a custom storage,
and the other in a tree, it's possible to fully substitute
the Wait, Condition and ConditionActivator with the comparable
amount of code.

However, the Barrier is much more versatile, since it
makes it possible to:

1. distribute the decision about the ultimate barrier pass on the
   whole tree.

   In order to utilize it, increase the limit of the shared barrier
   with setLimit() to the expected number of places that participate
   in the decision about the ultimate barrier pass and use advance()
   from multiple places in the tree. When the number of calls
   to advance() reaches the limit(), the shared barrier passes
   automatically.
   Whenever some participant failed, so that the shared barrier
   can not be passed, it may call stopWithResult(false).
   Whenever some other participant decided that all the needed
   data are already collected, so that the barrier may pass early,
   it may call stopWithResult(true), making the remaining calls to
   advance no-op.

2. wait for the same barrier from multiple places.

   Before, only one WaitFor was possible for a single Condition.

3. insert multiple Barriers into one Group element.

   Before, only one WaitFor could be placed in a single Group.

Provide ready-made SingleCondition and waitFor() helpers.
With the new approach, the following equivalents are provided:

- SingleBarrier (substitutes old Condition)
- WaitForBarrier() (substitutes old WaitFor)
- Barrier (substitutes old ConditionActivator)

This change replaces the mechanism introduced in
29f634a8ca.

This change conforms to the naming scheme proposed in QTCREATORBUG-29102.

Task-number: QTCREATORBUG-29102
Change-Id: I48b3e2ee723c3b9fe73a59a25eb7facc72940c3b
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-02 05:55:55 +00:00
Jarek Kobus
56b0d77c82 TaskTree: Add an useful warning message
It's a common mistake to forget to insert the Storage
element into the tree, but reuse it from inside running
handlers.

This message should help in quick fixing the issue.

Change-Id: I771e89b06943667b56188d0655ec3da1b48f8a34
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-02 05:29:48 +00:00
Orgad Shaneh
eeb1a4e1ec Terminal: Save settings on apply
Amends 3d354290be.

Change-Id: I467806afc27f1aef474f9058426b4c3119b53e8d
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-02 05:07:48 +00:00
Christian Kandeler
3593de9846 Update qbs submodule to HEAD of 2.0 branch
Change-Id: I861f73625162351639b8f1ab61d0442cc061fad3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-29 08:37:52 +00:00
Henning Gruendl
d3b8df68eb QmlDesigner: Code cleanup in design mode widget
Remove the redundant initialization of navigation views.

Change-Id: I26d0c199cfc8be11b364763c0dba37e41dedc64e
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-04-28 18:13:29 +00:00
Henning Gruendl
3ef30f57a2 QmlDesigner: Remove output pane default workaround
Remove the workaround that always opens the Application Output when
the Output Pane view opens. This is no longer needed as the last used
output pane index is stored in the settings and used whenever the
output pane is opened the first time.

Change-Id: Ifbe6c60b5331489faff4bb0bce30c3f6fef8fba6
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-04-28 14:33:35 +00:00
Jarek Kobus
341ade96fb CppIncludesFilter: Reimplement matchers()
Change-Id: Ie449a9560203e50285bd0dab7bed7f8a5495628a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-04-28 14:24:07 +00:00
Henning Gruendl
6bf66e982b OutputPane: Fix initial pane title not set
Fix the title of the initially selected pane in the output pane
placeholder toolbar not being set by the output pane manager.

Change-Id: I94407c76454a632a9b5707edcbde0ce6dc990d61
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-28 13:57:46 +00:00
Henning Gruendl
4642c5fd7d QmlDesigner: Fix view menus intially enabled
- Fix views, workspaces and output menus being enabled in welcome mode
- Use mode instead of context change to enable/disable menus

Change-Id: I68053112d66e100e3bf3b07368310a3c3c50999d
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-04-28 13:57:32 +00:00
Henning Gruendl
66af0f4dab OutputPane: Add setting to restore previous pane
Add a setting to store the previously used output pane index to be able
to restore it on startup.

Task-number: QDS-9647
Change-Id: I2ef277e8d4c79a6d0b017e5422ad639b56b2140b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-28 13:57:25 +00:00
Jarek Kobus
9df9185382 LocatorFileCache: Update the cache in one go
Don't leave the partially updated cache when the generate()
method was canceled. Before, it was possible that only
m_filePaths were updated, without updating m_lastInput and
m_cache, what could leave the cache in inconsistent state.

Remove unneeded namespace qualifier.
Some doc fixes.

Amends 19918129bf

Change-Id: Icef6389f45f0699d851ce412f134c93353728338
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-28 13:37:05 +00:00
Christian Kandeler
239805e540 Update qbs submodule to HEAD of 2.0 branch
Change-Id: I357d5d0b6fdef8e089f4d8ef633e0ef7b1809a01
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-04-28 12:52:29 +00:00
Jarek Kobus
27f62806ca SpotlightLocatorFilter: Reimplement matchers()
Change-Id: I6ce29929516dee3b23b67f0cc07dce16ae7ad49d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-28 12:23:26 +00:00
Aleksei German
945832ce9b QmlDesigner: Remove isAvailableInVersion
Task-numbers: QDS-9420, QDS-9421
Change-Id: Ic93cb6e24c4049d6982344a9d8420b8e567c8265
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-04-28 12:19:22 +00:00
Jarek Kobus
f44641bec7 Core: Add a test for LocatorFileCache
This test corresponds to the old test for BaseFileFilter.

Change-Id: If1e775f0f8490943ff41fb6a7ccc4069914fe1f2
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-28 11:20:59 +00:00
Thomas Hartmann
b92f741e60 StudioWelcome: Fix crash
We have to if the project actually has a QmlBuildSystem.

Task-number: QDS-9804
Change-Id: I1740f1c0772641888a8828b10380f442308bfe46
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-04-28 11:13:28 +00:00
Jarek Kobus
19918129bf ILocatorFilter: Introduce LocatorFilterCache
It's going to be used as a BaseFileFilter replacement.

Add docs for it.

Change-Id: I20a52d948373238b07db6cbe1bbadf8c648ae3bf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-28 08:23:28 +00:00
Miikka Heikkinen
5b09065572 QmlDesigner: Fix puppet crash on View3D removal
Fixes: QDS-9591
Change-Id: Idff3e996c66296863b7549b7d8649049497642e0
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-04-28 07:35:32 +00:00
hjk
e13c000196 CppEditor: Use IOptionPage::setWidgetCreator() for cppquickfix settings
Change-Id: I33455f2ea98b1cafbb56ab8267b4d0afca106f33
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-04-28 07:29:55 +00:00