Commit Graph

610 Commits

Author SHA1 Message Date
Thomas Hartmann
d6e50e77cc QmlDesigner: Use boundingRect() instead of contentItemBoundingRect
The contentItemBoundingRect is typically null, unless there is a content
item.

Change-Id: Ic32deac3c2506ff05feb28399b1ccaedacb5f68f
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-01-26 10:48:47 +00:00
Björn Schäpers
ec0135f517 qml2puppet: Fix build with MinGW
Which was broken in 5daee38e.

Change-Id: Ic43ed4528cb5e2c831e07b17a2ee118583b54526
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-12-14 19:42:10 +00:00
Miikka Heikkinen
217d0e5832 QmlPuppet: Fix crash in Qt6 when root item is zero size
Change-Id: I45dc10a412a7e4cfb799afb47e70e506162b286a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2020-12-11 10:50:11 +00:00
Thomas Hartmann
5daee38ee3 QmlDesigner: Add compiler flag required to build Qt 6
Change-Id: I47defc9b8d4509f1a1aa367349c9b8268d876518
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-12-09 13:51:57 +00:00
Christian Kandeler
4f45319e80 QmlDesigner: Fix warnings
Change-Id: I818bd2d6a7512609ee7f7c1345ba314ab304850d
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-30 16:37:13 +00:00
Miikka Heikkinen
a1e9e6b70b QmlPuppet: Fix preview tooltip image creation for material components
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>
2020-11-30 15:57:29 +00:00
Miikka Heikkinen
d3412cfcdc Add optional fps counter to 3D edit view
Currently it is enabled via #define FPS_COUNTER in
qt5informationnodeinstanceserver.cpp

Change-Id: If9af313232fc91fca674a43c7ca70b04db7e59f7
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2020-11-27 14:24:40 +00:00
Miikka Heikkinen
dd279759dd QmlPuppet: Use QQuickRenderControl to render 2D views
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>
2020-11-27 12:28:57 +00:00
Miikka Heikkinen
ae15780f84 QmlPuppet: Hide 3D edit view render window
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>
2020-11-27 12:11:28 +00:00
Thomas Hartmann
4c4a25d08e QmlDesigner: To not render huge items
Rendering large items takes too much memory.

Change-Id: I19084d707989e846fc446e24da228bc73c024013
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-11-24 19:48:07 +00:00
Christian Kandeler
7aec256087 QmlDesigner & friends: Fix various new warnings
Change-Id: Ia5e3d47e70e1881e70652f090ccc61543535df4e
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-18 17:05:51 +00:00
Jarek Kobus
df9d1414b8 Don't cast QHoverEvent into QMouseEvent
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>
2020-11-17 08:42:57 +00:00
Jarek Kobus
37ccef9a0f Silence warnings about unused arguments
Silence warnings when QUICK3D_MODULE is not defined.

Change-Id: I4974ce04e2d6185764d91767461e038eac59d90a
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2020-11-13 09:14:01 +00:00
Thomas Hartmann
98c735be6e QmlDesigner: Fix for high dpi and Qt 6
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>
2020-11-12 15:15:48 +00:00
Thomas Hartmann
3d767fcfe1 QmlDesigner: Hide windows again
Change-Id: I0b22a8bbaabaf2290aa134aebd0044fd81bb5e56
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2020-11-12 15:09:31 +00:00
Miikka Heikkinen
767db9a92b QmlPuppet: Disable navigator preview image creation in Qt6
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>
2020-11-12 13:53:07 +00:00
Marco Bubke
2a2dfbec73 QmlDesigner: Add states to ImageCache
Task-number: QDS-2998
Change-Id: I8e65881181ae1010ef1f8bab92fa71d92c961bcd
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-10 14:35:12 +00:00
Miikka Heikkinen
50405d7153 QmlDesigner: Fix 3D material preview when QtQuick3D is not imported
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>
2020-11-06 09:21:33 +00:00
Henning Gruendl
f2883c19b1 QmlDesigner: Add lock feature support to 3D editor
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>
2020-11-06 09:19:05 +00:00
Jarek Kobus
c0408ed52e Compile fixes with Qt 6
Change-Id: Ia5335bef6aeaff3ce12339db52d96793ff588824
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-05 08:14:55 +00:00
Miikka Heikkinen
6b8d8e414a QmlDesigner: Port 3D edit view to Qt6
Task-number: QDS-2899
Change-Id: Iedbe5e8561e5ab71ef32922e69da43cd3cc57e90
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-10-20 14:55:43 +00:00
Marco Bubke
d1b0c12d6b QmlDesigner: Add image cache
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>
2020-10-16 10:01:21 +00:00
Marco Bubke
3e9e768b35 QmlDesigner: Bump the C++ version to 17 for the qml puppet too
Task-number: QTCREATORBUG-24684
Change-Id: I2502593d45f93b36162a4009cca238a83da2dc53
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-10-14 16:59:20 +00:00
Miikka Heikkinen
47714c38c6 QmlDesigner: Return placeholder preview image for non-visual components
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>
2020-10-12 07:33:56 +00:00
Thomas Hartmann
29c833d54f QmlDesigner: Implement different render path for Qt 6
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>
2020-10-09 15:13:39 +00:00
Miikka Heikkinen
a3e92da8b8 QmlPuppet: Force QApplication use in puppet if charts is imported
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>
2020-09-29 14:00:56 +00:00
Miikka Heikkinen
8d6ee2509d QmlDesigner: Show tooltip preview image for Textures with sourceItem
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>
2020-09-29 09:58:21 +00:00
Miikka Heikkinen
36a8b8ad99 QmlDesigner: Add navigator tooltip for 2D components
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>
2020-09-29 09:58:04 +00:00
Miikka Heikkinen
fbc6e3196c QmlPuppet: Update 3D edit view on property removal
Change-Id: I9cdcc7a4a1515b6046bc2c7c78de196a2c7d8c22
Fixes: QDS-2840
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2020-09-29 08:17:42 +00:00
Christian Stenger
834cb8d114 QmlDesigner: Fix compile when building without Quick3D
Amends 31ec38dba5.

Change-Id: I33156223023b4077581375b9f28cc5633dfdcfdb
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2020-09-23 06:30:56 +00:00
Miikka Heikkinen
31ec38dba5 QmlDesigner: Add navigator tooltip for 3D Components with Node root
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>
2020-09-22 13:35:20 +00:00
Miikka Heikkinen
762addfbd0 QmlDesigner: Add navigator tooltip for 3D Model nodes
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>
2020-09-22 13:35:10 +00:00
Eike Ziller
5ad724c61b Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	src/plugins/qmakeprojectmanager/qmakeproject.cpp

Change-Id: Ieb1c3e946f11d3c4fa1ee6b5afdf83cc532d8aed
2020-09-17 10:28:19 +02:00
Miikka Heikkinen
90d9cb36f3 QmlDesigner: Add navigator preview tooltip for materials
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>
2020-09-16 07:00:06 +00:00
Michael Winkelmann
64a37ec38a QmlPuppet: Return color property
Change-Id: Icc25fb0408aae50f67633688f221194ab6f77cd3
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-09-14 13:45:15 +00:00
Eike Ziller
20f51bc642 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	src/plugins/languageclient/languageclientcompletionassist.cpp

Change-Id: If12e1c532e5623ef063681309a918e7b51117b1c
2020-09-14 10:12:14 +02:00
Marco Bubke
0f9010d381 QmlDesigner: Introduce multiple node instance server
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>
2020-09-11 08:57:42 +00:00
Orgad Shaneh
e504d96934 Merge remote-tracking branch 'origin/4.13' into master
Change-Id: I8a2dca29595a0770f4162786b15a145f3f4133af
2020-09-04 16:11:12 +03:00
Miikka Heikkinen
5cc7dae965 QmlPuppet: Improve gizmo precision
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>
2020-09-04 11:58:04 +00:00
Eike Ziller
3b76714290 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ListViewSpecifics.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/MouseAreaSpecifics.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RowSpecifics.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableSection.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml

Change-Id: Ie5deacd39ae4f3c0966e7cb41a8fd832dcefbb09
2020-09-03 12:18:02 +02:00
Miikka Heikkinen
893d5901a6 QmlPuppet: Fall back to primitive creation if component creation fails
This ensures components defined in .qml files get loaded properly.

Change-Id: I070132ab5ad58b2531f27f623f218e0ee3565c5b
Fixes: QDS-2697
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-09-01 13:47:53 +00:00
Eike Ziller
2a05186194 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	CMakeLists.txt

Change-Id: I799060da2cb299bb0c49a3da3530fad18427a23c
2020-08-21 10:08:55 +02:00
Michael Winkelmann
44a3c092a0 QmlPuppet: Refactor ChangeIdsCommand
Change-Id: I75de863121b66a5050226dd5c8914229cb1af608
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-08-20 09:33:30 +00:00
Michael Winkelmann
d39a6f656f QmlPuppet: Refactor ChangeFileUrlCommand
Change-Id: I900f530109b6cdbb22d8138094443b48834d16cb
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-08-20 09:33:13 +00:00
Michael Winkelmann
95aa7f42de QmlPuppet: Refactor ChangeBindingsCommand
Change-Id: Id3020a73f59a1adfd25066a37d083d923e77956b
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-08-20 09:33:04 +00:00
Michael Winkelmann
888cbe7f8a QmlPuppet: Refactor ChangeAuxiliaryCommand
Change-Id: I32eb04db96322883aa908e22724756f5e25ded09
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-08-18 13:25:59 +00:00
Marco Bubke
fcabab7b5f QmlDesigner: Extend captured data
Change-Id: I780815e6f42be4f3aceb1d784a685cc330572832
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-08-17 14:45:22 +00:00
Eike Ziller
0c4135e380 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	src/plugins/android/androiddeployqtstep.cpp

Change-Id: Id624bad384050d567efba0700046331086cb12dd
2020-08-13 13:28:33 +02:00
Tim Jenssen
4fe5b923cd Merge remote-tracking branch 'origin/qds-1.59' into 4.13
Change-Id: Ic720f3adab305c5ef8cd10e713ccabf510eff0c0
2020-08-13 06:39:40 +00:00
Marco Bubke
dc870f538d Prepare merge of qds-1.59 to 4.13
It is not compiling but we are closing this branch anyway.

Change-Id: If96318175d92ae492871d668d5c937c473fd05d5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-08-13 06:24:10 +00:00