Commit Graph

72811 Commits

Author SHA1 Message Date
Semih Yavuz
e596707a6b preview named colors on hover
ColorPreviewHoverHandler only considered #XXXXXX and Qt::XXX
to preview colors. We can also have named colors that are
constructed from string literals. Add handling for string literals.
Note that this creates preview when hovering over any color related
string literals in the editor regardless of whether they are bound
to color property.

Also fix the crash due to the out-of-bounds access by adding boundary
check.

Fixes: QTCREATORBUG-30594
Change-Id: I5084b743c76beb6f343bd07049e3051a55fe8d53
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2024-06-19 08:12:58 +00:00
Jarek Kobus
34044757ef TaskTree: Fix tweaking done result in group done handler
If the onGroupDone() handler returned DoneResult,
this result was ignored by the running task tree.

Fix it so that the optional DoneResult takes
priority over group's workflow policy.

Add tests for it.

Change-Id: I7ffdef2af08337d7214f2c3d4b68153cddaad425
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-19 07:41:38 +00:00
Cristian Adam
b240bfb3db CMakePM: Fix crash when hovering in CMake file without a project
Fixes: QTCREATORBUG-31077
Change-Id: I60526fb37e5d8c7713a5b22dfddb3e52c50fc5f7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-18 15:51:45 +00:00
Cristian Adam
ded397ca55 Sqlite: Fix build with QTC_STATIC_BUILD
Qt Creator was failing with:

```
In file included from /home/jarek/dev/creator-14-work/src/libs/sqlite/
sqliteexception.h:6,
                 from /home/jarek/dev/creator-14-work/src/libs/sqlite/
sqlitevalue.h:7,
                 from /home/jarek/dev/creator-14-work/src/plugins/
qmldesigner/designercore/projectstorage/projectstorageinfotypes.h:8,
                 from /home/jarek/dev/creator-14-work/src/plugins/
qmldesigner/designercore/projectstorage/projectstoragetypes.h:8,
                 from /home/jarek/dev/creator-14-work/src/plugins/
qmldesigner/designercore/include/propertymetainfo.h:9,
                 from /home/jarek/dev/creator-14-work/src/plugins/
qmldesigner/designercore/include/nodemetainfo.h:6,
                 from /home/jarek/dev/creator-14-work/tests/unit/tests/
printers/gtest-creator-printing.cpp:17:
/home/jarek/dev/creator-14-work/src/libs/sqlite/sqlite3_fwd.h:7:7:
error: conflicting declaration ‘using sqlite3 = struct qtc_sqlite3’
    7 | using sqlite3 = struct qtc_sqlite3;
      |       ^~~~~~~
```

Task-number: QTCREATORBUG-30009
Change-Id: Ibc18f16ab304a92f73882c9336eebc2abd54aa44
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-06-18 15:28:59 +00:00
Mahmoud Badri
f0e49fc12a QmlDesigner: Refactor content lib user model
Add category classes for the model to make it tidier and easy to
extend (i.e. adding more categories).

Change-Id: Ied8641802f600c5cb0b036aba6ad44dbde612a09
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2024-06-18 14:52:11 +00:00
Cristian Adam
a8e2ccdea6 CMakePM: Expand CMake macros in the "vendor" debugger settings
Qt Creator will use the CMake macro expander for the "vendor" string
entries.

This would allow the following CMake preset snippet to work as a CMake
preset user would expect it to:

```
  "vendor": {
      "qt.io/QtCreator/1.0": {
        "debugger": {
          "DisplayName": "LLDB Dap 18.1.7 Debugger",
          "Abis": ["arm-darwin-generic-mach_o-64bit"],
          "Binary": "$env{HOME}/llvm/clang/bin/lldb-dap",
          "EngineType": 1024,
          "Version": "18.1.7"
        }
      }
    }
```

Change-Id: I4ea5ce0b004ff05cebbe3e0ce4b6bcc09c716322
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-18 14:48:21 +00:00
Alessandro Portale
12d222636d Core: Add Tag variant to Core::Button
As specified as Figma component.

Change-Id: Id115fe5703b58902bc7479e966787c969e6b073d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2024-06-18 14:42:37 +00:00
Marco Bubke
8106d29cf4 Utils: Add more contains functions
We have very often the following pattern.

bool isKeyword(const QString &token)
{
    static const QStringList keywords = {"if", "then", "else", ...};

    return keywords.contains(token);
}

Instead we could remove the the allocation and give the compiler
the opportunity to transform the code. constexpr makes that prossible.

bool isKeyword(QStringView token)
{
static constexpr QStringView keywords[] = {u"if", u"then", u"else",
...};

    return Utils::contains(keywords, token);
}

Change-Id: Ic25aa676085bf4bfc6e9ff3194813ff019bd40af
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-18 12:49:43 +00:00
David Schulz
5f8ffd66ff QmlJSEditor: fix assigning outline toolbar widget
Instead of adding a second toolbar widget, replace the current one. This
avoids weird situations where you get two outline toolbar widgets, one
provided by qmljseditorwidget and another one provided by qmlls.

Turning the language server on deletes the combobox created by
qmljseditorwidget, such that qmljseditorwidget has to recreate
its combobox after the language server stopped being in use.

Also make sure that m_outlineCombo is set to nullptr after it gets
deleted, such that late jumpToOutlineElement and
updateOutlineIndexNow() calls do no try to attempt stuff on an already
free'd pointer.

Change-Id: Ie323a7b3e7a4d5e24407fcedf8383dd2f0efe525
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-06-18 11:23:13 +00:00
Christian Stenger
441ce652e7 Lua: Small tweak of wizard file
Change-Id: Ifef368aa646589d75f761c9893a18fa77b1b179c
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-06-18 10:56:41 +00:00
David Schulz
c246cb8708 LanguageClient: postpone unreachable server error reporting
Since the overall nature of the communication is asynchronous calling
functions might not expect that an error is reported from within the
sendMessage function.

Fixes: QTCREATORBUG-31054
Change-Id: Ie73510eb632408a9f7a9367c3a3e47ad021da7fe
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-06-18 10:50:38 +00:00
Tim Jenssen
21d1ee2516 QmlDesigner: optimize QRegularExpression
Change-Id: Ibb167c19840dfe4e676048c1f22e91244409819c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2024-06-17 15:40:45 +00:00
Henning Gruendl
705f206e81 QmlDesigner: Avoid auto context menu on toolbar
Task-number: QDS-13021
Change-Id: Ife5831b907565964499433e974b9b152f5e1537a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-17 14:57:52 +00:00
Miikka Heikkinen
3d4fd85648 QmlDesigner: Fix 3D import preview camera FOV
Adjust FOV orientation depending on width and height of the rendered
viewport to ensure rendered scene stays within the viewport.

Change-Id: I83ed2b547e3bdaeb106dd938b94c72c0b2b8c2e5
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2024-06-17 14:54:22 +00:00
Miikka Heikkinen
9308549396 QmlDesigner: Sort import list when importing multiple 3D assets
Fixes: QDS-13032
Change-Id: I616cb4dce95565f965cd61cce70fe22640930554
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2024-06-17 14:54:12 +00:00
Eike Ziller
56f2b1f1e8 Process: Add information about main thread to logging
Add a note if a process is started on the main thread. That adds
essential information to "blocking without event loop".

Task-number: QTCREATORBUG-31068
Change-Id: Iaf3bab88b79391c4ddc17d18a81e6d8ab712d22d
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-06-17 14:11:48 +00:00
Miikka Heikkinen
e50704d961 QmlDesigner: Use unique image key for each import 3D preview icon
The shared memory is allocated based on the key, so if every icon
is sent with same key, they will use the same shared memory. If QDS
side doesn't read the image before the next image is written into the
shared memory, QDS side will get wrong image if all images use same
key.

Fixes: QDS-13013
Change-Id: Ie8188520a76ca057a5b0f0927a7726652609fa35
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2024-06-17 13:05:54 +00:00
Eike Ziller
8bbc72a017 Merge remote-tracking branch 'origin/14.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs

Change-Id: I325f21db9bac247a02cb14452f190b378147f581
2024-06-17 13:54:25 +02:00
Miikka Heikkinen
e40720eda1 QmlDesigner: Fix crash in 3D import dialog close
If preview generation crashes for some reason, the puppet cleanup needs
to be done asynchronously instead of directly in the callback function,
as callback is triggered from cleaned up instances.

Also add an error text to the canvas where the preview should be shown
if it can't be generated due to crash.

Fixes: QDS-13012
Change-Id: I6196e5b395b056f6b3033ea4da3a0101ef8ea48f
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2024-06-17 11:06:48 +00:00
Henning Gruendl
c9fd23ae12 QmlDesigner: Change formeditorColorProperty type
Change from Document to Persitent auxiliary data type.

Change-Id: Ibaeae5985f49370292f102ccd76c8f1a77199891
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2024-06-17 09:39:23 +00:00
Henning Gruendl
0c92c8aaf7 QmlDesigner: Show canvas background in states view
* Forward the auxiliary property formeditorColorProperty to the states
  editor delegate
* Add functionality to enabled/disable certain colors in the form editor
  canvas background combo box
* Disable context image property in the combo box when it isn't set
* When context image is set as the canvas background make the states
  background transparent
* Fix Item as root being rendered with white background in
  Qt5NodeInstanceServer::grabRenderControl

Task-number: QDS-12914
Change-Id: Ie2850986f4a54c6e03f33527d8308d01ba16884e
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2024-06-17 09:39:09 +00:00
Knud Dollereder
24c79573db QmlDesigner: Improve file filtering of the resourcegenerator
and collect functions to identify images,
assets and resources in one spot.

Fixes: QDS-12839
Change-Id: I510673b0756dc1e580d753f54831b4c23224056b
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2024-06-17 09:34:58 +00:00
Tim Jenssen
6bcf4c9dc7 QmlDesigner: fix crash at RewriterView::amendQmlText()
RewriterView does not own m_textModifier, so it needs to be checked.
Especially if it is called by a timer like in the amendQmlText() case.

With m_textToModelMerger, its a different story because its
an owned unique_ptr. So no need to check it.

Pick-to: qds/4.5
Change-Id: If19b58cc94ec5e8ddd68a8c12acba0f880cbdc6b
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2024-06-17 08:56:16 +00:00
Cristian Adam
29ce8fa009 LLDB-DAP: Fix assert messages
Amends 0cb8760338

The assert messages look like this:
```
Debugger::Internal::DebuggerEngine(0x3170607a0, name = "LldbDapEngine")
"EngineRunRequested"
SOFT ASSERT [09:46:50.984]: "state() == EngineRunRequested" in /Users/
cristian/Projects/QtCreator/repo/src/plugins/debugger/dap/dapengine.cpp:
205
SOFT ASSERT [09:46:51.313]: "state() == EngineRunRequested" in /Users/
cristian/Projects/QtCreator/repo/src/plugins/debugger/
debuggerengine.cpp:1300
Debugger::Internal::DebuggerEngine(0x3170607a0, name = "LldbDapEngine")
"InferiorRunOk"
```

Change-Id: Iceb7350c1997c9ce5d07818aff7a1f39c2abe271
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
2024-06-17 08:51:23 +00:00
Cristian Adam
1ba52d1daa LLDB-DAP: Handle source mapping and additional debugger startup commands
This way we can step into Qt source code, and run startup commands like
`process handle SIGSEGV --notify true --pass true --stop true`

Change-Id: I495c1ef1554157989f4013473c22217e2d980053
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
2024-06-17 08:36:52 +00:00
Artem Sokolovskii
76e176afe6 Core: Fix "Show All Kits" button appears after configure project
"Show All Kits" now button appears when project has been just
 configured.

Change-Id: I68c61aa56aca27c98afb60ada4a4d900db404a6c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-17 07:43:24 +00:00
Miikka Heikkinen
c220599e2f QmlDesigner: Remember each import preview camera position/rotation
When importing multiple 3D assets at the same time, the import preview
camera rotation and position are now stored and restored when previewed
asset changes.

Fixes: QDS-12999
Change-Id: Ib65578e246ba4344188e97540546521b0cb39e5f
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2024-06-17 07:38:13 +00:00
David Schulz
32fdd72f14 ASM: Fix build on windows
Change-Id: Iee491d09aca54160ea59a34b12f2ce061852b51e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-17 05:44:44 +00:00
Christian Stenger
e5844211ab PE: Fix adding first project for subdirs project
Change-Id: Iab2d463d7b138e9a6d4c9bf10e94556ea9a10d77
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-06-17 04:05:38 +00:00
Christian Stenger
4ff0f93abc QbsPM: Be less aggressive when providing proposals
Change-Id: I3826651030a3ec1c8293625c4c99c0ee31a97a5f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-06-17 04:05:10 +00:00
Ali Kianian
0ca93004ed QmlDesigner: Handle texture changes on material editor view
Fixes: QDS-12996
Change-Id: I148abcb435e95dc4deeead0f02aa8f1ca95bc600
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2024-06-14 19:29:16 +00:00
Cristian Adam
0cb8760338 Debugger: Fix LLDB-DAP attach to process
Change-Id: I464db537d85de7bce943334379b6ce499b32dc2b
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
2024-06-14 13:06:16 +00:00
Jarek Kobus
ba73e3e50a SubDirFileContainer: Add optional filtering function
Change-Id: Icf972babadc87dbc681ca282984b82484afc68c4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-14 12:43:01 +00:00
Jarek Kobus
81ed276828 IosToolHandler: Don't call stop() from the other thread
Task-number: QTCREATORBUG-30633
Change-Id: I0ddb354dbd3be685919b98589a5f0d534bd30dbe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-14 12:39:47 +00:00
Christian Kandeler
eb7332fb8b ProjectExplorer: Allow to create corresponding header/source file
... from the project tree context menu.

Task-number: QTCREATORBUG-24575
Change-Id: I65a9daf237cbbcfcfdf2b7b67191c249695a6b7b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-14 12:39:09 +00:00
Miikka Heikkinen
fe1d996b93 QmlDesigner: All importing a shared folder that is not a subfolder
Fixes: QDS-12228
Change-Id: I60b461b6e46739a93e21adb8d864681877610de3
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2024-06-14 11:09:40 +00:00
hjk
625fd895ce Fix more metatype related deprecation warnings
QT_DEPRECATED_VERSION_6_0
static int type(const QT_PREPEND_NAMESPACE(QByteArray) &typeName)

Change-Id: I6a085c6d370b6d65193dc09d4318765de81a8ce3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-14 11:00:32 +00:00
Miikka Heikkinen
cd0cc93467 QmlDesigner: Reserve enough vertical space for info labels in 3D import
Fixes: QDS-12977
Change-Id: I10e5460029965a66e62672383cb555417e4e122c
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2024-06-14 10:59:00 +00:00
Christian Stenger
36531a1068 Cppcheck: Fix handling of settings
We need to distinguish between the global settings and the
settings used for a manual analyzer run.

Fixes: QTCREATORBUG-28951
Fixes: QTCREATORBUG-30615
Change-Id: Ic2dabd14e4d06d77bebcedd9e653f54a4d179c82
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-06-14 10:47:03 +00:00
Cristian Adam
8a7402c7cd Debugger: Allow GDB/LLDB DAP debugger as native C++ debugger
This would allow manual registration of a GDB/LLDB DAP debugger from a
CMake configure preset as follows:

```
  "vendor": {
      "qt.io/QtCreator/1.0": {
        "debugger": {
          "DisplayName": "LLDB Dap 18.1.7 Debugger",
          "Abis": ["arm-darwin-generic-mach_o-64bit"],
          "Binary": "/Users/cristian/llvm/clang/bin/lldb-dap",
          "EngineType": 1024,
          "Version": "18.1.7"
        }
      }
    }
```

This way I can configure a project with a toolchain that uses a DAP
debugger (not every gdb/lldb has python bindings) and have debugging
working out of the box.

Change-Id: Id9bff26b6544b7af99caccb18cdbe0edb334218a
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2024-06-14 10:36:44 +00:00
Christian Kandeler
834e0867b0 Update qbs submodule to HEAD of 2.4 branch
Change-Id: I21173a7408dd40dbe12a142d01956cbb784d4ce7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-14 10:32:25 +00:00
Eike Ziller
a2a5cab07c Merge remote-tracking branch 'origin/14.0'
Change-Id: I240ecca23ec82e54699fcf11ba1d801d0a8c09f0
2024-06-14 11:27:59 +02:00
Christian Kandeler
44927d7cdc BareMetal: Do not ignore compiler flags
... when querying pre-defined macros.

Task-number: QTCREATORBUG-24040
Change-Id: Icd3625aaedb374048673c9eb239819b245dfdaa7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-14 08:32:26 +00:00
Christian Kandeler
c41c3619b1 BareMetal: Add missing pre-defined macro
Task-number: QTCREATORBUG-24040
Change-Id: I8d3a8f263cdee1d7971d339a56e30a6742b45bc5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-14 08:31:40 +00:00
Christian Kandeler
9e4fc34e79 QbsProjectManager: Consider common compiler flags
... also for non-GCC and non-MSVC toolchains.

Task-number: QTCREATORBUG-24040
Change-Id: I4133c4dac8183012e1bc6fd8a037f75a50d3a166
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-14 08:30:45 +00:00
Mahmoud Badri
625a521cf7 QmlDesigner: Small tweak in content lib method add3DInstance()
Rename add3DInstance() to addItemToProject() and use it in
addToProject(). This makes things slightly clearer.

Change-Id: I25475559b4fcb864887f57617d125785a8e78fbe
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2024-06-14 07:55:29 +00:00
Cristian Adam
dcaa55200b Debugger: Add "LLDB Dap" preset
lldb has a dap interface since a while now. The "GDB Dap" preset is not
compatible, since gdb uses the same executable and lldb has a "lldb-dap"
(previously "lldb-vscode") executable.

Change-Id: I4105223659de093f0ee44129527c4830d21a3090
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
2024-06-13 15:02:45 +00:00
Mahmoud Badri
1e7ab9e63c QmlDesigner: Unify remove from content lib methods
Unify remove3DFromContentLib() and removeMaterialFromContentLib() into
removeItem()

Change-Id: Ie076a2968d6a9aced3805d3708682f3fbeb1a141
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2024-06-13 14:48:03 +00:00
hjk
9fe4f23272 QmlJS: Fix severity of some (non-)error
"Calls of functions that start with an uppercase letter
should use 'new'." is a warning, not an error.

Fixes: QTCREATORBUG-27522
Change-Id: If1f82665819053b72e412a51cf4cf3c9b3e91ae2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-06-13 14:10:20 +00:00
hjk
a8ca4fa0a4 Fix more deprecation warnings
Change-Id: If4be230541b2737aaea2be2b3907472d5c1131a5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-13 13:19:23 +00:00