aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QmlDesigner: QmlPuppet as standalone toolMarco Bubke2022-11-091-1058/+0
| | | | | | | | | | | | | The qmlpuppet is now a standalone tool. There is new a library too with the communication code. That is shared between the designer and the puppet. It's in a .cmake file so it can be included by the standalone tool if it is not part of a designer build. Task-number: QDS-5879 Change-Id: I2bc2a0b463fbb3e0c8c23d182abfd368cf87e968 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Merge remote-tracking branch 'origin/8.0' into 9.0Eike Ziller2022-09-271-1/+13
|\ | | | | | | | | | | | | | | Conflicts: src/plugins/qmldesigner/components/materialbrowser/materialbrowserview.cpp src/plugins/qmldesigner/designercore/imagecache/meshimagecachecollector.cpp Change-Id: I38f196e8f42cf11f7b613e7a723745600e35c5e9
| * QmlDesigner: Fix anchor targetsThomas Hartmann2022-09-231-1/+13
| | | | | | | | | | | | | | | | | | | | In some cases the binding for anchor targets is not properly resolved. Using explicitly the root context we define the ids in does solve the issue. Change-Id: I69e5bd237668719ec9417d30d0bac8635c79506a Reviewed-by: Henning Gründl <henning.gruendl@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Use SPDX license identifiersLucie Gérard2022-08-261-24/+2
| | | | | | | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | qmlpuppet: remove qmlprivategate DesignerSupport < Qt 5.6Tim Jenssen2022-07-121-23/+25
| | | | | | | | | | | | Task-number: QTCREATORBUG-26600 Change-Id: I629c8cd1f497ed2dd354ff461aa890a77bdc2a01 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* | QmlPuppet: Adapt to C++ 17 [[maybe_unused]]Marco Bubke2022-07-111-11/+5
|/ | | | | | | | It has the advantage to to move the attribute to the declaration instead of using a workaround. Change-Id: Ia6115ab8fefbe03f247edfea2b7bed73e9149068 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Add option for smooth rendering in form editorThomas Hartmann2022-06-101-2/+2
| | | | | | | | | | | | | | | | 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>
* QmlDesigner: Implement proper preview for pure 3D scenesMiikka Heikkinen2022-02-101-0/+5
| | | | | | | | | | | Refactored the existing 3D node preview generation to be done synchronously, which enables their use also for creating state and item library previews for 3D nodes with ease. Fixes: QDS-5785 Change-Id: Ib493eccbc239f33bcad3301673a865494616a901 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* Merge remote-tracking branch 'origin/6.0'Eike Ziller2021-12-011-0/+12
|\ | | | | | | Change-Id: I71b19dd8ecd96a7a2a58622f68283b8635264e48
| * QmlDesigner: Support transparent border for effectsThomas Hartmann2021-11-261-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/6.0'Eike Ziller2021-10-211-0/+37
|\| | | | | | | | | | | | | | | | | Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri Change-Id: If8baed5564470e550a0ba5c7720915217eec2412
| * QmlDesigner: Update repeater parent when repeater properties changeMiikka Heikkinen2021-10-111-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/6.0'Eike Ziller2021-10-081-0/+3
|\| | | | | | | Change-Id: I655155b35747082ac891a4b95e1680871d9b3234
| * QmlDesigner: Fix issues with Components and RepeatersMiikka Heikkinen2021-10-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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>
* | Do not reset the render-image size to (0,0) when reaching the size limitKnud Dollereder2021-10-041-3/+13
|/ | | | | | | | | | | | The size of the image to be rendered for the FormEditor is computed from the bounding box enclosing the items within the scene. There is a size limit, when reached the size was reset to (0,0) leading to an empty FormEditor image. This is now fixed by returning the bounding box of the root item in case this limit is reached. Change-Id: I58366610da2e90c34aea6117e225765ff4b3288b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlDesigner: Render effects on document levelThomas Hartmann2021-08-301-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* QmlDesigner: Render item inside the bounding rectThomas Hartmann2021-08-301-5/+38
| | | | | | | | | | | | | | 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>
* QmlDesigner: Implement visibility for unified render pathThomas Hartmann2021-08-261-0/+21
| | | | | | | | | | | | | 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>
* QmdDesigner: Enable rendering single items again for render puppetMiikka Heikkinen2021-08-251-4/+25
| | | | | | | | | | | 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>
* QmlPuppet: Fix crash at puppet resetMiikka Heikkinen2021-01-051-2/+9
| | | | | | | | | | | 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>
* QmlPuppet: Use QQuickRenderControl to render 2D viewsMiikka Heikkinen2020-11-271-15/+14
| | | | | | | | | | | | | | | | | | 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>
* QmlDesigner: To not render huge itemsThomas Hartmann2020-11-241-0/+2
| | | | | | | Rendering large items takes too much memory. Change-Id: I19084d707989e846fc446e24da228bc73c024013 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Fix for high dpi and Qt 6Thomas Hartmann2020-11-121-2/+5
| | | | | | | | | | | | | | | | | 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>
* QmlDesigner: Hide windows againThomas Hartmann2020-11-121-1/+2
| | | | | Change-Id: I0b22a8bbaabaf2290aa134aebd0044fd81bb5e56 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* QmlDesigner: Port 3D edit view to Qt6Miikka Heikkinen2020-10-201-20/+20
| | | | | | Task-number: QDS-2899 Change-Id: Iedbe5e8561e5ab71ef32922e69da43cd3cc57e90 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlDesigner: Add image cacheMarco Bubke2020-10-161-1/+4
| | | | | | | | | | | | 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>
* QmlDesigner: Implement different render path for Qt 6Thomas Hartmann2020-10-091-10/+69
| | | | | | | | | | | | | | 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>
* QmlDesigner: Improve usage of QML items as quick3d texturesMiikka Heikkinen2020-06-251-1/+15
| | | | | | | | | | | | | | 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>
* QmlDesigner: Inspect components for existing statesThomas Hartmann2020-04-211-0/+14
| | | | | | | | | 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>
* QmlDesigner: Allow setting state propertyThomas Hartmann2020-04-211-4/+4
| | | | | | | | 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>
* Some clang-tidy -use-modernize-nullptrhjk2019-08-011-3/+3
| | | | | Change-Id: I1bed5e85a5b7948d08502a72a10f80baa075c204 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlDesigner: Call all Component complete handlersThomas Hartmann2018-10-181-1/+1
| | | | | | | | | | | | 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>
* QmlDesigner: Improve the quality of state thumbnailsAlessandro Portale2018-09-131-2/+4
| | | | | | | | 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>
* QmlDesigner: Read contentItem after completingThomas Hartmann2018-04-051-4/+4
| | | | | | | This avoids issues with deferred properties. Change-Id: Ie9cc0eaa3468bcb21e4817f8c5e3c1b97c8fc99c Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Add meta hint if item renders children directlyThomas Hartmann2018-03-091-3/+5
| | | | | | | | | | | | 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>
* QmlDesigner: use initilizer_lists for pairsTim Jenssen2017-04-281-1/+1
| | | | | Change-Id: I3a1ef67d8af255604494695807331576540b8afa Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlDesigner: Fix warningThomas Hartmann2017-03-231-1/+1
| | | | | Change-Id: Iff2c50439521e602bd2703716590a3e95c8ab2b1 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Unite the bounding rectangle with actual sizeThomas Hartmann2017-03-171-0/+2
| | | | | | | | 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>
* QmlDesigner: Add support for high dpi to form editor and puppetThomas Hartmann2017-03-131-1/+7
| | | | | | | | | | | | | 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>
* QmlDesigner: fix a crash when there are missing importsTim Jenssen2016-10-051-4/+5
| | | | | | Task-number: QTCREATORBUG-16963 Change-Id: I0d4c2e018b4849b2a32cd77da8c2f979fd3befb3 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
* QmlDesigner: use initializer listsTim Jenssen2016-06-221-9/+9
| | | | | Change-Id: Ie93861c7d8a5b2863ec8b111afceacc2c163715b Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
* QmlDesigner: do no refresh if there is no parentTim Jenssen2016-04-291-7/+9
| | | | | Change-Id: I2299437ea97e884f4b7734129eec8246c87208ab Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
* QmlPuppet: Make compile without QT_RESTRICTED_CAST_FROM_ASCII removedhjk2016-03-181-4/+5
| | | | | Change-Id: I535efad65b2224337c133463da075953cc878c6c Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
* QmlDesigner: Evaluate properties for the root item in dummy contextThomas Hartmann2016-02-101-0/+10
| | | | | | | | | | | | 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>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-191-10/+10
| | | | | | | * Update all files in share folder Change-Id: I8a82c3eb2eb614d4339dd4c4e690f54b5f29d813 Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
* QmlDesigner: Fix crash in qml2puppetThomas Hartmann2016-01-191-1/+2
| | | | | | | | 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>
* Qt Quick Designer: License change to Qt Commercial + GPLv3Alessandro Portale2015-09-181-12/+7
| | | | | | | | 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>
* QmlPuppet: Move functions from QuickItemNodeInstance to QmlPrivateGateThomas Hartmann2015-05-201-36/+4
| | | | | | | No need to use private API in QuickItemNodeInstance. Change-Id: I5450ea41571c2787081cc88f59494a28eea5546c Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
* refactor NodeInstanceMetaObjectTim Jenssen2015-05-181-0/+1
| | | | | | | | | | 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>
* Update LicenseEike Ziller2015-01-161-6/+6
| | | | | Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>