Commit Graph

800 Commits

Author SHA1 Message Date
Miikka Heikkinen
85bcae2c38 QmlDesigner: Handle active scene id change properly on edit 3D view
The scene id shown on the corner of edit 3D view is updated and
toolstates are also stored under the new id.

Change-Id: Ib3ac2f2bb829a5d908e22932c313c76bd4143592
Fixes: QDS-2277
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2020-06-29 10:19:45 +00:00
Miikka Heikkinen
ba942583b8 QmlDesigner: Update 3D edit view on state change
Change-Id: I56b16afe4d9ccab802d6e07f60b57e46a353cc26
Fixes: QDS-2378
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2020-06-29 10:06:55 +00:00
Eike Ziller
40a14070d3 Merge remote-tracking branch 'origin/4.13'
Change-Id: Ie67085fcbb4150c60f0253312e19a82b95b4a898
2020-06-29 09:01:31 +02:00
The Qt Project
018e4aa197 Merge "Merge remote-tracking branch 'origin/qds-1.59' into 4.13" into 4.13 2020-06-29 04:38:48 +00:00
Tim Jenssen
b8cd87dea0 Merge remote-tracking branch 'origin/qds-1.59' into 4.13
Conflicts:
	src/plugins/clangformat/clangformatplugin.cpp
	src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp
	src/plugins/qmldesigner/qmldesigner.qbs

Change-Id: Ie4a0beeb9fd32ac9683f4e8769988a9c3f3e369a
2020-06-26 16:51:22 +02:00
Artur Shepilko
1522dc98c1 Qmlpuppet: Remove an explicit bool type for fitAndHideBox() function
Explicit return values in qml functions cause errors in some Qt
versions, so remove the need for it.

Change-Id: Idd3035b19b56c25e94bc846c3de8f7aa5381e1eb
Reviewed-by: Artur Shepilko <artur.shepilko@nomadbyte.com>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2020-06-26 13:57:15 +00:00
Miikka Heikkinen
2949504a9d QmlDesigner: Fix draggable priorities in 3D edit gizmos
Upped default priority of all directional draggables a bit to make
them preferable to free rotation ball.

Change-Id: If934cb723e8c1a8ca9a114d71b19cbfc196e2682
Fixes: QDS-2286
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2020-06-26 13:56:52 +00:00
hjk
dbca372780 QmlPuppet: Fall back to pre-Qt5.2 for QVariant comparison
Change-Id: Ibf55561e01f50ec7d689d40b50d100b8d257aa80
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-26 07:11:16 +00:00
Thomas Hartmann
003282c6f5 QmlDesigner: Fix crash on puppet
Change-Id: I233d3dab5a509bfd7c9a30c7dcc15dcf8751f456
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-26 06:48:26 +00:00
Thomas Hartmann
a381d8efc8 QmlDesigner: Fix crash on puppet
Change-Id: I233d3dab5a509bfd7c9a30c7dcc15dcf8751f456
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-25 12:02:57 +00:00
Miikka Heikkinen
60ff6b6577 QmlDesigner: Improve usage of QML items as quick3d textures
Quick3D Texture elements require some window signals to show QML item
as texture, so we fake them to make textures appear in form editor
and state preview. To prevent texture mirroring, flipV value
is force set at proxy creation. To keep state preview up to date,
we trigger multiple render passes if there are any QML items used
as texture sources in quick3D textures.

Task-number: QDS-2290
Change-Id: I16c34aad943213c0b737fdb073333be3bbd40f2d
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2020-06-25 08:07:41 +00:00
Tim Jenssen
86cf85af5e qmlpuppet: improve text
Change-Id: Ibd1b7cd783561bc0b1e853e8875ee631eddb85d6
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-16 14:34:59 +00:00
Christian Kandeler
fcef4709bb qmlpuppet: Fix function linkage
Putting static functions into a header file causes warnings in all cpp
files that include the header and don't use the function.

Change-Id: I9147c034092515e486dc6113a1b053f4d8094686
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-15 12:06:31 +00:00
Tim Jenssen
f652167768 qmldesigner: add language to create scene command
and also save the last used language to settings

Task-number: QDS-2218
Change-Id: Ib82f7bc755755661183452b32829be3d048d9947
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-06-11 15:26:39 +00:00
Tim Jenssen
3acdb7891b Merge remote-tracking branch 'origin/qds-1.59'
Change-Id: I8891e7490a7fd51997a3b57561961f6134be3252
2020-06-11 12:54:10 +02:00
Thomas Hartmann
ad4c5e0258 QmlDesigner: Fix puppet crash
Change-Id: I2a408d090c4bbf2c3da7f03473312eff4b7e6c34
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-10 16:02:59 +00:00
Miikka Heikkinen
29ceaade9c QmlDesigner: Restore the previously active 3D scene on scene creation
Store the last active scene in global 3D tool state and restore it
when a scene is created after puppet relaunch.

Change-Id: Ie2d69f6db6798ab383c66d38b2dea7eba13adc97
Fixes: QDS-2239
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-09 12:31:57 +00:00
Miikka Heikkinen
0a83cc4e88 QmlDesigner: Show the scene id in 3D edit view
It's sometimes hard to tell which scene is shown in 3D edit view, so
added the scene id to the upper left corner of the view.

Task-number: QDS-2239
Change-Id: I5999e41c3f92028cd9a0f79ae0c8b72263d9ce42
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-09 12:31:37 +00:00
Miikka Heikkinen
5551791077 QmlDesigner: Fix hover hightlight of 3D edit icon gizmos
MouseArea.containsMouse gets confused when the mouse input gets grabbed
by an overlapping 3D mouse area.

Change-Id: I6ee69f217d95c5e4f3f5361e14c932ce0a2feab0
Fixes: QDS-2187
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-09 12:28:03 +00:00
Miikka Heikkinen
5b28847648 QmlDesigner: Fix drag-adjusting values not ending up with correct value
When drag-adjusting e.g. brightness or position of the object in 3D
edit view, the value ending up in property editor and qml doc didn't
always match what was displayed on 3D edit view. This happened because
ValuesModifiedCommand was compressed to 100ms intervals, but any
property changes also sent ValuesChangedCommand at 16ms interval,
which changed the instance value at backend, but not the model value.

Fixed by comparing modified value to model value instead of instance
value.

Also made the 100ms compression timer singleshot, so the backend
wouldn't be unnecessarily bombarded with ValuesModifiedCommand when
holding the mouse still while dragging.

Change-Id: If86dcd61bcf0c04735d65648e4c34d9d214c5313
Fixes: QDS-2081
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-09 12:18:08 +00:00
Miikka Heikkinen
47ca3ccd8f QmlDesigner: Fix RotateGizmo and LightGizmo label z-value
Labels went under IconGizmos, so increased the z-value to match that
of MoveGizmo label.

Change-Id: I2620db0cadfadc73808a3a9f9967aadf87c9a863
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-09 12:16:24 +00:00
Miikka Heikkinen
b2b590ae24 QmlDesigner: Restart overlay update timer on each request
If timer is not restarted on each request, the update can end up
happening before the next frame has been rendered. This can happen e.g.
at puppet startup, where the delay between first request and first
frame render can easily be more than 16ms.

Change-Id: Ib9555548e8c60799c585d0ab43d0626cfa31a494
Fixes: QDS-2082
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-09 12:14:35 +00:00
Miikka Heikkinen
cfa8373ce0 QmlDesigner: Remove unused signal
Change-Id: If0adce20a27575f7b4a39a08836da250d0b7bae6
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-09 12:13:32 +00:00
Miikka Heikkinen
b441988b58 QmlDesigner: Add fade control handle to point light gizmo
Also changed the point light mesh to just a single camera plane ring
based on discussions with UX.

Change-Id: If9e847440570bbe87483194c0b417cf09c7084a2
Fixes: QDS-2041
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-09 12:13:13 +00:00
Miikka Heikkinen
327821220c QmlDesigner: Add handles to light gizmo for adjusting area light
Change-Id: Ic12bd6f5ec8800d7a42064247eecbb742ebea40c
Fixes: QDS-2040
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-09 12:12:55 +00:00
Miikka Heikkinen
e4b2e45ea6 QmlDesigner: Implement spotlight drag handles
Inner cone visualization for spotlight was added, as well as drag
handles to adjust inner and outer cone angles and fade.

Fade handle adjusts fades in order: quadratic, linear, constant.
If a specific fade value is zero, the next one in list is chosen
for adjustment.

Change-Id: I921936d9782de511558bc6c24cfa0953cce494f0
Fixes: QDS-2038
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-09 12:12:32 +00:00
Miikka Heikkinen
387657b83a QmlDesigner: Add missing camera plane ring to point light model
Task-number: QDS-2037
Change-Id: Ica5a7ec2983da251d2ab75565120423288de27a2
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-09 12:10:58 +00:00
Miikka Heikkinen
3d162524e4 QmlDesigner: Add brightness control to light gizmo
Brightness can be controlled by dragging on the brightness indicator
arrow of the light gizmo in 3D edit view.

Change-Id: I317f5ee08b59bcc0bebf3fdf59861df15ef13c84
Fixes: QDS-2039
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-09 12:09:55 +00:00
Miikka Heikkinen
a3e6e24427 QmlDesigner: Update light gizmos
Directional light model was made constant size, as it doesn't have
actual physical presence.

Spot light cone now shows the cone angle correctly and the length of
the cone is calculated so that 5% of the brightness reaches the
center of the cone bottom.

Area light rectangle matches the area of the light.

Point light mesh changed to three perpendicular circles.
Same formula for size of the circles used as for spotlight length.

All light types share a common brightness indicator arrow.

Task-number: QDS-2037
Change-Id: I534dbcda9cfa2a7768c2537868ba83818979b250
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-09 12:09:41 +00:00
Miikka Heikkinen
4d23e6300f QmlDesigner: Update light icons
Task-number: QDS-2037
Change-Id: I0b95034f9ba9f308ba6fde82749b6cbef3f35859
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-09 12:07:39 +00:00
Eike Ziller
c644e7c80a Merge remote-tracking branch 'origin/qds-1.59'
Conflicts:
	src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
	src/plugins/qmlpreview/qmlpreviewconnectionmanager.cpp

Change-Id: Ifa7c66330c1995378280cdb4c57c30015dc11b68
2020-06-08 16:04:15 +02:00
Tim Jenssen
3db68b4aab qmldesigner: remove double command registration
Change-Id: Id37bea290c136d24551729a8edb36fab19b5bd7e
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2020-06-05 14:41:32 +00:00
Henning Gruendl
b851b71128 Fix compilation under linux
Change-Id: I3070876f0549a9fb7c3a52c5bc99638bad2d2894
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-03 09:09:38 +00:00
Thomas Hartmann
fd55b36b7c QmlDesigner: Increase alive timer
Change-Id: I2f3c1c95f631925f66dad2ce1f7635756edb7ae5
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-05-26 18:14:27 +02:00
Thomas Hartmann
c8d7d44bfb QmlDesigner: Fix changePreviewImageSize
If the size is invalid set the default size.
Invalid size most likely means the setting was removed.

Change-Id: I3f1dad5bdac799673d37036099d954caab9aca19
Reviewed-by: Michael Winkelmann <michael.winkelmann@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-05-26 18:14:14 +02:00
Thomas Hartmann
4896b60139 QmlDesigner: Add qRegisterMetaType for ChangePreviewImageSizeCommand
Change-Id: Ic399afc342a821f89c2559e0d2ebec942504ba61
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Michael Winkelmann <michael.winkelmann@qt.io>
2020-05-26 18:14:03 +02:00
Tim Jenssen
cbd0649e3b qmlpuppet: enable the use of multilanguage database
Change-Id: I2277348ac1e6b5025e75c640da83da30294c9d10
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-26 18:12:38 +02:00
Marco Bubke
2e79e1715b QmlDesigner: Fix crash for missing registration of ChangeLanguageCommand
Change-Id: Ieef35ef5daa19615375cc4c7b2b0b62667df7b67
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-05-26 18:12:19 +02:00
Marco Bubke
d2fe9da7e7 Fix \
Change-Id: I1834bb36443417212e4836c3353ee6c8f040b617
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-14 15:21:52 +00:00
Michael Brüning
b84025cd3a Fix build on macOS
Commit 0e7a1e6650 was missing an
include for QDebug.

Change-Id: I34421f634c40984750daeac31eed9191a9128f87
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-13 14:55:53 +00:00
Tim Jenssen
03a1282bdd Merge remote-tracking branch 'origin/qds-1.50' into qds-1.59
Change-Id: Ic0edcce1268b9cc47c91364eeb84e3b3f7dfe134
2020-05-12 10:04:10 +02:00
Marco Bubke
0e7a1e6650 QmlDesigner: Preview size is now changeable
You can now change the preview size with
rootModelNode.setAuxiliaryData("previewSize@Internal", size);
If size is null it will use the bounding box size.

Change-Id: Icbe747ccc5a2e26e79783825d2ed94ecc640012b
Reviewed-by: Michael Winkelmann <michael.winkelmann@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-05-12 07:11:15 +00:00
Thomas Hartmann
33c88a0ced QmlDesigner: Expose component url
Change-Id: I2b1708e6f87b00ad0b56c04f591ba24720a886ba
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-05-06 20:17:01 +00:00
Michael Brüning
b80744903e Fix build eror in ChangeLanguageCommand on macOS
Added missing includes.

Change-Id: Ic7823176fd7d7cc05ddbe62133974b3052c6e2e8
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-04 15:11:07 +00:00
Marco Bubke
dacea667ed QmlDesigner: Add ChangeLanguage command
Change-Id: If79de7d04717ad81af05411e61c262b9ff70129b
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-04-29 06:17:34 +00:00
Tim Jenssen
53d161c98e Merge remote-tracking branch 'origin/qds-1.59'
Change-Id: I8a5d7d98b4d75379fe3953fe00bdb939d1722676
2020-04-28 16:18:24 +02:00
Tobias Hunger
9f92acf223 QmlPuppet: Fix build
You can not use a variable in a lambda without capturing it.

Change-Id: Iada3e40c70c0584c82a5c95a40f64164ca533aed
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-04-27 18:47:34 +00:00
Miikka Heikkinen
d1a7afa28f QmlDesigner: Add "closeup" option to focusObjectToCamera function
The closeup option is used for itemlibrary thumbnail generation, where
the regular fit produces too small images on most imports.

Change-Id: I2901a2e20d100b155111f002b22489df945e9e01
Fixes: QDS-1899
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2020-04-24 10:29:43 +00:00
Christian Kandeler
4c064c5f9b QmlDesigner: Fix warnings about unused lambda cpatures
Change-Id: I73e7aeed02527efd657df44232c13bb2e136f5ee
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-04-23 15:33:18 +00:00
Christian Kandeler
785b184fb6 QmlDesigner: Fix warnings about unused variables and functions
Change-Id: Ib907db11dcdcef9cbbb91c8fd7af22ae420796b1
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-04-23 13:49:04 +00:00