Refactored the existing 3D node preview generation to be done
synchronously, which enables their use also for creating state
and item library previews for 3D nodes with ease.
Fixes: QDS-5785
Change-Id: Ib493eccbc239f33bcad3301673a865494616a901
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
- Fixed state preview rendering by deparenting nodes under
component wraps.
- Ensure state preview image is always clipped to root item.
The state preview bounding box broke when Repeater was direct
child of root and had delegate with rotation.
- Allow dragging items under Repeater to create implicit component.
- Allow dragging Components under Repeater.
- Do not ask for target property when Component is dragged under
any node.
- Update nodeSource properly when reparenting implicit component
or removing last child of a Component item.
- Fixed scene update when last child of a repeater is deleted/moved.
Fixes: QDS-5197
Change-Id: Iaaf1745e25db3522ffc1dba7fd1b051da29f5aec
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
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>
Added lock feature support for 3D editor. Also refactored the hide
support, since the two use largely similar logic.
Task-number: QDS-2915
Change-Id: I627848f3a3a73881427a03aeec6793fd26a1885a
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
When building with Qt 6 or if qmlpuppet_unifiedRenderPath is set
in the environment we switch to a different render path.
In this case we use QQuickWindow::grabWindow() and render the root item.
No composition is done in the Qt Creator process anymore.
This is a similar approach we already take for the 3D view.
Performance is acceptable and we fix rendering issues related to
effects and layers.
Change-Id: Ic963eca047e0bf16ca3a099ec94658ae2af0fb63
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
For each created items we retrieve a list of the names
of all existing states.
Task-number: QDS-1978
Change-Id: I8e85e439fce3c6204cb8bcf69f6be847cc8dae5c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
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>
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>
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>
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>
In some cases items render their children directly using an effect.
In this case we do not want to hide the children when calling
refFromEffectItem().
If the hint takesOverRenderingOfChildren is set in the .metainfo hints
for a parent item we forward a flag to the puppet and refFromEffectItem()
is not hiding this item,
Change-Id: I37a8c0ad8a15bc914c220e03b1b744779431d655
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
We fallback to create types from source, if other means failed.
This can be required if the meta info is incomplete/incorrect when
a C++ type is mocked.
Change-Id: I50d45a6f9d7eba3483da10d9e1d7d6644d9aeb96
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
A simplified version of NodeInstanceSignalSpy is required to track
sub objects. I moved all private API usage to QmlPrivateGate.
Change-Id: I86e3e5411eb43777a6b1ab5018a1b8fb9088c666
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This class holds the additional data we use to annotate QObject.
At the moment we store the default values and bindings there.
I also moved the code to populate and read the hashes
into that class.
Change-Id: Ib5e4b5291cfd2bf5555a896bf42578d07f2c6253
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reduce the use of NodeInstanceMetaObject in QtQuickDesigner code
to two static methods:
- registerNodeInstanceMetaObject
- createNewDynamicProperty
Change-Id: I0ef8ee96995184e968467b799147c6b4c80fbccc
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
There is no easy way to convert an enum (e.g. Qt.Vertical) to the
integer value without the meta object/QMetaEnum.
For this reason we evluate the enum as an expression
if the target property is int.
Without this patch enums do not work at all for properties defined as int.
Change-Id: I9363a84eef1bf4a3ed2c40b35f7439e249e9bd98
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
We reparented into ignored properties. Now there is a more general mechanism
to prevent this.
Task-number: QTCREATORBUG-11970
Change-Id: Icbd5877dc13c65963079eb3ab67e48bb92056b53
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
Composites types need their own code path.
Change-Id: Ia1b14bf4f8519f786c08b94f168ec369d79defc0
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
We excluded item which had a node instance. For the preview all item should
be marked dirty.
Change-Id: I0cbad89707d7d94f65ac0d055488e124da40e7b3
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
There is no stand content item interface, so try to work around to enable
snapping and anchoring.
Change-Id: Ib2eaf0d6c35e3ba289dd7d55b2ba4c064ad40748
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
We don't tested that target anchor object are node instances. Now we
search for the parent object recursively.
Change-Id: I2e03e714f858a285309b02f5e88c757f0dcfe7e5
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This is fixing some anchor movement bugs.
This reverts commit ae409f8bdf.
Change-Id: Ibe9b8b2601e2bcd1c249b5feda06fb3a29482f4b
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>