Smooth rendering turns on MSAA and doubles the resolution for
rendered items. With this option enabled everything stays smooth when
zooming in. Around factor 8-10 pixels become clearly visible again, but
it still looks relatively smooth.
I added both MSAA and increased the resolution to one option, for simplicity.
The smooth mode takes 4 times the shared memory, which should not
be an issue in most cases.
For now, the option is not the default.
Task-number: QDS-7129
Task-number: QDS-7128
Change-Id: I8a778650bb40f8ba796960db9bc966e8a1efff4e
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
If the root node is a 3D node we show a preview similar to
the state preview in the form editor. The size of the preview
is hard coded as (640, 480).
Change-Id: If7f96522b093c17422fa38102bffe11ede016063
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Nanotrace headers are not exported to build dir at all if the feature
is disabled, so runtime puppet build can't find them. We have to
ifdef out the header include and define the required macros as empty
in puppet.
Fixes: QDS-6107
Change-Id: I702c3ed5521d30ee0b253d035dea4ea00d00848f
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Minitrace is a library to produce json traces suitable for chromes
built-in trace viewer. Unfortunately it lacks the ability to add
custom arguments to the json files which is needed in our case
in order to examine Design Studios state from within the evaluating
python script. Nanotrace is a rewrite of minitrace that adds this
ability. Additional benefits are higher precision and the fact that
it is written in c++.
Change-Id: Id2610b93188483d88547369c3fa8dacbe4dee9f7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
If an effect uses transparent border int paints outside of the item.
Without this patch the item is only rendered inside the bounds of the item.
This patch always adds 40px to the bounding rectangle if an effect is
detected. This is done by effectAdjustedBoundingRect().
The 40px should be sufficient for every realistic case.
Task-number: QDS-3576
Change-Id: I82af0ea66c79039dcae92a88a5954b49de6d944f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Add a way to edit and view particles visually, as editing
only the properties in property editor does not help visualize
how the particle effect is going to look. Support toggling the
effects on/off, pausing, resuming, and scrubbing the time back
and forth. Only the selected particle system is animated to allow
concentrating on that particular system without being confused
by other possible particle systems.
Fixes: QDS-4623
Change-Id: I2677c56a73279d451d77df1d131bd7294e6b23bb
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Any time repeater properties change, the repeater parent should be
dirtied to ensure it rerenders. Often the rerender is triggered
incidentally due to other triggers, but e.g. in case model value is
changed to zero, or if model property is removed, no other trigger
causes rerender.
Also moved the repeater parent checks into QuickItemNodeInstance
to avoid polluting Qt5NodeInstanceServer with such stuff.
Fixes: QDS-5233
Change-Id: Idd89e23c5ad022d26f443d665dac81dc2cbb0b28
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
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>
Resizing the window doesn't actually trigger rerendering of the
root item image in single item rendering, so we ensure that happens
by making root item size dirty.
Fixes: QDS-4957
Change-Id: I08750c855458cc309a2683e56557c42dc7c49274
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Rendering effects requires actually rendering another item.
The effect is defined by another item that is rendered instead
of the original item.
For items that have an effect we do not render the children, since
the effect is only applied to the layer not the individual items.
We set layer.enabled temporarily to false, this ensures the effect
is not rendered as part of its parent item.
To detect the effect we use the source property an check if it points
to the ShaderEffectSource.
If one of the children inside the effect is transformed we have
to update the effect item.
If layer.enabled or layer.effect is changed we set the dirty flag
on the item and all children.
Change-Id: Iff61ef950e62a7a598b4bfa181ea70cb144368f3
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
We have to render an item inside the bounding rect, because if
it is a component there might be child items outside its actual size.
The way we calculate the bounding rectangle excludes children
on the document level. We take clipping into account when calculating
the bounding rect.
When rendering the effect we do not have the instance. Therefore
we fall back to the standard bounding rectangle.
Change-Id: I7cd09d08d461d28c49a91fb891a5487185df0245
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Change the form editor rendering to be done by item basis instead of
just rendering the entire scene (unified rendering).
Fixes: QDS-2933
Change-Id: I999cbc834791bc6e96334eab8273d97e4f58975f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
There is no need to read back the texture into image when rendering
2D content for embedding into 3D scene, so don't do that.
Change-Id: If84619bdc20e6997733effc4745a496fab69e5b8
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
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>
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>
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>
m_quickView in Qt5NodeInstanceServer::initializeView()
is instantiated with setProfile(QSurfaceFormat::CoreProfile)
However QGfxShaderBuilder::QGfxShaderBuilder() initiates and
generate the gaussian blur shader code with referring default format.
that doesn't set the profile to QSurfaceFormat::CoreProfile.
The correct resolution is to get profile with accessing current window.
But QGfxShaderBuilder is not QQuickItem so it doesn't have any way to
access current window.
As qmlscene does, it could be a nice solution to keep the current
surface format as default when instantiating QQuickView.
Fixes: QDS-1864
Change-Id: I0fcf80effccebf7cfe8e58c071cf121b6af5bdbd
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Edit3D view is now a tab alongside Form Editor.
Buttons were moved to a Creator side task bar on Edit 3D view.
Change-Id: Ia06107e4f855ba512ffea3e628a61558894e800e
Fixes: QDS-1570
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
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>
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>
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>
This allows Qt Quick Designer to register a component that can serve
as a mockup for known C++ components registered in e.g. main.cpp.
In many cases those components are the interface to the C++ backend.
While the C++ components itself are not relevant for the gui designer,
the user has to be able to instantiate gui components that use such C++
components.
We use the CreateSceneCommand to forward a list of C++ types to
qml2puppet.
Those types are then registered so that the imports and object institation
works.
Change-Id: I1543912f233f9a783998f3c6a1b48981b342ee80
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
- it has the same life cycle like the Qt5NodeInstanceServer
- we don't need to create and delete it (with maybe memory leaks)
- this fixes a crash while the puppet is closed after an item deletion
Change-Id: Iecd6515eb41324b95e99e151d77ee74895230182
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>