Commit Graph

482 Commits

Author SHA1 Message Date
hjk
62636b270d Qml2Puppet: Compile fix
Add missing #include. Amends db7087225d.

Change-Id: I8d9147fb788ee47b37dac9f347a6828250eec1e0
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2019-11-11 09:43:33 +00: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
862b7fa35c QmlDesigner: Add planar move and scale handles to gizmos
Change-Id: Icae60ec35fc84d731243a005e97b174fa9a94815
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2019-11-08 12:54:06 +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
Miikka Heikkinen
97788c457e QmlDesigner: MoveGizmo improvements in 3D edit view
Mouse press and release are now properly handled by MouseArea3D.
This fixes various issues:

- No need to move the mouse after release for release to register.
- Drag is no longer limited to the 3D edit window, though it is still
  limited to the screen.
- Drag arrows no longer register start of drag if you click outside
  the arrow and then move the cursor over the arrow while holding the
  mouse button down.

Also added the missing center ball to the MoveGizmo to allow free
dragging along the camera plane.

Change-Id: Iab55ae79f8af024534510e5fd29379532ac74025
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-11-01 08:49:12 +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
Thomas Hartmann
ac84f8a457 QmlDesigner: Implement Quick3DNodeInstance wrapper
We use Quick3DNodeInstance as a proxy class to wrap QQuick3DNode.
The access to private API like QQuick3DNodePrivate::setIsHiddenInEditor()
is restriced by such proxy classes.

Change-Id: If5191c3b730359000cf983c3af206dcffa07be74
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Pasi Keränen <pasi.keranen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-10-21 11:30:19 +00:00
Pasi Keränen
c2c8b9a5d6 Add edit camera controls for 3D edit view
Add edit camera controls and grid helper to 3D edit view.

Task-number: QDS-1127
Change-Id: Ice5ea0fcca18d59dc8a2907710e16c6688b90628
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2019-10-21 08:27:16 +00:00
Thomas Hartmann
640044c8f8 QmlDesigner: Implement command for synchronising the selection
This patch implements the command and dispatchers for
synchronising the selection between Qt Creator and the qml2puppet.

Qt5InformationNodeInstanceServer::changeSelection() is called whenever the selection
is changed in Qt Creator.

Qt5InformationNodeInstanceServer::changeSelection() allows to change the
selection from the qml2puppet.

Change-Id: I73a64d8dc2a3f330433f966b42a10229cbbff649
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-10-21 05:52:13 +00:00
Thomas Hartmann
42fba8ee3b QmlDesigner: Only show 3D edit view if enabled
QMLDESIGNER_QUICK3D_MODE controls if the edit mode should be shown.

Change-Id: I4522dc0887486f329fdb140079e6d644f601c77f
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2019-10-16 07:49:28 +00:00
Thomas Hartmann
18ff97581a QmlDesigner: Show 3D scene with multiple objects
A View3D can have multiple root nodes, which are
automatically aggregated in a single root node.

Change-Id: I3ad11eff5a8beadbd53f0fc8cdcaecd78772768b
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2019-10-15 13:08:57 +00:00
Thomas Hartmann
db3dc34a12 QmlDesigner: Introduce QMLDESIGNER_QUICK3D_MODE
We should enable the 3d edit mode only, if there is
QtQuick3D import. Additionally there should also be an option in the UI.

Change-Id: I2010f2cdd6546c63a2263b8ee02480d4f13177c2
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2019-10-15 12:43:27 +00:00
Thomas Hartmann
5b325b1748 QmlDesigner: Do not try to create objects with invalid version
Change-Id: I15eb8cf006bf8a58eaba4140f062fbf14e417f47
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-10-14 18:29:20 +00:00
Thomas Hartmann
14ab9db519 QmlDesigner: Fix keyboard focus on mac for 3D edit view
We used LSUIElement and QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM
to hide the puppet process on macOS.
Unfortunately such a process cannot get any keyboard focus.

Change-Id: I73ae919a6a2fd5a733e92a37541baccddc135326
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Pasi Keränen <pasi.keranen@qt.io>
2019-10-14 11:31:46 +00:00
Thomas Hartmann
b6790e82a4 QmlDesigner: Use core profile for edit view
Change-Id: Ic62ec2cc54d9bf30fa41cccdb5b10e9b75c67290
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-10-11 08:10:56 +00:00
Thomas Hartmann
c5fe523774 QmlDesigner: Fix eyeball in navigator for QQuick3DNode
The eyeball status for QQuickItem is handled in the form editor.
This does not work for QQuick3DNode.

* Adding support for 'invisible' in QmlVisualNode
  This allows to handle the 'invisible" state for
  both QQuickItem and QQuick3DNode.

* Adding support for 'invisible' in the NodeInstanceServer.
  This means that the nodes are actuallly made invisible,
  if the AuxiliaryData is set.

Even with this patch there is still a downside. We actually do
hide the QQuick3DNode, which is reflected by the value of 'visible'
in the property editor. This is not correct. The eybeball should not affect
the actual property. To properly implement this we need a way to hide an
item in the scene wihout changing the visibility property.

Task-number: QDS-1065
Change-Id: I713ec97bc89fdd7271b2174756f36ce3731cfd4e
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2019-10-09 12:02:36 +00:00
Thomas Hartmann
1900276c17 QmlDesigner: Enable 3D Edit View in Qt Quick Designer
If we find a QQuick3DViewport or the root node is a QQuick3DNode,
we create an 3D Edit View QQuickView for 3D editing in the 'editmode'.

This requires to not use the DesignerWindowManager for the 'editmode'.

The current implementation for the 3D Edit View is done in EditView3D.qml,
but can be replaced by a custom EditView class later. At this point in time
there is no hard dependency on QtQuick3D. Once we start to implement
more advanceded editing features, EditView3D.qml has to be replaced by a
custom C++ class with a hard dependency on QtQuick3D.

Currently the scene can be rotated around the 'y' axis, it is possible
to move the camera on the 'z' axis and the custom light can be turned
on and off. This is simply a proof of concept that the 3D Edit View
already allows some user interaction.

Change-Id: I96400e72b0853dde7939c693d1d7300f9c2ab142
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-10-09 10:07:11 +00:00
Eike Ziller
a81c1aab2c Merge remote-tracking branch 'origin/4.10'
Change-Id: I273a1e8f5f9e54756befbc398c2c2754534ff128
2019-08-09 09:43:16 +02:00
Tim Jenssen
c9b91e7e6b QmlDesigner: reduce enumeration to header only
It is used in some other external qmldesigner plugin and
these are built against current dev packages, which
are not contain this cpp file.
Different solution would be to add:
  r"^share/qtcreator/qml/qmlpuppet/types/enumeration.cpp$",
to scripts/createDevPackage.py which feels not that clean.


Change-Id: Ia1fb5c02f457d98474218689ebf6483706265dde
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-08-07 14:48:04 +00:00
hjk
2e14df7561 Some clang-tidy -use-modernize-nullptr
Change-Id: I1bed5e85a5b7948d08502a72a10f80baa075c204
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-08-01 13:20:26 +00:00
Eike Ziller
e5543eaebf Merge remote-tracking branch 'origin/4.10'
Change-Id: Id9cab641788f93cda9a81da9f156614b91d87b2a
2019-08-01 11:58:56 +02:00
Thomas Hartmann
0f3c8a3c7b QmlDesigner: Fix custom qml2puppet build
The build of a custom qml2puppet was failing, because
of utils/algorithm.h missing.
We should minimize Qt Creator dependencies in the puppet.

Change-Id: Iba8dd1a3979dbeeb1bfa860b50ba586bea20c7a7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-31 10:38:28 +00:00
hjk
e3b1106afa Compile fix with recent Qt dev
The reasoning in 1b4766e26c did not take into account that the scope
of QT_NO_JAVA_STYLE_ITERATORS may change over time, as done with
f70905448f6 in Qt base.

Change-Id: Ib1966ff26c4d36d5f62e149d6b45baa4aecf825d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-29 08:54:18 +00:00
hjk
a34bf6a23b QmlPuppet: Replace some foreach
Change-Id: I59b4049282564762f75aa5e9a7a0b7eba055db48
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-26 12:59:41 +00:00
hjk
6a58666f44 More Utils::toSet/toList
... and unrelated cosmetic changes.

Change-Id: I591b17fd5289831e701b683f8fb47816efd1fa67
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-04 12:28:38 +00:00
Thomas Hartmann
2831f601fa QmlDesigner: Use OpenGL 4.1 surface for puppet
Change-Id: I520adbb54fc264e738ca5eb630f5cc7bc80ee4bd
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-06-12 13:48:56 +00:00
hjk
92a52a7181 Use Qt's QFileInfoList instead of QList<QFileInfo>
Helps to adapt to potential upstream changes in Qt 6

Change-Id: Ie154bd4fd513d46cb0493758be8943fc4581d71c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-05-28 07:19:45 +00:00
Orgad Shaneh
1e138fbe10 Remove excess blank lines after namespace
Change-Id: I4e4f83017f2bfc2cf842c4c971ed4b05e0447e6a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-27 06:50:16 +00:00
Thomas Hartmann
f8202239d6 QmlProject: Implement basic support for QmlFileSelector
This patch adds support for QmlFileSelector for
QmlProject and Qt Quick Designer.

Task-number: QDS-590
Change-Id: I0cc043d3ec9578008ec879b36fe834b70fb8c5ad
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-04-25 13:55:29 +00:00
Thomas Hartmann
4c746531d8 QmlDesigner: Add support for Dialog
Change-Id: I8a2972f80ae79835018870eda7b11a817353bf94
Task-numbner: QTCREATORBUG-22120
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-03-20 12:09:24 +00:00
Eike Ziller
eeaa02bc27 Merge remote-tracking branch 'origin/4.8' into 4.9
Conflicts:
	src/plugins/android/androidbuildapkstep.cpp

Change-Id: Id6dfda480c23706089ab38aa6277cd37599b5167
2019-02-28 12:39:09 +01:00
Thomas Hartmann
0f6e5a56cb QmlDesigner: Avoid puppet crash
If the property is invalid the propertyTypeName is a nullptr.
Calling strcmp on nullptr is undefined and can result in a nullptr access.

Change-Id: I270091fa1d2635019ad2e41c4a5eab9985227dcf
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-02-15 06:50:14 +00:00
Thomas Hartmann
d4726589f1 QmlDesigner: Fix error for Connections
Connections is actually in QtQml.

Change-Id: I88d33e273efa542535ef7f87a4020c23f172b15e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-02-05 17:05:57 +00:00
Thomas Hartmann
80a92d55d3 QmlDesigner: Fix gradients in Qt 5.12.1
In Qt 5.12.1 gradient is a QJSValue.
See commit 1771d298f33543a3fe47decfe0fff10609b01ab1
This patch adds QJSValue support.

Change-Id: I1c37b82bf033c38646564d5453e297258dd4b056
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-01-25 14:56:08 +00:00
Robert Loehning
4032f6383a Fix frequent typo
can not -> cannot

Change-Id: Ie872ada1bc9b4ed64bffb667c2e44dbb13b4ad11
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-10-23 09:30:20 +00:00