Commit Graph

87705 Commits

Author SHA1 Message Date
Ali Kianian
a80e45fa15 QmlDesigner: Enable name and id for texture ComboBoxes
Change-Id: Iefe9e68bf9c54753c38c6a43f3a6d3217f2293c0
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Shrief Gabr <shrief.gabr@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2024-06-27 14:59:03 +00:00
Mahmoud Badri
c6531e02cf QmlDesigner: Add child nodes when writing node to qml
Change-Id: Iddf6b70010fe34a292d8b8019c6263a56c383d75
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2024-06-27 14:57:34 +00:00
Miikka Heikkinen
a9426e1977 QmlDesigner: Fix puppet crash when importing asset with commas in name
Importing 3D assets doesn't need to create Qt5NodeInstanceClientProxy,
so skip that in puppet initialization as it may lead to misinterpreting
some command line parameters given to the puppet.

Fixes: QDS-13123
Change-Id: Ifa6601dfa7da1a613b2c897a287a7baeb07dd712
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2024-06-27 13:21:13 +00:00
Mahmoud Badri
14b7df7cf2 QmlDesigner: Import bundles directly to project
Change-Id: I75b347d3fa969fe312f35e4c0c770ba03ba3cf85
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Ali Kianian <ali.kianian@qt.io>
2024-06-27 11:40:32 +00:00
Thomas Hartmann
87d1fa5292 QmlDesigner: Add ids to MCU template
Change-Id: Ieda94f14d21ab71c7889a38612db0d9539ea8717
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2024-06-27 10:52:00 +00:00
Burak Hancerli
827ace5c9e QmlProjectManager: Use proper method to get qmlproject files for MCU
This patch replaces the blind traversing in the project root to find
and parse the additional qmlproject files which are used by MCU
projects. Instead it's now using the qmlProjectModules() function to
reliably get the valid ones for the MCU projects.

Task-number: QDS-13068
Change-Id: I4e5e1791714345b69c0b2ac7929ae39c30521224
Reviewed-by: Knud Dollereder <knud.dollereder@qt.io>
2024-06-27 10:42:41 +00:00
Ali Kianian
da1c00ca64 QmlDesigner: Show and edit texture name instead of ID in MaterialBrowser
Task-number: QDS-13024
Change-Id: I7cb223caf1577942fc273004f0e08df5569c2af0
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2024-06-27 08:20:13 +00:00
Miikka Heikkinen
576e3b7acd QmlDesigner: Fix subfolder imports
Recursion for possible imports was interrupted when an incompatible
folder was detected, even though that folder could have compatible
subfolders.

Fixes: QDS-13067
Change-Id: I61f0ac6265e922c515dcd380a481434a1ddfcc93
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2024-06-27 07:55:20 +00:00
Marco Bubke
7947b18d87 QmlDesigner: Fix model utils
QStringView is easily convertable to std::u16string_view, because data()
is returning QChar* and not char16_t*.

Change-Id: I4dcdceca0c1ee82ea02494d8a45e9ab3011e4dcb
Reviewed-by: Ali Kianian <ali.kianian@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2024-06-26 14:24:29 +00:00
Marco Bubke
cca45dcc9b QmlDesigner: Fit branding with other version usage
We use in blog entries 4.6, not 4.6.0. That makes the matching easier.

Change-Id: Ib22433a5a2b7b8c7757f6a59a77c6a9438e26e69
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2024-06-26 12:16:52 +00:00
Miikka Heikkinen
ad8c3ba52a QmlDesigner: Fix composed effect reparenting and removal issues
Reparenting or removing composed effect nodes requires recursive update
of the old parent to ensure all children of the old parent are rendered
correctly without the effect.

If the new parent of composed effect node has Image children, they can
in some situations randomly lose their textures in 2D view.
It seems that the only way to fix this issue is to toggle the
visibility of the affected node or its ancestor off and on, so we do
that to the new parent item when reparenting composed effects.

Fixes: QDS-11688
Change-Id: I003d3976d619f24164938846d9b4a15201bf7b59
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2024-06-25 14:02:53 +00:00
Tim Jenssen
2dcee5a89a QmlDesginer: catch none critical busy exception
walCheckpointFull() is writing back the log which is not
critical and should not crash the application

Change-Id: Ie01cc9be35de30dc9b89bcb00e9cd4358887c3b2
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2024-06-25 12:36:23 +00:00
Shrief Gabr
b76826d674 QmlDesigner: Add 3D component from Navigator view context menu
Fixes: QDS-12911
Change-Id: Icd6d32d4a09a6f3e7b925037e73a75fdbf472f28
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2024-06-25 11:10:27 +00:00
Tim Jenssen
3a13e0a561 QmlDesigner: WITH_QMLDESIGNER_DEFAULT OFF if compiler is too old
Change-Id: I6b54434273da92bdff9b81076e0cbf47e07cd3d3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-25 09:44:08 +00:00
Ali Kianian
7caf81117d QmlDesigner: Unify invalid ids
Fixes: QDS-13056
Change-Id: I8d99e0e9eba148fe4d31c3c9a2d28f46d91b377a
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2024-06-24 14:43:47 +00:00
Mahmoud Badri
e574ba97f1 QmlDesigner: Fix bundle material json file donwload path
Also small renames to add clarity.

Fixes: QDS-12998
Change-Id: I1b38fa501bcc606f13675a98c5543709d15ac615
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2024-06-24 12:19:46 +00:00
Mahmoud Badri
8beb6ff299 QmlDesigner: Correct ContentLibraryView::addLibItem()
Properly set bundle id and path based on node type.

Change-Id: I9710b09789ebe33a3dbe9bb2f112fead53486278
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2024-06-24 08:13:59 +00:00
Marco Bubke
4a22f450fc Fix homepage in appstream data
Change-Id: I1d1eca2607a93a9a9b79650d0973a221bad40180
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-21 14:37:44 +00:00
Mahmoud Badri
ffaba40eab QmlDesigner: Fix icon generation dependencies missing in content lib
Change-Id: I07641feaa55d8b8c374c3e9e6efdce2e1dcc9246
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2024-06-20 14:21:39 +00:00
Marco Bubke
dad1232165 UnitTests: Fix typo
Change-Id: I5f5e3f208603733b173798816f2e9ada9ff39140
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2024-06-20 13:46:47 +00:00
Miikka Heikkinen
778839be5f QmlDesigner: Remove initial reparenting of all items to root item
This initial reparenting to root doesn't seem to have a purpose as any
valid instance will be reparented to its actual parent later anyway.
Since it does break composed effects parent handling, it was removed.

Fixes: QDS-12022
Change-Id: I08993424b5c3ece739809375c11d0a2cd0e3498c
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2024-06-20 13:46:43 +00:00
Mahmoud Badri
91d5840adb QmlDesigner: Unify addLibMaterial() and addLib3DItem() in content lib
Also a small rename (remove '3D' as it can work for 2D in the future)

Change-Id: I72332f8b46fae6bf8e8e70fc21329ec1e80df047
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2024-06-20 13:40:39 +00:00
Marco Bubke
b98a67ee9e QmlDesigner: Fix tests for changing import in model
Change-Id: Ie09f4d77da460362deb068d2358dfb311d6428be
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2024-06-20 13:28:32 +00:00
Mahmoud Badri
29c222ba18 QmlDesigner: Fix old and new project structures discrepancies
Force reload bundles when generated folder changes between projects
launches.

Fixes: QDS-12899
Fixes: QDS-12902
Change-Id: I61b2729309cf2b853441358379ac5a569a3af886
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2024-06-20 12:35:31 +00:00
Henning Gruendl
b9fdfe90ad QmlDesigner: Replace magic value with proper value
Change-Id: Ib5bbc6238392a6bfbcabb0571bdfb70599ac2705
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2024-06-20 11:40:54 +00:00
Henning Gruendl
1728604a5c QmlDesigner: Fix responsive property editor
Fix the responsive layout in the property editor by adding the
remaining space when control and label max width is reached to the label
width in order to make long labels more readable.

Task-number: QDS-12243
Change-Id: Ib46f4d5e2ae7b48708ec790889180e6aeb932602
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2024-06-20 11:40:49 +00:00
Mahmoud Badri
a87b8253ae QmlDesigner: Confirm adding existing material to content library
Also remove methods not used anymore and make addLibMaterial() as close
as possible to addLib3DItem() in preparation to unifying them.

Change-Id: I4b0bbf3667c8203fd71a5440aee02d62a67673ca
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2024-06-20 10:27:23 +00:00
Miikka Heikkinen
87bae7f0a4 QmlDesigner: Fix layout of 3D import list
Made list a bit wider so that there will be no horizontal scroll on the
list. Also shortened the size info label text a bit so it won't cut off
as easily on systems with larger default font.

Fixes: QDS-13015
Change-Id: I39c175be42e743b0700079ddd5543a9c54bb975b
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2024-06-20 10:13:40 +00:00
Thomas Hartmann
f92ea99107 QmlJS: Skip QtQuick3D for implicit imports
The way we resolve implicit imports creates random issues.

QtQuick3D.MaterialEditor implicitly imports QtQuick3D.

If QtQuick3D.MaterialEditor is scanned before QtQuick3D the types
of QtQuick3D are added to QtQuick3D.MaterialEditor and when later
QtQuick3D is scanned no type is added to QtQuick3D because of the cache
in ::createObjectsForImport.

The result is that QtQuick3D does not contain its types and prototypes
cannot be resolved. This does happen roughly 50% of the time and
is the reported issue.

In case QtQuick3D is scanned, first things work, but no "extra types" types are added to QtQuick3D.MaterialEditor.
To keep the patch minimal we simply skip this specific case.

QtQuick importing QtQml implicitly is not touched.

Task-number: QDS-11069
Change-Id: I74088b12a2e737a8a7467068c10a78c4be2a7bda
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2024-06-20 09:31:48 +00:00
Marco Bubke
a49ae43848 QmlDesigner: Add local directory to import paths
Change-Id: I4d623d1ed9667a221016c2dd2267d47a9a9ef2c5
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2024-06-20 09:07:53 +00:00
Marco Bubke
b2c85538b1 Add Design Studio for Linux
Add AppStream data and desktop file for Design Studio.

Change-Id: Icc5cca03a3c0945a2f90b39fdd4c7dcecd0e8d6b
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2024-06-20 08:57:36 +00:00
Mahmoud Badri
29229773e0 QmlDesigner: Confirm adding an existing item to content lib
Change-Id: Ic3c007444a1c061161268548e0f180ca5335b8bc
Reviewed-by: Ali Kianian <ali.kianian@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2024-06-20 08:42:24 +00:00
Miikka Heikkinen
d4d2c279e3 QmlDesigner: Fix material browser ensuring item visibility
...when the available space is less than full item height.

Fixes: QDS-13014
Change-Id: Iad848547c0736e335173a4feb489a0546f01e147
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2024-06-20 08:34:43 +00:00
Mahmoud Badri
843dcc1ff6 QmlDesigner: Fix icon generation fail when adding an item to content lib
Copy the added item's QML file to a temp directory and generate from
there. Also, fix that generated icons not appearing immediately by
separating the model refresh from the addItem(), ensuring the
refresh occurs after the icon is generated.

Change-Id: Ic4f32677b3c2f3895b7825aef7727ac6dd6240b2
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2024-06-20 08:31:55 +00:00
Henning Gruendl
0a649de487 QmlDesigner: Fix deprecated Connections
Fix an implicitly defined onFoo properties in Connections are deprecated
warning in the color editor.

Change-Id: I6b1eb0e997a8ec20bafad663c49506ebb6955eee
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2024-06-20 08:27:09 +00:00
Henning Gruendl
2ebde52f67 QmlDesigner: Fix alignment in EffectsSection
Change-Id: If24c9a0cf098dc36bd400db3d04dfcddaa09672e
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2024-06-20 08:26:58 +00:00
Tim Jenssen
9e9f0015b2 QmlDesigner: fix build
from https://en.cppreference.com/w/cpp/compiler_support/20
ranges support:
The One Ranges Proposal: Clang 13 (partial) 15*

For snapshots we use still Clang 12 (will be changed in near future),
but also QtCreator still supports that old compilers.

The gitlab CI uses much newer compiler versions.

Maybe we also add a check, if the compiler is too old,
do not compile QmlDesigner plugin.

Change-Id: I4d3281739a957546237f47f53fe8f523f4768978
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2024-06-19 14:57:52 +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
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
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
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
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
Teea Poldsam
0d35eaced7 Doc: Document the 3D asset importer improvements
Added information about the new features and reorganized a bit.

Fixes: QDS-12818
Change-Id: I53049eb5959d1af36e83ef6f2ab8ebe2acff876a
Reviewed-by: Johanna Vanhatapio <johanna.vanhatapio@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2024-06-17 08:29:11 +00:00