Commit Graph

62421 Commits

Author SHA1 Message Date
Miikka Heikkinen
326f70c40f QmlDesigner: Add support for component materials
Component materials can now be seen on material browser and their
properties are properly shown on material editor

Fixes: QDS-7390
Change-Id: I3f7edfe655bdb0da1fa71739c825d09d6101c386
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-18 11:10:42 +00:00
Miikka Heikkinen
2e8574bd76 QmlDesigner: Add scene root material support to material editor/browser
If the scene root item is Material subclass, material library is not
created for the scene. Material editor and browser functionalities that
relate to having material library are disabled.
Material editor will always show the material that is the scene root.

Fixes: QDS-7374
Change-Id: Icd1c212c17b59e4a2caa6b3b4d7e615e68b21eb9
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2022-08-18 11:10:04 +00:00
Cristian Adam
c7cdd55dea ClangFormat: Fix build for LLVM 15.0.0
This fixes the CMake build of Qt Creator against LLVM 15.0.0

Change-Id: Icecd45821091c8c2b565246cb17ce5a6e5c49f36
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-08-18 09:43:30 +00:00
Marco Bubke
5a8d7c3d51 Utils: Remove code duplication in SmallString
It removes unwanted null termination too.

Change-Id: Iaea8699f7ccc387776b43e897fdd099764af2773
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2022-08-18 09:25:55 +00:00
Mahmoud Badri
d4cc3fddc9 QmlDesigner: Implement copy/paste material properties
Fixes: QDS-7014
Change-Id: I2a8b779f97de353836a4d506b715720b490c349f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-08-18 09:12:10 +00:00
Alessandro Portale
0ec7a3797d Utils: Add a non-toolbar variant of the MINUS icon
Make it consistent with Utils::Icons::PLUS and
Utils::Icons::PLUS_TOOLBAR

Change-Id: I2d5c69ec13ceba172c2c583895eea6fdff77a64e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-18 09:02:58 +00:00
Christian Kandeler
1e56179d0c QbsProjectManager: Consider qbs.sysroot for code model flags
This is particularly relevant on macOS, where we have an implicit
sysroot that's not exposed in the kit.

Change-Id: I85f6cd989e2f32857c007822fd68fbaf0cead7e0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-18 08:11:26 +00:00
Marcus Tillmanns
7c5e92f6fa CppEditor: Add missing include
Change-Id: I5a8724987e3c5888d5d07507cf2ae63a1b463c5a
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-08-18 06:33:44 +00:00
David Schulz
5b3b1a60a1 CppEditor: move outline model to document
This way we only have one model per document instead of one per editor.
Additionally we further separate the outline views (combobox and side
pane) from the actual model.

Change-Id: I9705716b5c9f8f19f75708ec73d7c3b3c5de586f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-08-18 06:20:10 +00:00
Christian Stenger
ec733999e1 QmlDesigner: Fix qbs build
Change-Id: If9fdad7ee19c1ab6e1180a1ba59d2cdc2d2535f5
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-08-18 06:04:37 +00:00
Alexander Drozdov
4a79623959 Fix crash on Preferences dialog close
Mitigation for regression introduced by
74ac09346f.

On finish() method call m_widget maybe nullptr, so call for any him
methods is dangerous without checking for nullptr.

Change-Id: Ia7ab5572946fef9bcc62c63709e5ffc69cd2ebae
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
2022-08-17 22:28:41 +00:00
Mahmoud Badri
ec565eea99 QmlDesigner: Allow deleting materials using the delete action
Fixes: QDS-7012
Change-Id: I5eb03971d33a997fc1463ec4ee70eb33a730a897
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-08-17 13:11:58 +00:00
Thomas Hartmann
831e118b33 QmlDesigner: Do not amend if rewriter view is not attached
Task-number: QDS-7349
Change-Id: I6a4d1906ee6afea25e5dcc878f7f502456c6052b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-08-17 12:48:59 +00:00
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