Commit Graph

400 Commits

Author SHA1 Message Date
Eike Ziller
bd5dae90ad Merge remote-tracking branch 'origin/4.11'
Conflicts:
	share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp

Change-Id: I5e424e34db619bb769c7abc1e8651b7b40210839
2020-01-20 09:59:27 +01:00
Miikka Heikkinen
ef95674378 QmlDesigner: Initialize 3D edit view tool state at initial show
Whenever the tool state of 3D edit view changes, creator is notified
to store the state. The stored state is then restored to 3D edit view
when it is restarted. The state persists only for the lifetime of the
creator.

Change-Id: I888b3ba82693a17a2f163924fbae1cfa27593890
Fixes: QDS-1351
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-01-17 14:57:44 +00:00
Orgad Shaneh
833d278dce QmlPuppet: Fix MSVC warning
implicit conversion changes signedness: 'QFlags::Int' (aka 'int') to 'const unsigned int'

Change-Id: I3d906ca079f3f25ceb1e3b8010f0540ae0236081
Reviewed-by: hjk <hjk@qt.io>
2020-01-15 08:10:42 +00:00
Orgad Shaneh
ba20c9134a QmlPuppet: Fix GCC warning
qt5informationnodeinstanceserver.cpp:115:71: warning: narrowing conversion of ‘keyEvent->QKeyEvent::modifiers().QFlags<Qt::KeyboardModifier>::operator QFlags<Qt::KeyboardModifier>::Int()’ from ‘QFlags<Qt::KeyboardModifier>::Int’ {aka ‘unsigned int’} to ‘int’ [-Wnarrowing]
  115 |         QPair<int, int> data = {keyEvent->key(), keyEvent->modifiers()};
      |                                                                       ^

Change-Id: I2f97e9ce11202cee386c2c6b4902c689e3411e30
Reviewed-by: hjk <hjk@qt.io>
2020-01-15 07:28:32 +00:00
Miikka Heikkinen
58e2c3271e QmlDesigner: Add pivot point visualization line to 3D edit view
A line connecting the pivot point and object center is added to
3D edit view.

Change-Id: Ic265e9a3ab2895761cc92b94c778d68509ef36f1
Fixes: QDS-1474
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-01-14 11:09:38 +00:00
Christian Kandeler
3703bf0006 qml2puppet: Fix build
Change-Id: Ied2160ab99109d2ab7d5e01b51da5da3f4e374ce
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-01-10 12:53:25 +00:00
Mahmoud Badri
4ec2650995 Fix dropping imported 3D objects on the Edit View 3D
- Imported 3D objects can be dropped correctly on the Edit View 3D.
  Non-3D objects are not allowed to be dropped (both imported and
  existing items like materials)
- corrected the issue that imported 3D objects were allowed to be dropped
  on the form editor while hovering.
- show invalid drop icon on the Edit View 3D if the item in non droppable.

Task-number: QDS-1445
Change-Id: I6de0f6ddd163ae57db6100832083c942b34bfdba
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-01-10 09:55:17 +00:00
Eike Ziller
69bcf7ca60 Merge remote-tracking branch 'origin/4.11'
Change-Id: Ica0d173a08ff3f0296e875aa324d5bb6974bd90f
2020-01-08 07:13:32 +01:00
Mahmoud Badri
bb02ab161c Enable common keyboard hotkey actions for the Edit View 3D
Clicking undo, redo, delete, or save keyboard hotkeys while the Edit View 3D
has focus is working now.

Additionally this commit introduces a generic command for carrying any
variant data from puppet to creator side. This significantly simplifies
and avoids the boiler plate work of sending actions from puppet to
creator side. Current commands can be ported to use this generic
command but this is not part of this commit. Also a similar command to
work the other way around could be implemented.

Task-number: QDS-1266
Change-Id: I40fdf6b215ce77402250a791ea49cbdcd2a9d6eb
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-01-07 09:16:19 +00:00
Eike Ziller
e16876df0c Merge remote-tracking branch 'origin/4.11'
Change-Id: Ieb0bb1ebab9a5efb42d15bbeac2cd4c46a6de962
2019-12-18 09:14:14 +01:00
Thomas Hartmann
2f2787c4a8 QmlDesigner: Add workaround for QVector3D
For some reason the Qt meta system does not work reliable
for QVector3D. It does work "rotation", but not for "pivot",
despite the fact that both properties are defined in exactly the
same way.
This patch works around the main issue.
There are still a few issues left, but at least the default is
correct now.

Task-number: QDS-1355
Change-Id: I75e2d3adff6967e89c6ce031d744baa12b5e8061
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-12-17 10:08:00 +00:00
Mahmoud Badri
e5d4224fe4 Prevent the Edit View 3D restart upon closing
Also the 2D/3D action updates correctly according to Edit View 3D state.

Task-number: QDS-1385
Change-Id: I95d0994e9c56df25a2988eb9d27994268dd1903d
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-12-17 09:48:05 +00:00
Eike Ziller
267946d100 Merge remote-tracking branch 'origin/4.11'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/boot2qt/qdbrunconfiguration.cpp
	src/plugins/boot2qt/qdbrunconfiguration.h
	src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp
	src/plugins/qnx/qnxrunconfiguration.cpp
	src/plugins/remotelinux/remotelinuxrunconfiguration.h

Change-Id: I17c8e1bf300bb75d7317ccf7749dd3cc07709c21
2019-12-16 16:19:44 +01:00
Mahmoud Badri
f97de35dd4 Improve edit view 3D "on top" logic
- Proxy dialog removed
- When the QDS window is minimized/maximized, the edit view 3D follows.
  The opposite is not true (edit view 3D can be minimized separately).
- Edit view 3D is always on top of QDS window. Only exception is when
  a popup is shown (so that the user can handle the popup).
- External apps go normally on top of the edit view 3D.

Known (non critical) issues:
- Activating the edit view 3D doesn't raise() the QDS window, so if an
external app is on top of the edit view 3D then the view is clicked,
the external app will be in between the view and the QDS window.
- Closing the edit view 3D from the x button doesnt work (causes a
  restart). This is not in the scope of this commit.

Task-number: QDS-1179
Change-Id: I1dd72590037be295b94735de96772307ba14c59c
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-12-13 12:40:43 +00:00
Miikka Heikkinen
eb09e814db QmlDesigner: Properly update 3D edit view cameras and lights
Now edit view will create and remove cameras and light gizmos properly
when cameras and lights are added or deleted.

Change-Id: I858752c1410f3a40ea2adaf538c281aaee94ec58
Fixes: QDS-1267
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-12-13 09:27:44 +00:00
Christian Kandeler
16e3e44ce7 QmlDesigner: Fix more warnings about unused parameters and functions
Change-Id: I8b569fcf60a0a21c6828d612997bbba0f737c806
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-12-10 17:20:55 +00:00
Orgad Shaneh
49f6b0146a Merge remote-tracking branch 'origin/4.11'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/mcusupport/mcusupportrunconfiguration.cpp
	src/plugins/python/pythonproject.cpp
	src/plugins/qmakeprojectmanager/qmakestep.cpp
	src/plugins/qmlprojectmanager/qmlproject.cpp
	src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp

Change-Id: I22507be28fd80c49c9fee0dff5937a40db176a82
2019-12-07 18:39:54 +02:00
hjk
d61773fa25 QmlDesigner: Suppress warnings if Quick3D is not used
Amends d076c59429.

Change-Id: I3cba673b7cdd4e99541581008bedfb6d0d333339
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2019-12-04 09:01:04 +00:00
Miikka Heikkinen
73d3df7908 QmlDesigner: Make imported models selectable
Import creates an opaque Component, which can contain one or more
pickable models. We mark all instanceless models pickable according to
the parent instance pickable status and specify the parent instance
as the pick target using a dynamic property.

Change-Id: I05b96ee48eb8f246c50b2254d620b621e2437aa5
Fixes: QDS-1282
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-12-03 08:44:30 +00:00
Miikka Heikkinen
8ff52e37a7 QmlDesigner: Implement multiselection for edit 3D view
Multiselection works in 3D edit view with ctrl-click just like it
does on the Design Studio.

Change-Id: I266f2de11758bed064f44dd97cd79189e3e1f831
Fixes: QDS-1265
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-11-28 14:43:49 +00:00
Thomas Hartmann
880ab11e76 QmlDesigner: Use proxy dialog for 3D edit view
To integrate the 3D edit view in the qml2puppet process,
we create a dialog in the Qt Creator process.
This dialog acts as a proxy that manages the actual window.

For this I introduced a new command that allows showing, hiding, resizing
and moving of the 3D edit view.
The 3D edit view always follows the proxy dialog.

During moving and resizing we hide the window to avoid artefacts.

At this point in time the proxy widget is a dialog, but it could
also be a dockwidget or any other QWidget in the future.

Task-number: QDS-1179
Change-Id: I67ccab49eb2de9ba23098a67b2f9577f6c7fd3ac
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2019-11-28 13:09:51 +00:00
Eike Ziller
6fc85b49fa Merge remote-tracking branch 'origin/4.11'
Conflicts:
	src/plugins/designer/codemodelhelpers.cpp

Change-Id: I78906f2fbbfd27d254589a272ebca423b0b80699
2019-11-28 08:24:10 +01:00
Miikka Heikkinen
d076c59429 QmlDesigner: Block selection of hidden objects
If eyeball is turned off for object, it shouldn't be pickable in
3D edit view.

Change-Id: Ib9308aaaecc822f448591f249bd96ffb5d0c9c48
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-11-26 10:36:51 +00:00
Miikka Heikkinen
389f96b0ee QmlDesigner: Implement group selection boxes in 3D edit view
Object's selection box now includes the bounds of all of its
descendants. Selection boxes of immediate children of a selected
object are also drawn.
Individual/group selection buttons also now work as expected.

Change-Id: Ice7ef9a536e32c6bb6da70fe23bf0a38e72c14f8
Fixes: QDS-1210
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-11-22 14:02:48 +00:00
Miikka Heikkinen
7a46dc620e QmlDesigner: Fix build error
Change-Id: I53d425d0b6f4e66c09bd988bd188218cbf51a99c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-11-22 11:11:22 +00:00
Miikka Heikkinen
0b510f173e QmlDesigner: Implement selection box to 3D edit view
Change-Id: Ib0b13ecd7946e3b7da8ed06d4f5965e06e51a152
Fixes: QDS-1210
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-11-22 10:48:48 +00:00
Miikka Heikkinen
77cb514a79 QmlDesigner: Implement better camera navigation in 3D edit view
Edit camera is now controlled as in Qt 3D Studio:
ALT + left button orbits camera.
ALT + middle button pans camera.
ALT + right button zooms camera.
Wheel zooms camera.

Task-number: QDS-1206
Change-Id: Ia72644073d172b00483ceed8bcc5ffb8dce68741
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-11-22 10:47:42 +00:00
Eike Ziller
4e6142c932 Merge remote-tracking branch 'origin/4.11'
Conflicts:
	src/plugins/autotest/testresultspane.cpp
	src/plugins/cmakeprojectmanager/cmaketool.cpp

Change-Id: Iade695ac9cab8bf3e3a1abd6e2c71f4a19132ac0
2019-11-21 22:18:35 +02:00
Miikka Heikkinen
49f7cfb7a1 QmlDesigner: Implement proper helper grid for 3D edit view
Change-Id: I9e33218d4b1528610155c5fb9bf94a9597ee23df
Fixes: QDS-1204
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-11-18 08:40:00 +00:00
hjk
0120e462b2 Partial compile fix for current Qt dev and/or Qt 6
This does not cover Utils::MapReduceOption with QVector, and code
that's not compiled on my machine.

Change-Id: Ib63923985c52b1bb74e5ec2068a2bb37469ac618
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-11-12 10:50:51 +00:00
Mahmoud Badri
5df7ad94ec Implement DnD 3D objects from the item library to the EditView3D
Proof of concept drag and drop implementation. Basic functionality
working but needs polish.

Task-number: QDS-1132
Change-Id: Ie3b9e80de9a414c4955d6e38daf338045bc1e614
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-11-12 10:00:34 +00:00
Eike Ziller
646c7860cb Merge remote-tracking branch 'origin/4.11'
Conflicts:
	src/plugins/genericprojectmanager/genericprojectplugin.cpp
	src/plugins/projectexplorer/environmentaspect.cpp
	src/plugins/projectexplorer/environmentaspect.h
	src/plugins/projectexplorer/environmentaspectwidget.cpp

Change-Id: Id21d62cf14419febd1e06c9b429fcdf4501c0eaf
2019-11-11 12:58:11 +01:00
Miikka Heikkinen
db7087225d QmlDesigner: Implement camera frustum visualization for edit 3D
Task-number: QDS-1208
Change-Id: I3241fcdc68d01666a2536df32f170cd898cbd7af
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-11-11 08:44:16 +00:00
Miikka Heikkinen
c67965fb29 QmlDesigner: Add ScaleGizmo to 3D edit view
ScaleGizmo allows scaling in the direction of local or global axes,
as well as uniform scaling. Any scale component cannot be made
negative with ScaleGizmo.

Change-Id: I9b98d9593e07ded340178b07b73fa1b72421ba20
Fixes: QDS-1195
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2019-11-08 12:53:21 +00:00
Eike Ziller
04bd6e39c8 Merge remote-tracking branch 'origin/4.11'
Conflicts:
	share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quick3dnodeinstance.cpp

Change-Id: I8ea57eba526ab830608fd928c28771c5441749f8
2019-11-01 15:31:19 +01:00
hjk
2e5e3daff6 QmlPuppet: Avoid warning about unused argument
Change-Id: Icad7539983655a3107cdca93b83e33aa6682e176
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-11-01 08:49:25 +00:00
Thomas Hartmann
17dbc74cca QmlDesigner: Avoid reflection when setting values from puppet
When editing values in the puppet we did not take reflection into account.
This means that any changes we did from the puppet for notified back
from Qt Creator. Since those notifications are asynchronous this leads
to various issues especially when more than one axis (property) was modified
at once.

This patch avoids reflection. The notifications are 'flagged' and then
ignored in the Qt5InformationNodeInstanceServer.

While a node is moved we ignore any changes to that specific node.

Task-number: QDS-1191
Change-Id: Ic74e22ea71832ce12321f9085a7296c2a7d9893d
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-10-30 09:46:35 +00:00
Miikka Heikkinen
47f54dd101 QmlDesigner: Add camera and light gizmos to 3D edit view
A small icon and a placeholder mesh are displayed at the location of
the lights and cameras in the scene, to provide a way to see and
interact with them.

Change-Id: I1f90fce77a643cab2c3fda3ee2105af53dea57a9
Task-number: QDS-1177
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-10-29 12:57:06 +00:00
Christian Kandeler
d3e6fa0f2e QmlDesigner: Fix some warnings
Change-Id: Ice9c29409b53457c20cef272b6a5dd6feb97adb3
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-10-29 11:35:38 +00:00
Thomas Hartmann
6b17cd91a6 QmlDesigner: Use transactions in 3D Edit View
We send a ValuesModifiedCommand 'immediately' when the item is moved.
This means the 2D form editor and property editor update
while moving nodes in the 3D edit view.
The updates are 'compressed' by 100ms. This is to avoid performance issues.
The timer could be reduced to 50ms or even 10ms, but 100ms feel
acceptable at least for me.

The code was a bit refactored.
Qt5InformationNodeInstanceServer::modifyVariantValue() can be used later
to update other Vector3D based properties like rotation and scale.

There is one issue left. MouseArea3D emits 'onReleased' only after the
mouse is moved again. This delays the 'commit' of the transaction which
is annoying and can triggers bugs.

Change-Id: I834a1e2658278ff8dd39678f39e51735dee91b65
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2019-10-28 10:58:35 +00:00
Mahmoud Badri
afd22a75c1 Update EditView3D when selecting a 3D object in the navigator
Task-number: QDS-1124
Change-Id: I8d7bf73612b07592cd9beb85a5249895a400316b
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-10-27 20:44:53 +00:00
Thomas Hartmann
e572777776 QmlDesigner: Fix setting position from qml2puppet
Change-Id: I1348fa3d761be7b185d5324a73e8cdd543be50e9
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-10-25 14:52:15 +00:00
Mahmoud Badri
b83b93fb7f Make 3D objects pickable
Mark 3D objects implicitly pickable upon initialization so that they
receive mouse clicks without having to declare the pickable property
in qml.

Task-number: QDS-1124
Change-Id: Ib8ec5415097c1a9bf57b8965a3fca0c3665f3732
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-10-25 07:55:40 +00:00
Miikka Heikkinen
1fe204565a QmlDesigner: Add support for move gadget to 3D edit view
This proof-of-concept move gadget is based on the move gadget
in studio example of QtQuick3D.

Change-Id: I1b596443a3e99c16ed214bc464c5367a0f7aa503
Fixes: QDS-1125
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Pasi Keränen <pasi.keranen@qt.io>
2019-10-25 07:51:09 +00:00
Mahmoud Badri
1641ad625e Deselect all objects when clicking an empty point in the 3D edit view
Task-number: QDS-1124
Change-Id: I5a9ed39a69c467de27dd7c4564d53b7bf033dd92
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-10-24 11:16:06 +00:00
Mahmoud Badri
3c78d4d74d Enable object selection in the 3D edit view
Clicking an object in the 3D object selection view, selects it in the
creator side. Multiselection (i.e. Ctrl+click) is not implemented yet.
Also selected object is not highlighted in the view yet.

Task-number: QDS-1124
Change-Id: I0b10162539ecedc40ed117896e385975c52b04a9
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2019-10-24 09:07:38 +00:00
Thomas Hartmann
9469432035 QmlDesigner: Add Qt5InformationNodeInstanceServer::modifyProperties()
This method allows to modify properties in the data model from
the puppet. For performance reasons, properties should be modified
in bulks. Each bulk will be one step on the undo stack.

Change-Id: I7dbef02781706c8638981512ca0ec45d24c54545
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-10-24 08:22:11 +00:00
Thomas Hartmann
07573de102 QmlDesigner: Do not crash if EditView3D contains errors
EditView3D.qml can contain errors, most likely because
of QtQuick3D updates.

Change-Id: I85879d9079ba8771a2af4478ba2e4e63a6aa9223
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2019-10-23 13:23:21 +00:00
Thomas Hartmann
60bb13efbf QmlDesigner: Use DesignerWindowManager when reading stream
Without the DesignerWindowManager QtQuick3D items will crash.

Change-Id: Ib4057d581143aed860fa120ab189e11076d1f531
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2019-10-23 07:16:51 +00:00
Christian Stenger
091f0f1a04 QmlDesigner: Fix compile
Amends ac84f8a457.

Change-Id: Iccca5a31dd852bc95c9095a2c8b1c6f1f5eab8d8
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-10-21 13:06:33 +00:00