The contentItemBoundingRect is typically null, unless there is a content
item.
Change-Id: Ic32deac3c2506ff05feb28399b1ccaedacb5f68f
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
There is an unknown issue causing the first premade material from
QtQuick3D.Materials library encountered in the scene to fail to load
properly as a component. In scene creation this is worked around by
falling back on primitive creation, but the same issue prevents
loading the component for preview image generation purposes. Luckily,
materials can be shared freely between views, so we don't need to
actually load the component in this case. We can use the existing
material instance just like with non-component materials.
As a side effect, this change also fixes the issue where premade
custom material previews didn't reflect the changes in material
properties, like other materials do.
Change-Id: I7f1d6863fe96734a610d725f2f71e252f03a4428
Fixes: QDS-3114
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Currently it is enabled via #define FPS_COUNTER in
qt5informationnodeinstanceserver.cpp
Change-Id: If9af313232fc91fca674a43c7ca70b04db7e59f7
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Port QQuickRenderControl rendering used for 3D edit view also for
2D views.
This also fixes the issue of only partially rendered form editor
view for root items with non-origin position by adjusting the
position to 0,0 on the puppet side via an extra injected item.
As a result of the root item always being rendered at origin,
the visualization of the root item offset is no longer visible in
the form editor (the checkerboard background item).
Change-Id: Ide29510ef52513340d205ed35ac35c8cce66715c
Fixes: QDS-3159
Fixes: QDS-3175
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Rendering is now done using QRhi private API and QQuickRenderControl.
In addition, input event handling was changed to use sendEvent instead
of postEvent for our fake mouse events, as mouse event position
gets corrupted somehow if event is handled asynchronously when the
window is hidden.
Change-Id: Ia2466622cd4b60e3f73e0ad3e7e4da7c7c335451
Fixes: QDS-3125
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Such a cast rely on the fact that some internal data
of both classes must match. Qt doesn't guarantee it.
Change-Id: I5c29af98e320b72b599c059a2827eb2e7d3843da
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Silence warnings when QUICK3D_MODULE is not defined.
Change-Id: I4974ce04e2d6185764d91767461e038eac59d90a
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
When grabbing the window we have to clip the window using
the root item size.
Depending on the window manager the window is resized.
Another issue is that when grabbing the window offscreen
the pixel ratio is always 1.
Before we assumed that the pixel ratio of all images
is the same for the host process as for the puppet.
This is not necessarily anymore and we have to set
and forward the correct pixel ratio.
Change-Id: I36b467291ab120f825119adea4ed7db10d34266d
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This frequently crashes the puppet. Will be re-enabled once the
underlying issue QTBUG-88320 is fixed.
Task-number: QTBUG-88320
Change-Id: Ie4c1ad914e5bd62dcf3b132cea588ba6fc003bc5
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
3D material preview is not dependent on QtQuick3D import in the open
QML document, so we can enable it even when QtQuick3D is missing.
Change-Id: I5cb35ef403599704684ebe87c81cd949f828ad00
Fixes: QDS-2912
Reviewed-by: Mahmoud Badri <mahmoud.badri@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>
The image cache is saving images and icon of this images in a sqlite
database. If there are no images they are generated in the backgound.
The icons are fetched by item library.
Task-number: QDS-2782
Task-number: QDS-2783
Task-number: QDS-2858
Change-Id: I5a32cccfef7f8fd8eb78902605a09f5da18ce88e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Preview image is returned when a 2D item render results in a blank
image.
Also improved device pixel ratio handling. No longer always render
preview at 2x ratio, if not needed.
Change-Id: I67b7563dffea523ea85be23b6a0e8b802c0f03fb
Fixes: QDS-2893
Reviewed-by: Mahmoud Badri <mahmoud.badri@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>
Qt Charts requires QApplication, so force that on when QtCharts import
is detected.
Change-Id: Ie725cb0714f2816a34374e46de71b82f00ce6239
Fixes: QDS-2842
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
For non-component sourceItems, the preview shown is simply whatever
image has been stored for form editor for that item.
If the sourceItem is component, the preview image is the same as
sourceItem's preview image, as the form editor image for components
often includes unnecessary empty space.
Note that currently the image stored for form editor doesn't include
child items, so this is not a perfect solution. It is however in line
with what form editor shows for the texture.
Change-Id: I3c0c629ca5e7fa25dbcb390c53e3865e34d5e729
Fixes: QDS-2824
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This enables showing preview tooltip for 2D (Item based) components.
We render the component from scratch for this purpose instead of using
existing renders done for form editor to ensure preview doesn't
include any local changes to component.
Also cache tooltips as QPixmaps in NodeInstanceView instead of QImages
to avoid unnecessary image to pixmap conversions when using cached
data.
Change-Id: I3082c5c846f605a765a81408767266d1ff7a12d7
Fixes: QDS-2762
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This enables showing preview tooltip for all imported 3D models.
Also moved the preview image handling out of the model and into
NodeInstanceView, where it fits more naturally.
Change-Id: I48135d06aa8d9313525dae618e22692563da78fd
Fixes: QDS-2807
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Only the source and geometry properties of the model is taken from the
node, rest of the properties are always same for consistent style.
Change-Id: I2355ce91c3e3d6f23b9f27ecf31430e3e13d0c80
Fixes: QDS-2764
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Request 3D preview image for material instances from puppet
to show on tooltip.
Support for effect previews is also done, but handler for it is not
registered, as effects cannot be shared between windows due to
issue QTBUG-86616.
Also refactored the preview image support out of navigator
to make it more accessible by other components.
Change-Id: Ie08ba218f929660c2e43d39578997a5a1a883efd
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
For capturing data we need a atomic mechanism. So in one
process multiple node instance server can be started and
then a command is send back that a scene is created. It
can be used to ensure that captured data of views is
up to date.
Task-number: QDS-2630
Change-Id: Iea8d0b036b6384c9c1b0f91af401f2b1f1978c12
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
At high zoom levels, picking precision of the gizmos was not good,
because compounding inaccuracies from multiple floating point
operations required. Fixed by reimplementing many operations using
double precision math.
Change-Id: I013876b816379a20b552eb06d2f9cbb3f2aa2d21
Fixes: QDS-2676
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This ensures components defined in .qml files get loaded properly.
Change-Id: I070132ab5ad58b2531f27f623f218e0ee3565c5b
Fixes: QDS-2697
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
It is not compiling but we are closing this branch anyway.
Change-Id: If96318175d92ae492871d668d5c937c473fd05d5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>