Commit Graph

68 Commits

Author SHA1 Message Date
Thomas Hartmann
30827fe401 QmlDesigner: Implement visibility for unified render path
If the item is set to invisible we set visible to false in
the render and preview puppets. This will have no effect on the
value in the property editor.

Changing the actual value of visible can have side-effects on
the rendering in some rare cases.

Task-number: QDS-4932
Change-Id: I5ce0925ebff8f5e4e64bc71fd5d33d6154b85f91
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2021-08-26 14:18:37 +00:00
Miikka Heikkinen
8aad2c803a QmdDesigner: Enable rendering single items again for render puppet
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>
2021-08-25 15:38:17 +00:00
Miikka Heikkinen
bab69fff77 QmlPuppet: Fix crash at puppet reset
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>
2021-01-05 09:28:45 +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
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
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
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
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
60ff6b6577 QmlDesigner: Improve usage of QML items as quick3d textures
Quick3D Texture elements require some window signals to show QML item
as texture, so we fake them to make textures appear in form editor
and state preview. To prevent texture mirroring, flipV value
is force set at proxy creation. To keep state preview up to date,
we trigger multiple render passes if there are any QML items used
as texture sources in quick3D textures.

Task-number: QDS-2290
Change-Id: I16c34aad943213c0b737fdb073333be3bbd40f2d
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2020-06-25 08:07:41 +00:00
Thomas Hartmann
3caafb2b81 QmlDesigner: Inspect components for existing states
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>
2020-04-21 10:57:26 +00:00
Thomas Hartmann
74ffff63eb QmlDesigner: Allow setting state property
This has to be blocked only for the root item.

Task-number: QDS-1979
Change-Id: Ia05255468623fe715e3f7172e2f058a70629b783
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-04-21 09:43:11 +00:00
hjk
2e14df7561 Some clang-tidy -use-modernize-nullptr
Change-Id: I1bed5e85a5b7948d08502a72a10f80baa075c204
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-08-01 13:20:26 +00:00
Thomas Hartmann
7bff611ee1 QmlDesigner: Call all Component complete handlers
We have to ensure to properly call all Component complete handlers.
A single component usually has QQmlComponentAttached objects,
which we have to iterate over.

Therefore emitComponentCompleteSignalForAttachedProperty() is not correct.

Task-number: QDS-269
Change-Id: I4aed5d511f9f6e21f72efb955fc6db21b70e7c42
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-10-18 14:41:57 +00:00
Alessandro Portale
9e221f6ff7 QmlDesigner: Improve the quality of state thumbnails
The ImageProvider needs a correct sourceSize. And the puppet needs to
consider the devicePixelRatio.

Change-Id: I408f956fdb4adb23f272c879878e44e88ca76321
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-09-13 07:08:09 +00:00
Thomas Hartmann
906d2ac9b5 QmlDesigner: Read contentItem after completing
This avoids issues with deferred properties.

Change-Id: Ie9cc0eaa3468bcb21e4817f8c5e3c1b97c8fc99c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-04-05 09:20:31 +00:00
Thomas Hartmann
8a8b8c4602 QmlDesigner: Add meta hint if item renders children directly
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>
2018-03-09 15:05:22 +00:00
Tim Jenssen
a991ecec95 QmlDesigner: use initilizer_lists for pairs
Change-Id: I3a1ef67d8af255604494695807331576540b8afa
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-04-28 08:58:19 +00:00
Thomas Hartmann
4ca71590db QmlDesigner: Fix warning
Change-Id: Iff2c50439521e602bd2703716590a3e95c8ab2b1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-23 17:00:42 +00:00
Thomas Hartmann
fdb40645a4 QmlDesigner: Unite the bounding rectangle with actual size
This is required to correctly render text elements with padding,
since the bounding rect seems incorrect.

Change-Id: Ifcef2607089a7a2cec071814d5d87bd27da7ace3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-17 13:02:54 +00:00
Thomas Hartmann
bf3008292f QmlDesigner: Add support for high dpi to form editor and puppet
We forward the device pixel ratio to the qml2puppet and
render items in higher resolutions.
We have to set the device pixel ratio on the pixmap manually,
since it is not serialized.
The option IgnoreDevicePixelRaio allows disabling high dpi awareness.
Rendering in high dpi affects performance, but since we
use shared memory this does not seem to be a serious issue.

Change-Id: Ie9219b8fdb37841c24d4fb3f0ca259f0194ef65c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-13 12:04:18 +00:00
Tim Jenssen
0ca288f518 QmlDesigner: fix a crash when there are missing imports
Task-number: QTCREATORBUG-16963
Change-Id: I0d4c2e018b4849b2a32cd77da8c2f979fd3befb3
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-10-05 14:14:11 +00:00
Tim Jenssen
5a11d5cd5b QmlDesigner: use initializer lists
Change-Id: Ie93861c7d8a5b2863ec8b111afceacc2c163715b
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-06-22 13:16:33 +00:00
Tim Jenssen
bc08c10764 QmlDesigner: do no refresh if there is no parent
Change-Id: I2299437ea97e884f4b7734129eec8246c87208ab
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-04-29 08:06:40 +00:00
hjk
49735ee5ee QmlPuppet: Make compile without QT_RESTRICTED_CAST_FROM_ASCII removed
Change-Id: I535efad65b2224337c133463da075953cc878c6c
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-03-18 14:17:04 +00:00
Thomas Hartmann
c7a6221e6e QmlDesigner: Evaluate properties for the root item in dummy context
We evaluate properties for the root item in dummy context if
they contain "parent.".

Defining a parent in the dummy context was not working for QML 2,
because there seems to be a shortcut bypassing the metasystem for parent.

Task-number: QTCREATORBUG-15530
Change-Id: I710f1ef36b8c97cc481b9909a775f06d9e03f666
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-10 11:30:05 +00:00
Tobias Hunger
38cce7eb83 Update License according to agreement with Free Qt Foundation
* Update all files in share folder

Change-Id: I8a82c3eb2eb614d4339dd4c4e690f54b5f29d813
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2016-01-19 16:05:29 +00:00
Thomas Hartmann
17e5cd7085 QmlDesigner: Fix crash in qml2puppet
We should not call updateDirtyNode() for items without a window.
This will assert later in consistency checks.

Change-Id: Iff3574123a1497206de88d59fcf630ead57ef593
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-01-19 12:04:44 +00:00
Alessandro Portale
374f84acc7 Qt Quick Designer: License change to Qt Commercial + GPLv3
Change-Id: I7f7aecd02892b6c616cd148fa5d845e7bc0d3b4f
Reviewed-by: Tuukka Turunen <tuukka.turunen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2015-09-18 12:12:57 +00:00
Thomas Hartmann
f86eb9b78c QmlPuppet: Move functions from QuickItemNodeInstance to QmlPrivateGate
No need to use private API in QuickItemNodeInstance.

Change-Id: I5450ea41571c2787081cc88f59494a28eea5546c
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2015-05-20 14:02:05 +00:00
Tim Jenssen
3c9efc3e72 refactor NodeInstanceMetaObject
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>
2015-05-18 13:27:03 +00:00
Eike Ziller
3c85058694 Update License
Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2015-01-16 12:37:56 +01:00
Thomas Hartmann
e28fa8406c QmlDesigner.instances: Always use distance field text rendering
This avoids sub pixel antialias artefacts.

We call disableNativeTextRendering() in updateDirtyNodesRecursive(), because
items might be created or change the property after component complete.

Change-Id: Icd9c87b69434a910c9555540ba7bafdc874afc5a
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2014-11-19 12:03:08 +01:00
Eike Ziller
8295b503be License update
Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-10-09 11:41:44 +02:00
Marco Bubke
0ee609f8fc QmlDesigner: Fix reset width and height
Task-number: QTBUG-38426
Change-Id: I28e9ed70042c118ff65801c4d07e5a67dc7c3db1
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2014-07-30 12:34:58 +02:00
Tim Jenssen
9898ac50e1 QmlDesigner: fix that an invalid root item refreshes the preview
Change-Id: I8d917dfd92261a88472bd49577731f5bcf468d49
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2014-07-22 11:27:35 +02:00
Marco Bubke
9cee5d3b22 QmlDesigner: Fix implicitHeight in resetVertical
Task-number: QTCREATORBUG-11542
Change-Id: Ia69a95abe42ad0c10b8d65663d252f15cf38cf02
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2014-07-01 09:33:36 +02:00
Marco Bubke
1526dd0aa6 QmlDesigner: Remove harmful updates
From the quick1 times we always have done a update but it is not any more
useful and it is triggering a repaint which makes the form editor sluggish.

Change-Id: I8103d03c295aa73e14b4b4fcec15b01069c62754
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2014-06-24 19:39:22 +02:00
Marco Bubke
a980ea98bb QmlDesigner: Add a special root item of the view too
Change-Id: Ie7cc58d3793717fce979ccd554060b91bc0d7040
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2014-06-24 18:49:55 +02:00
Marco Bubke
854a0f25a1 QmlDesigner: Fix recursive all item function
Change-Id: I074201639a9fcac40d9c3ca4bb50be46edb88957
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2014-06-18 13:30:00 +02:00
Marco Bubke
e9096120ad QmlDesigner: Fix ignored properties for reparenting
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>
2014-04-17 18:02:28 +02:00
Marco Bubke
37b1dc871f QmlDesigner: Merge GraphicalNodeInstance back in QuickItemNodeInstance
Change-Id: I2f5412887a66186d215e56101a63bacfda4f8e0a
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2014-04-17 18:02:06 +02:00
Marco Bubke
9818f714f4 QmlDesigner: Use the root NodeInstance for item collection
Change-Id: I0ed67997c371af8acb3db480446ea5d577380804
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2014-04-17 18:01:02 +02:00
Robert Loehning
746c5d8863 Incremented year in copyright info
Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-01-08 08:29:47 +01:00
Marco Bubke
bd9cf4bc87 QmlDesigner: Don't move items in a layout
Change-Id: I9050b11d50d39726e2a19cabb7709020738a5c95
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2013-09-11 12:40:36 +02:00
Nikolai Kosjar
69fc3cf03f Kill ";;" at end of statement
Change-Id: I177094f19978e07f85e42b34701d8f03cd26665e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-09-04 09:19:10 +02:00
Marco Bubke
04f29127a1 QmlDesigner: Fix transformation bug for tab widgets
Change-Id: Idc33ddf04f0b6fc317aeb5ed72fd7164ba174ab4
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2013-08-15 15:51:02 +02:00
Marco Bubke
b97422b710 QmlDesigner: Add container item support in node instances
Change-Id: I30e0d11346b8c63188d052b46656e7ede179e55d
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2013-05-30 14:11:57 +02:00
Marco Bubke
ff4457bb46 QmlDesigner: Prepare for other layout items
Change-Id: I831e68877eb3d785b4bbb99db002ab8e42158d75
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2013-04-22 17:03:37 +02:00