Commit Graph

666 Commits

Author SHA1 Message Date
Christian Strømme
4788f0671f Update MouseArea3D::getCameraToNodeDir() to not rely on cameraNode()
The cameraNode() function has been removed from QtQuick3D and it only
existed because of the weird way we we're creating the camera node.
Now, instead of the round-trip, just request the spatial node directly.
See: b74fde27@qtquick3d

Change-Id: Icc8584aebee4952356769a134756074cba8d1b0e
Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
2021-08-23 12:22:04 +00:00
Thomas Hartmann
d5214b0e45 QmlDesigner: Do not create components from componentPath in importPaths
If the component comes from the import paths we should not create
the component directly. This can have subtle unwanted side effects.
Styling for example is not working with Qt 6.

Change-Id: Ia4f33b46d3dc427ac95838f2ca73a880639d600a
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-08-19 11:21:30 +00:00
Miikka Heikkinen
ffd8ebd17b QmlPuppet: Remove 2D rendering from InformationNodeInstanceServer
Using cross-window 2D content in 3D scene is prone to crashing,
and causes also issues with the primary purpose of
InformationNodeInstanceServer, i.e. getting the information, as the
rendering will remove dirty flags from nodes prematurely.

Fixes: QDS-4858
Change-Id: I9057889a28d36f12f1e401e9a39f808d66637681
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-08-19 08:08:35 +00:00
Janne Koskinen
b8b6af0dbb Add 3D editor Gizmo for Quick3DParticles
Adds an icon for Particle System Component making the component
visible in the editor allowing picking.

Task-number: QDS-4784
Change-Id: Ie6cffa9cfe3bb6a693372d7a7b4341e17f89911f
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-08-13 11:23:19 +00:00
Tim Jenssen
27d414458e qmlpuppet: fix qt 5.15 builds
Change-Id: I6d19624537a3980252d43624ecf24e110638225a
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-08-10 09:07:41 +00:00
Miikka Heikkinen
2c7b2ad685 QmlPuppet: Fix incorrect initial render size/scene for edit 3D
The scene id was stored as array of QChars instead of QString, which
caused issues restoring the correct scene at puppet reset.
The intitial incorrect render size was caused by not changing the
render window size in addition to root QML item size.

Fixes: QDS-4586
Change-Id: Id6b16d778a9d886e8fdc40eab1e549d13091f8f4
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-08-09 14:00:19 +00:00
Christian Kandeler
6530a4fdc7 Fix some compiler warnings
Change-Id: I4eaf47bda086b83618f461ab19d1715c67e27ae1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-09 11:52:07 +00:00
Thomas Hartmann
fa1d7958c3 QmlDesigner: Do not generate version number if invalid
This is a fallback to create components from source.
If the majorVersion is negative we should not generate
a version as part of the import.

Change-Id: I377b241e8e4c51141d560d7198e5906a9c963b54
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-08-09 08:10:01 +00:00
Miikka Heikkinen
7211b7abf2 QmlPuppet: Fix crash on active scene change
Active scene change involves deleting and recreating the View3D
instance of the 3D editor that imports the actual shown scene.
In Qt 5 it was necessary to mark the deleted View3D instance as having
no content, so it wouldn't receive any more updates. This hack no
longer appears to be necessary and causes this crash instead, so it
was removed.

Fixes: QDS-4786
Change-Id: I848ac78dc2f951ba7e1bf4d3d6aa4244b1443309
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-08-06 13:43:27 +00:00
Janne Koskinen
12fb534f90 Fix puppet from asserting on unversioned qml imports on Qt 6
Set mockup version to 1.0 if there is no version set.

Change-Id: Icfee0e84012a93978283d8309ec01d48dd8d4730
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-07-28 06:49:45 +00:00
Thomas Hartmann
ef8f18fb70 QmlDesigner: Do not instanciate ApplicationWindow
Change-Id: I7a57de60aba72823579e986e9ad6278c4a7e84a8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-07-19 07:53:39 +00:00
Knud Dollereder
30f6084f0d Execute pixmapChangedCommands only if items have changed
This patch prevents continuous image updates by making sure
to only execute pixmapChangedCommnds if an item is dirty.

Change-Id: Icadc1d8a2a2298d18147b31fbed3fbc4205f0ea8
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-07-14 20:54:29 +00:00
Cristian Adam
3a503a7eb0 QmlPuppet: Builds fix for Qt5
Amends 7c0652b7ac

Change-Id: I55792a5468b5cf7e9eedb6a105abe468c48ecd2d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-07-02 18:44:22 +00:00
Miikka Heikkinen
7c0652b7ac QmlPuppet: Small optimization to rendering 2D content in 3D scene
There is no need to read back the texture into image when rendering
2D content for embedding into 3D scene, so don't do that.

Change-Id: If84619bdc20e6997733effc4745a496fab69e5b8
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-07-02 13:37:54 +00:00
Miikka Heikkinen
18f24ffd68 QmlPuppet: Fix multiselection fit object in 3D editor
Multiselection is now properly fit to the view when fit object is used.

Fixes: QDS-4608
Change-Id: Ia80133fc861bd177b9102423ebef37b592c74758
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-07-01 14:29:35 +00:00
Miikka Heikkinen
64d274454e QmlPuppet: Fix imported 3D asset library icon generation
Recent changes to custom geometry handling now require that the
zoom process in icon creation does each focus step asynchronously,
so that selection box geometry has a chance to update between frames.

Fixes: QDS-4652
Change-Id: If92bf580a556a68c10d3af1406c2eabef530254a
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-06-29 14:28:24 +00:00
Miikka Heikkinen
b058b6e841 QmlPuppet: Add separate set of qml files for Qt6 for 3D editor
Import QtQuick3D 1.15 no longer works in Qt 6.2, so provide a separate
set of qml files for each major Qt version.

Fixes: QDS-4642
Change-Id: I3e17fb248f71f87fb9a40dcad3c03e037cafb0f4
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-29 12:03:57 +00:00
Miikka Heikkinen
48348b8dc4 QmlPuppet: Change custom 3D geometries to use public API
Custom geometries often break and code becomes convoluted with
version ifdeffing, so refactor the custom geometries to use public
geometry api, which works both in Qt5 and Qt6.

Fixes: QDS-4611
Change-Id: I2d78776a14d5c8153b52806842254dbedb5de83d
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-06-29 12:03:51 +00:00
Miikka Heikkinen
1c44dab5af QmlPuppet: Render 2D content inside 3D edit view
In order to render embedded 2D items in 3D scenes or 2D items used
as 3D material textures, those 2D items must be rendered.
2D content is now rendered when necessary also in editor puppet.

Fixes: QDS-4471
Change-Id: I83da90198ecebc3a3a9a35aab28f4aec36620492
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-06-23 08:44:47 +00:00
Miikka Heikkinen
193f485be2 QmlDesigner: Fix unused variable warnings
Change-Id: I1616452753685bbd57eec8fc6e1c9934c63fef0c
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-06-22 08:54:41 +00:00
Miikka Heikkinen
acb4113f09 QmlPuppet: Enable negative scaling in multiselection
Scenerotation was queried from the node for each drag move, causing
drift in the calculations. Locking the rotation at drag start makes
negative scaling work nicely.

Also enabled negative values on all axis scaling, since it makes no
sense to block it there when single axis/planar scaling already allows
it.

Fixes: QDS-4493
Change-Id: I7a38a08556bd6d729974332d312aa4aa4e84ea30
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-11 12:28:38 +00:00
Miikka Heikkinen
b73884bee5 QmlPuppet: Fix runtime warnings in 3D editor
Fixes: QDS-4491
Change-Id: I462e165ef59111f70c928b7d652ade99c5b3c0d0
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-06-11 12:28:26 +00:00
Miikka Heikkinen
74f65abed0 QmlPuppet: Fix multiselection 3D transformations when nodes have pivot
We simply need to store the scene position of the pivot point of the
node instead of node itself and work with that.

Fixes: QDS-4515
Change-Id: I99155636c52897794bea21b2db7f7d2d00059d91
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-11 07:47:19 +00:00
Miikka Heikkinen
4e1ca8d3c5 QmlPuppet: Reset gizmo orientation after multiselection rotation
Gizmo orientation in multiselection case should always be aligned to
the global axes, so we now reset multiselection on release
handlers of rotation gizmo.

Fixes: QDS-4492
Change-Id: Ic10f26f65df42869e4643f48457bcbcbf970fe9a
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-11 07:47:13 +00:00
Alessandro Portale
dcbf26490d QmlPuppet: Fix build with Qt 6.2
Fixes: QTCREATORBUG-25763
Change-Id: I05f4b44a3793c41fd1c6812f40f6603892cdac50
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2021-06-04 10:12:30 +00:00
Thomas Hartmann
8910601b78 QmlDesigner: Allow creation without version number
Task-number: QDS-4403
Change-Id: I952de9a2a6aa345b041f890fb2d364850c25e492
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2021-06-01 10:44:18 +00:00
Miikka Heikkinen
f913a65405 QmlPuppet: Support multiselection transformations in 3D edit view
Add support for moving, rotating, and scaling a multiselection of 3D
nodes in 3D edit view.

Fixes: QDS-4313
Change-Id: Icf83911ac6f87fde1cb79d6f5059ae01ed434d7f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-01 09:38:00 +00:00
Miikka Heikkinen
125cdcc3a0 QmlDesigner: Block changing eulerRotation for 3D Node that has rotation
QtQuick3D doesn't support both rotation and eulerRotation set on same
node, so we delete existing quaternion rotation if user sets an euler
rotation to the node. If node has quaternion rotation animation,
we block any change to eulerRotation in the node.

3D editor also disables the rotation gizmo for blocked nodes.

Task-number: QDS-4335
Change-Id: I4ce7b022c732a9547751f101548ecea948279db8
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-27 08:43:50 +00:00
Miikka Heikkinen
9f33f76a97 QmlPuppet: Fix crash when editing importing 3D component
Fixes: QDS-4334
Change-Id: I03c79ae7e51d6821823e19d813eba483ec5981c7
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-05-10 12:46:26 +00:00
Tim Jenssen
fb26650d86 QmlPuppet: fix crash when multilanguage database is used
amends 81a36ac0ef

Change-Id: Ib4143432704569c84a57540a07f75fa2044aaf0e
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-05-06 09:01:43 +00:00
Tim Jenssen
97a9327746 QmlPuppet: reorder includes
Change-Id: If73f76aee81feef160feeb87c78644e26e36072d
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-05-06 09:00:49 +00:00
Miikka Heikkinen
0a84406e0d QmlPuppet: Re-enable navigator preview image generation
The issue blocking this was fixed in QtQuick3D.

Change-Id: I31ceb3091f7deb4450c966a8c41a203782569f14
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-04 14:02:50 +00:00
Thomas Hartmann
c7d9ca1154 QmlDesigner: Fix Qt 6 imports
This allows using a Qt 5 puppet with simple Qt 6 files.

Change-Id: Ic3264ffbf8d798ff260305079a0bb281f9628795
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-04-06 16:45:32 +00:00
Marco Bubke
f9b64d99ae QmlDesigner: Fix qmake .pri file
Change-Id: I85b8e4e5569879131b0697aa3f4f6e8d1e477fe4
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-03-03 10:49:20 +00:00
Eike Ziller
c98e320082 Merge remote-tracking branch 'origin/4.14'
Change-Id: Iea91e66d30f797c079fe09e12a6744c36c58be1a
2021-02-09 11:42:57 +01:00
Thomas Hartmann
1641f2eb87 QmlDesigner.CapturedDataCommand: Store visible property
Change-Id: Idc2b4c9a859f9a9e03dea915ca98e91b4efdd488
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-08 16:58:12 +00:00
Orgad Shaneh
dad2b3d84b Merge remote-tracking branch 'origin/4.14'
Change-Id: I7d55c01489dfcdd26fcf3ced9f26539a09073e8c
2021-02-08 12:56:36 +02:00
Tim Jenssen
bd25785997 qmlpuppet: fix crash
initializeView(); creates the necessary engine
where we need to set the languageUi.

Change-Id: Ib9f9f35e00167ce0bfe4d96ed4e66a965daea084
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-05 17:30:56 +00:00
Miikka Heikkinen
baf3528af5 QmlPuppet: Fix custom 3D geometries for Qt 6.1
Private API puppet uses for custom 3D geometries has changed.

Change-Id: Ie9f2052b04399db6f9643aba6319f6e95df1c15b
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-02-05 15:03:47 +00:00
Miikka Heikkinen
2a94113352 QmlDesigner: Fix compile error
Change-Id: Ic52d29b6cba10ba00be2497b43490e5e1443ade2
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-02-05 11:54:41 +00:00
Miikka Heikkinen
99a3ddbd23 QmlDesigner: Move 3D asset import to puppet
Moved 3D asset import to puppet to ensure import always uses the
correct version of the QtQuick3D.

Fixes: QDS-3154
Change-Id: I630a833e7231383b87bf8b7214d3545d12de15ab
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-02-05 09:34:04 +00:00
Miikka Heikkinen
a57820f055 QmlPuppet: Register fonts at scene creation
Automatically register all fonts from 'fonts' folder at scene creation.

Fixes: QDS-3624
Change-Id: I38728e458952ea52c941244daaca715102a93c55
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-05 09:26:34 +00:00
Christian Stenger
3468d30286 QmlDesigner: Fix build for Qt5.14
Amends 59488d9606.

Change-Id: I70fd3f962de5abb6254a406263df2ea61c7e9bcc
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-02-04 07:26:01 +00:00
Tim Jenssen
59488d9606 qmlpuppet: call engine()->setUiLanguage
so qml components can react on it

Change-Id: I31dc46fabeef0936accd23ed22cbebfe2cd8663c
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-03 10:32:27 +00:00
Eike Ziller
df6967a897 Merge remote-tracking branch 'origin/4.14'
Change-Id: I6e67f23464fc14dda5a659004f0aa360d6f5d25f
2021-01-27 12:28:47 +01:00
Thomas Hartmann
d6e50e77cc QmlDesigner: Use boundingRect() instead of contentItemBoundingRect
The contentItemBoundingRect is typically null, unless there is a content
item.

Change-Id: Ic32deac3c2506ff05feb28399b1ccaedacb5f68f
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-01-26 10:48:47 +00:00
Mahmoud Badri
cc7be5724a Add Crashpad to Qt Creator and Qt Design Studio
Fixes: QDS-2748
Change-Id: I87e25682f066d167eebfd7b78c46c166e5062e11
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-01-18 22:08:14 +00:00
Miikka Heikkinen
4e5676e8c2 QmlDesigner: Add font asset preview tooltip
Refactored item library component preview tooltip to be also suitable
for asset previews.

Also now using the same image cache for font asset icons.

Fixes: QDS-3254
Fixes: QDS-3470
Change-Id: I34c1278be2e5697e01eaedabe2798104507a6ad8
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-01-14 10:50:38 +00:00
Miikka Heikkinen
bab69fff77 QmlPuppet: Fix crash at puppet reset
Puppet cleanup was not handled properly, so derefFromEffectItem() was
not called for all objects that needed it, causing puppet to crash
at shutdown.

Fixes: QDS-3461
Change-Id: I22c0552fe1223789fa42b276ab377d4a9e929955
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-01-05 09:28:45 +00:00
Eike Ziller
5572bc7220 Merge remote-tracking branch 'origin/4.14'
Change-Id: Ie52e046f8e280e8c39f0cc5e9e710b4f885010a6
2020-12-17 13:10:44 +01:00