Commit Graph

1029 Commits

Author SHA1 Message Date
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
Eike Ziller
d02afbe6b4 Merge remote-tracking branch 'origin/4.14'
Conflicts:
	src/plugins/projectexplorer/gcctoolchain.cpp

Change-Id: I2136ba89d3aa3c4c2a0e7a4f9d8ba9cec32924ce
2020-11-30 16:14:32 +01: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
Eike Ziller
8245523653 Merge remote-tracking branch 'origin/4.14'
Conflicts:
	src/plugins/designer/cpp/formclasswizard.h
	src/plugins/designer/cpp/formclasswizarddialog.h

Change-Id: I9f9d166e1a9249022305503f9cbe571136c2a2b1
2020-11-25 11:25:34 +01: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
Eike Ziller
5ca70bdcb3 Merge remote-tracking branch 'origin/4.14'
Change-Id: Iea84f23cf394de13e99a9ed777c8c113e4eff473
2020-11-19 15:38:13 +01:00
Marco Bubke
9b6944086b MultiLanguage: Add image generation for excel export
Change-Id: Ied15381d94c391c86438c66fe88f755421bb3492
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-19 13:22:44 +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
Alessandro Portale
30aec82285 Add missing "final" to unexported/unshared classes
Change-Id: I84d5fc39d7ef5588a20545854d0cfd0b993db090
Reviewed-by: hjk <hjk@qt.io>
2020-11-18 15:40:29 +00:00
Miikka Heikkinen
12f7df6a85 QmlPuppet: Remove effect preview support
The issue in QtQuick3D blocking effect previews (QTBUG-86616) is not
going to be fixed in Qt 5 anymore, and Effect was moved to QtQuick3D
from QtQuick3D.Effects in Qt 6, so this can't be written in Qt 5 and
Qt 6 compatible manner anyway. Removed the support for now as it needs
to be implemented differently if we want to enable effect previews in
the future.

Change-Id: Ic786608572c3350e22dab75366cb93586c29459a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-17 15:49:13 +00:00
Jarek Kobus
ad2d635a09 Get rid of deprecation warning when compiling against Qt 5.15
In Qt 5.15 the comparison operator for QVariant got deprecated.
Fix the warning by substituting comparison operator by custom
method.

Change-Id: I1a5c4ab6742a6d8d85f6cff5a73d5f49c2d5aa73
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-17 11:39:56 +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
Thomas Hartmann
0de8aab7ae QmlDesigner: Add missing stream read
Change-Id: I5a93a6ef37b9f0608e82b2b9d4453f792b813da1
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2020-11-16 16:03:41 +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
Thomas Hartmann
28022d8e04 QmlDesigner: Remove Quick3D dependencies from ModelNode2DImageView.qml
Change-Id: Idf19019dbeebf8f3f09309a724727a4aa643ce25
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2020-10-23 10:58:58 +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
hjk
41a51a63f5 ClangCodeModel, Puppet, CrashHandler: Compile with Qt6
Task-number: QTCREATORBUG-24098
Change-Id: Ic65e7a5dce0a512f48fb70915b9443ef7df2b787
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-10-08 11:16:09 +00:00
Thomas Hartmann
a53238e91c QmlDesigner.qml2puppet: Fix build with Qt6
Change-Id: If02714c44946d0a87a28c2ed505f860a593aef79
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2020-10-05 13:49:46 +00:00
Thomas Hartmann
469e7a7edf QmlDesigner.qml2puppet: Fix build with Qt6
Change-Id: Ib9580fa1b6c1699e830898234b286f3ee999d477
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2020-10-05 13:49:24 +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
Cristian Adam
b9445d5627 Clang 10 build fix
Qt Creator 4.13's code model and Clang 10 compiler complain like:

error: constexpr variable 'LocalSocketErrorFunction' must be initialized
by a constant expression

Change-Id: I9c0160823f9f3708253ebea398caae680eacab11
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-09-10 15:54:30 +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