Commit Graph

76860 Commits

Author SHA1 Message Date
Thomas Hartmann
073693bab3 QmlDesigner: Fix heck in syncSignalDeclarationProperty
Change-Id: Ifa5d5ef6000a6a8a7eb6210cece43a09b6e42361
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-17 12:39:38 +00:00
Piotr Mućko
cb24da01b3 McuSupport: Evaluate environment variables in paths
Packages are created as defined in JSON. Some paths
contain variables. This creates dependencies between
packages. After all packages are created and collected
environment variables are evaluated in one pass. McuTarget
packages get updated.

This is needed because we shouldn't show the user paths
with variables in them. Also file picker wouldn't work.

There will be cmake variables support in separate commit.

Change-Id: Id210ea394f3f5bb5a14d87f3cf6a0a9a99e690bf
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-08-17 12:17:38 +00:00
Piotr Mućko
662281e837 McuSupport: Parse and create qt for MCUs package
Change-Id: I295f8c275d67992ba633f194ace119c2784d8525
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-17 12:16:27 +00:00
Florian Koch
4740430577 New option for disabling of tinting the right margin area in text editor
Since version 4.14 the right margin of the text editor is tinted. The
fill color corresponds to a darkened editor background color (for light
UI themes), or a lightened background color (for dark themes). However,
the default for most other editors and IDEs is just a single  vertical
line, as was the case in Qt Creator up until version 4.13. The different
colored area may be considered uncommon and irritating by some users.
Therefore, the new checkbox "Tint whole margin area" has been added under the
"Text Editor/Display/Text Wrapping" section in the settings for switching
between <= 4.13 and 4.14+ behavior.

Change-Id: I6761943477738a4c78b97a5f70a19f1ff8a428e5
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-08-17 10:44:15 +00:00
Piotr Mućko
038b839f9e McuSupport: Remove unavailable JSON param
freeRTOS' boardSdkSubDir param in JSON was removed long time ago.
It's time to remove corresponding code.

Change-Id: I6805aaa51cce599f5505fbc74692ed562f448ad4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-08-17 10:27:42 +00:00
Henning Gruendl
5f41c09eb0 QmlDesigner: Fix Qt Advanced Docking System
Fix an issue with a wrong QWidget background rendering when dragging
a dock widget across a floating dock widgets border.

Task-number: QDS-7425
Change-Id: I018cc224a6316a0327cb1806512b6aa6a75d88a3
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-08-17 09:15:51 +00:00
Marcus Tillmanns
44cd2b59e5 smallstring: Fix warnings and compile error on macOS
Change-Id: I51f73aa5561d2f21e36ebba0e2e318cf662e36ed
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2022-08-17 09:08:14 +00:00
Alessandro Portale
c837737bab TextEditor: inline snippetssettingspage.ui
Change-Id: I483bc07b39328a491af373ce76b365e968176828
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-08-17 08:20:06 +00:00
Christian Kandeler
0d156ca545 CppEditor: Prevent user include paths matching built-in include paths
It can easily happen that the build system provides us with an include
path that matches a built-in path of the toolchain, for instance when a
project file pulls in an external library that's installed in /usr.
In such a case, we must make sure we only keep the path that's marked as
a built-in header, since otherwise the include paths we pass to clangd
will be in an unexpected order, breaking the parsing.

Change-Id: Ibb56129b9c6e1c419d741652fa8c3051a62552e7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-17 07:34:45 +00:00
Thomas Hartmann
b2567b5e1d QmlDesigner: Do not throw if metainfo is invalid
Task-number: QDS-7348
Change-Id: I96433369ad0e013d4fa62df297ade16084f8bc6a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-08-17 07:25:20 +00:00
Thomas Hartmann
43bf516d10 QmlDesigner: Catch exception that leaves the notifer
No exception should ever leave the view and it should be caught locally.
If this still happens we should catch it and show an error message.
Otherwise we risk throwing a second exception when rewinding, if the
changes came from the text editor.
Catching and showing an error message should never do harm.

Change-Id: If275ed1179e4fa4245fef3df4dbc8d144a1588d3
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-08-17 07:21:12 +00:00
Thomas Hartmann
96d0f86552 QmlDesigner: Do not throw exception in meta info proxy case
If there is a metaInfoProxyModel the version numbers will be different.
(e.g. 6.3 im the document has a 6.3 import and 2.0 from the template).

This is no problem and we can ignore this case. The check is supposed
to be removed anyway.

Task-number: QDS-7350
Change-Id: I780fc7d4b744e298bc8f3b991e75f642a4e8ae8a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-08-17 07:19:58 +00:00
Cristian Adam
848016673c Core: Show document icons in Ctrl-Tab open documents window
Having the document icon looks more natural than having an empty icon.

Change-Id: I69da3e4177da558b5d9f474e3495f8237c5f0352
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-16 18:56:50 +00:00
Cristian Adam
373b9f8b31 Core: Show document icons the "Open Documents" view
Having the document icon looks more natural than having just the text
of the document.

Change-Id: I7cb6fda6b4241c0d124c18c3c74dc4a1e614b02d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-08-16 18:56:43 +00:00
Cristian Adam
d86d278044 CMakePM: Add configure environment widget
CMakePresets have the concept of modifying the configure process
environment variables.

Qt Creator had only one "build environment".

Change-Id: I131d54971b4bf7e5f87e680f817f93868d62ab29
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-08-16 18:56:36 +00:00
Marco Bubke
c9d45d1bc0 Utils: Remove null termination from SmallString
We expect mostly a string view which has no null termination. Code which
depends on null termination is broken and it is better break early.

Change-Id: I7c2c41fb114e6aaf3a23053b522b37f7af5e1abf
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2022-08-16 16:15:51 +00:00
Marco Bubke
cf064500aa Utils: Improve memory layout code
Actually, the layout is the same, but we move the control block. To prevent
padding of the short string, we use pragma pack(1). To align the pointer
again, we add some dummy data with the size of a pointer minus a control
block because alignas is not working like expected on GCC.

Change-Id: Ide86ace243dab5f487da63492ebac018da45098a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2022-08-16 16:15:45 +00:00
Marco Bubke
735346adb5 Utils: SmallString trades copies for branches
There can be quite some copies with the swap method for the default case
that the string is inside the small string area. Instead now we minimize
copies of the smallstring area at the expense of more branches.

The swap approch needs no self tests and it uses the destructor to
remove allocated resources but it can copy three times more often. And
the destructor still has an additional branch in the copy case. Only in
the move case we can use the destructor of the other instance. This can
be surprising for some users which expect that the instance is empty
after a move(actually assuming that a instance is empty after a move is
undefined behavior).

Because SmallString is designed to hold the string in almost all cases
inside the small string area that case should be optimized.

Change-Id: I22cb62aa99b9713a221f103971f149c05e9ff6fa
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-16 16:15:26 +00:00
Marco Bubke
fa32b652c8 Utils: Optimze SmallString copies for larger sizes
So far the whole class was always copied. For a large SmallString
classes this were often many zeros if it was empty. Now only the non
zero area is copied in that case.

Change-Id: Ic0ea2d6f763513858a993bba3e829c9fc947e1a6
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-16 16:15:00 +00:00
Marco Bubke
8a0f7db8eb Utils: Make take of SmallString explicit
Using a value after the move is undefined. For example, if you move an
integer, it is not set to zero after the move. So you have to initialize
it again. Adding the take method to SmallString makes this explicit.
So if there is a case that you want to use the string again after
a move, use take or initialize it yourself.

Change-Id: I174116df9639d6a3f63c6f2c2a3bd184852927ce
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2022-08-16 16:14:51 +00:00
Marco Bubke
a91e6bd46c Utils: Adapt SmallString to C++ 17
if constexpr makes the code a little bit more readable.

Change-Id: I7bd508cbc81cf7213dd4ac627f3d4e489ab523c9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-16 16:14:45 +00:00
Marco Bubke
2a22e81e72 QmlDesigner: Some cleanups
Change-Id: I5822e035bda817c3376a587c20e94d813ec61ac6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2022-08-16 16:14:08 +00:00
Marco Bubke
9d0ad0412e QmlDesigner: Add language auxiliary property
Change-Id: I9c830e6d788bdd33b1d2fad44d5dc6c770b6b78c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2022-08-16 16:13:59 +00:00
Marco Bubke
ccc8c7c997 QmlDesigner: rotBlock is using it own aux type
rotBlock was using the mechanism to overwrite values but actually it is
only for communication to the puppet. So now there is
NodeInstanceAuxiliary as a generic way. NodeInstance was renamed
NodeInstancePropertyOverwrite to make it clear that it is for
overwriting properties.

Task-number: QDS-7338
Change-Id: Id5ab1f5c4761a184964a347f00d1449ae2d7d77f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2022-08-16 16:13:46 +00:00
Thomas Hartmann
f31638c856 QmlDesigner: Allow Timer in ui.qml files
Change-Id: I0fbf7270f8514b212fab5aae89d2def11d6b53bd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-08-16 15:26:37 +00:00
Knud Dollereder
9610698c66 Allow editing keyframe values for other types than double
Currently, the setKeyframeValue dialog only supports a
QDoubleSpinbox as value field. When using this dialog to
edit keyframe values of different type, they need to be
converted which fails for some types (QColor).
With this patch the dialog creates a dedicated control
for each value type. In case the type is not caught it falls
back to the old behavior.

Fixes: QDS-6949
Change-Id: Icbaa2af24f06418fa60648d23269f1a12c08f9de
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-08-16 15:26:29 +00:00
Christian Kandeler
685c3ee4cb ClangTools: Support doc urls for pre-relase clang-tidy
Change-Id: I9c28b5846d576d0b17c2e36f790d59b6bb005f6b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-08-16 14:04:55 +00:00
Artem Sokolovskii
74ac09346f CodeStyle: Remove edit pop-up
Removed the Edit pop-up on the CodeStyle page.
Now editing is available immediately after opening
CodeStyle tab.
I left a preview on the project CodeStyle page and
added a link to global settings.

ToDo:
In project CodeStyle page replace preview with CodeStyleEditor.
I'm not 100% sure that it is needed. If you have some thoughts
please write a comment.

Change-Id: I31032a97b9668b4f6b06fc6c5c704700fb44ee4f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-08-16 11:49:19 +00:00
Marcus Tillmanns
4f0ac5678f FilePath: Fix operator+ to use stringAppend instead of pathAppended
Change-Id: I643a2e9eed22fafc793bbc75cba0344c4005b3f3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-08-16 11:35:12 +00:00
Christian Kandeler
91d568180d ClangTools: Fix clang-tidy documentation URLs
The model for the clang-tidy checks absurdly uses a FilePath-based base
class, and after cd919e6f61 started
producing wrong URLs. Work around that.

Change-Id: I8ef4f678c3abf991ada1a2955baa3d1ec13a195b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-08-16 11:09:29 +00:00
Christian Kandeler
725c36e8d0 CppEditor: Keep offering "Extract Function" after all
As it turns out, there are some bugs in clangd that prevent this
functionality from working in some circumstances.
This effectively reverts 840263eb9a.

Fixes: QTCREATORBUG-28030
Change-Id: I511eb9a5cc45e3fd5e3cc25898aebb493f1ba3d3
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-16 11:08:22 +00:00
Alessandro Portale
801ff295f6 Help: Remove filternamedialog.*
Unused code.

Change-Id: Icfcd613d63f549655ac62daa82e9a7e6f5c78d6c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-08-16 10:45:46 +00:00
David Schulz
b39c7cd782 CppEditor: remove unneeded indirection for the outline model
Change-Id: I01e9fb0dae30d6df22c0f5d7255ab247c48749fc
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-08-16 07:53:41 +00:00
Henning Gruendl
305517f212 QmlDesigner: Fix floating widgets on start up
Task-number: QDS-7423
Change-Id: I273b8a3926b574f4ec61500b798bff578684cb1f
Reviewed-by: Brook Cronin <brook.cronin@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-15 15:10:41 +00:00
Knud Dollereder
fea338c000 Move keyframes horizontally when shift is pressed
It is now possible to move keyframes in the curve editor
in the x direction only by pressing shift while dragging.

Fixes: QDS-6952
Change-Id: Ic1a25ec6d8dec82cf5599dccbaeff7e5f34d2936
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-08-15 14:00:20 +00:00
Jarek Kobus
8703bcd777 VcsCommand: Don't cancel finished task from d'tor
Amends a5683616b9

Change-Id: I6b746dfa444737e87c98b878c017374f2034d400
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-15 10:58:51 +00:00
Thomas Hartmann
675e63e658 QmlDesigner: Prepare States Editor for States not in the root node
Change-Id: I612de64447f04a041aa20b1ebc02c7fb6049eb03
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
2022-08-15 09:09:30 +00:00
hjk
144cefcf43 Utils: Use QStringView for LineColumn::extractFromFileName
Change-Id: I006773a2cd42be1009cece45bb2174d6c1ea143f
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-08-12 10:09:16 +00:00
Christian Kandeler
4c9860d582 ClangTools: Adapt to new clang-tidy documentation URL pattern
See https://github.com/llvm/llvm-project/commit/
6e566bc5523f743bc34a7e26f050f1f2b4d699a8

Change-Id: Ifbb7bc1c09a890aef02611a8d0ae10b8217773d7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-08-12 08:31:57 +00:00
Christian Kandeler
bd00cc8bf8 LanguageClient: Introduce timeout for restart counter
While it makes sense to stop trying to restart a continuously crashing
server, the restart counter should be reset regularly, as it's not
critical if the server restarts "once in a while" during a longer
programming session.

Change-Id: Ia2efca28ae4a4dba72da947d9eb776e3909d0cb3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-08-11 14:12:35 +00:00
Marcus Tillmanns
2635d62721 Dumper: Show error message if module fails to load
Change-Id: Id4e445f71f70f0b07ccc4c4ffb25502607263dec
Reviewed-by: hjk <hjk@qt.io>
2022-08-11 14:02:30 +00:00
Marcus Tillmanns
50bedd5544 FilePath: Fix UNC root/path parsing
* Fixed UNC path parsing to correctly split between root and path
* Fixed tst_fileutils to correspond to windows path handling.

Change-Id: I2849738696a39e8282068ab164514f806f2c5fcf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-08-11 13:54:14 +00:00
Marcus Tillmanns
e31d7b227e Debugger: Fix crash when showing characters > 0x7FFFFFFF
Change-Id: If9e1e235ea7b5288a29ca8f3a17e75dea3c57978
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-11 13:52:29 +00:00
Christian Stenger
b3f1c73aef CMakePM: Change default for package manager include
Change-Id: I003e315139fea643d19f15e8eb2f3b950fab79d5
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-08-11 13:38:00 +00:00
Miikka Heikkinen
45f93a817a QmlDesigner: Add environment and model selectors to material preview
The model and the scene environment used to render material previews
can now be selected via buttons next to the preview in material editor.

Task-number: QDS-7347
Change-Id: I03089029e8420f80ed65be1c7b7a1ce4581f2fd4
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-11 13:33:59 +00:00
Christian Kandeler
1844788a0c qbs build: Fix QtcProcess test helper executable
We need to set the rpath, otherwise libUtils won't be found when using
the AutotestRunner.

Change-Id: I5644a5b52441482f48b461a28d57c17b2371d66f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-11 12:48:16 +00:00
Christian Kandeler
551cd3f65b Tests: Make the memcheck model test exit
Otherwise, it will block "make check".
This test is a manual test and does not belong into the autotest
category at all, but as long as it's there, make at least sure it
doesn't break things.

Change-Id: Ib4c2c5b8e840b3f1ac1f4cca2ec4869385484e77
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-11 10:59:23 +00:00
Marcus Tillmanns
7e092f2e09 jsonwizard: Fix check for icon
The jsonwizardfactory did not check if the template contained
an icon. Due to a bug in FilePath::resolvePath() which previously
returned "/" instead of "" for empty paths, the "iconPath.exists()"
check would always return "true".

With this change, the existence of the icon is only checked, if
an icon was supplied by the template in the first place.

Change-Id: I3252a6b92b34433835ab0e6e04857114ea895b46
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-08-11 09:32:47 +00:00
Marcus Tillmanns
a1fd70c1a4 Debugger: Correctly display > 2 byte characters in strings
The "escapeUnprintable" function previously iterated through the
QString QChar by QChar. Since QChar only represents UTF-16 it would
erroneously split 4 byte characters into two characters that were
no longer printable.

To workaround, we first convert the QString to a UTF32 ByteArray
and iterate over each of the characters. This allows us to
correctly distinguish between non- printable characters.

Change-Id: I5552a79a91678994868441e67f967c68329aa1ce
Reviewed-by: hjk <hjk@qt.io>
2022-08-11 09:31:52 +00:00
Marcus Tillmanns
cd919e6f61 FilePath: Fix for operator+(QString)
Change-Id: I3b9889c8b2cdc8a9d1bf94c3e7a8627e2ff2ac35
Reviewed-by: hjk <hjk@qt.io>
2022-08-11 09:31:26 +00:00