Commit Graph

141 Commits

Author SHA1 Message Date
Thomas Hartmann
80922268ab QmlDesigner: Implement ObjectNodeInstance::stateInstances() for StateGroup
Change-Id: Ia6e239530d399da34ab63253762e3ebd2a79f4db
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
2022-08-24 17:57:55 +00:00
Thomas Hartmann
f3e9fbd748 QmlDesigner: Do not set state property on QQuickStateGroup
The state is determined by the state view.

Change-Id: I3b76b25c618d4f860f13d2e005d88d93a660fbc0
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-24 17:57:18 +00:00
Miikka Heikkinen
f146b846cd QmlDesigner: Implement proper preview for pure 3D scenes
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>
2022-02-10 14:47:26 +00:00
Miikka Heikkinen
2ab6f800b3 QmlDesigner: Fix issues with Components and Repeaters
- 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>
2021-10-05 09:12:12 +00:00
Thomas Hartmann
fa1d7958c3 QmlDesigner: Do not generate version number if invalid
This is a fallback to create components from source.
If the majorVersion is negative we should not generate
a version as part of the import.

Change-Id: I377b241e8e4c51141d560d7198e5906a9c963b54
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-08-09 08:10:01 +00:00
Thomas Hartmann
ef8f18fb70 QmlDesigner: Do not instanciate ApplicationWindow
Change-Id: I7a57de60aba72823579e986e9ad6278c4a7e84a8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-07-19 07:53:39 +00:00
Thomas Hartmann
8910601b78 QmlDesigner: Allow creation without version number
Task-number: QDS-4403
Change-Id: I952de9a2a6aa345b041f890fb2d364850c25e492
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2021-06-01 10:44:18 +00:00
Thomas Hartmann
c7d9ca1154 QmlDesigner: Fix Qt 6 imports
This allows using a Qt 5 puppet with simple Qt 6 files.

Change-Id: Ic3264ffbf8d798ff260305079a0bb281f9628795
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-04-06 16:45:32 +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
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
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
Thomas Hartmann
a381d8efc8 QmlDesigner: Fix crash on puppet
Change-Id: I233d3dab5a509bfd7c9a30c7dcc15dcf8751f456
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-25 12:02:57 +00:00
Thomas Hartmann
ad4c5e0258 QmlDesigner: Fix puppet crash
Change-Id: I2a408d090c4bbf2c3da7f03473312eff4b7e6c34
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-10 16:02:59 +00:00
Thomas Hartmann
33c88a0ced QmlDesigner: Expose component url
Change-Id: I2b1708e6f87b00ad0b56c04f591ba24720a886ba
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-05-06 20:17:01 +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
Miikka Heikkinen
09f34a697f QmlDesigner: Fix crash in puppet when component has errors
Check component creation errors earlier to avoid crash.
This allows puppet to notify creator about the problem, so invalid
components can be properly highlighted in navigator.

Change-Id: I059a5be04c4e509a38f6d47daa97e0da36c333ae
Fixes: QDS-1887
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2020-04-02 12:20:35 +00:00
Unseon Ryu
38a7bfe4eb Fix for Pane not being visible in the form editor
Task-number: QDS-797
Change-Id: I4b06aa0e09f78fdd3bb9531cf21441bdae3ee2a5
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-03-27 10:53:08 +00:00
Thomas Hartmann
2f2787c4a8 QmlDesigner: Add workaround for QVector3D
For some reason the Qt meta system does not work reliable
for QVector3D. It does work "rotation", but not for "pivot",
despite the fact that both properties are defined in exactly the
same way.
This patch works around the main issue.
There are still a few issues left, but at least the default is
correct now.

Task-number: QDS-1355
Change-Id: I75e2d3adff6967e89c6ce031d744baa12b5e8061
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-12-17 10:08:00 +00:00
Thomas Hartmann
17dbc74cca QmlDesigner: Avoid reflection when setting values from puppet
When editing values in the puppet we did not take reflection into account.
This means that any changes we did from the puppet for notified back
from Qt Creator. Since those notifications are asynchronous this leads
to various issues especially when more than one axis (property) was modified
at once.

This patch avoids reflection. The notifications are 'flagged' and then
ignored in the Qt5InformationNodeInstanceServer.

While a node is moved we ignore any changes to that specific node.

Task-number: QDS-1191
Change-Id: Ic74e22ea71832ce12321f9085a7296c2a7d9893d
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-10-30 09:46:35 +00:00
Thomas Hartmann
ac84f8a457 QmlDesigner: Implement Quick3DNodeInstance wrapper
We use Quick3DNodeInstance as a proxy class to wrap QQuick3DNode.
The access to private API like QQuick3DNodePrivate::setIsHiddenInEditor()
is restriced by such proxy classes.

Change-Id: If5191c3b730359000cf983c3af206dcffa07be74
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Pasi Keränen <pasi.keranen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-10-21 11:30:19 +00:00
Thomas Hartmann
5b325b1748 QmlDesigner: Do not try to create objects with invalid version
Change-Id: I15eb8cf006bf8a58eaba4140f062fbf14e417f47
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-10-14 18:29:20 +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
4c746531d8 QmlDesigner: Add support for Dialog
Change-Id: I8a2972f80ae79835018870eda7b11a817353bf94
Task-numbner: QTCREATORBUG-22120
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-03-20 12:09:24 +00:00
Eike Ziller
eeaa02bc27 Merge remote-tracking branch 'origin/4.8' into 4.9
Conflicts:
	src/plugins/android/androidbuildapkstep.cpp

Change-Id: Id6dfda480c23706089ab38aa6277cd37599b5167
2019-02-28 12:39:09 +01:00
Thomas Hartmann
0f6e5a56cb QmlDesigner: Avoid puppet crash
If the property is invalid the propertyTypeName is a nullptr.
Calling strcmp on nullptr is undefined and can result in a nullptr access.

Change-Id: I270091fa1d2635019ad2e41c4a5eab9985227dcf
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-02-15 06:50:14 +00:00
Thomas Hartmann
d4726589f1 QmlDesigner: Fix error for Connections
Connections is actually in QtQml.

Change-Id: I88d33e273efa542535ef7f87a4020c23f172b15e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-02-05 17:05:57 +00:00
Thomas Hartmann
80a92d55d3 QmlDesigner: Fix gradients in Qt 5.12.1
In Qt 5.12.1 gradient is a QJSValue.
See commit 1771d298f33543a3fe47decfe0fff10609b01ab1
This patch adds QJSValue support.

Change-Id: I1c37b82bf033c38646564d5453e297258dd4b056
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-01-25 14:56:08 +00:00
Robert Loehning
4032f6383a Fix frequent typo
can not -> cannot

Change-Id: Ie872ada1bc9b4ed64bffb667c2e44dbb13b4ad11
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-10-23 09:30:20 +00:00
Tim Jenssen
8d8aa62e4d QmlDesigner: change the import path to QtQuick2 path
Change-Id: I8adb6fdd334647dd85a8a9f95738ac22fc690363
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-10-10 08:36:04 +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
Eike Ziller
f2ef88aada QmlDesigner: Avoid some unneeded QFileInfo constructions
Change-Id: I0289c3187f07e26d05a7ca591cc8b12b767c3502
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-10-19 06:38:41 +00:00
Eike Ziller
5a1a20f2ee Merge remote-tracking branch 'origin/4.3' into 4.4
Change-Id: Ifb1dcc847ba4b32a79b349955fad5207e402cb7b
2017-07-12 10:50:49 +02:00
Marco Benelli
6c41fafbb6 Qmlpuppet: add missing includes
Task-number:  QTCREATORBUG-18498
Change-Id: Ie40a066508bb52f53b8ad528f9d4cf6969fc0632
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-07-10 08:48:46 +00:00
Thomas Hartmann
567a99c5aa QmlDesigner: Replace SwipeView with StackLayout
In the designer we replace a SwipeView with a StackLayout.
Form the perspektive of the designer they are the same
and StackLayout is easier to handle.

Change-Id: I308ec209024e22db9f56e363e27588a40283603c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-05-15 15:50:48 +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
Montel Laurent
5d27bc747b Use QFileInfo::exists(...) which is faster that QFileInfo(..).exists
Change-Id: I0d2e61d84c74e60ef4f54074a4ca00f2d0835562
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-04-14 13:18:28 +00:00
Thomas Hartmann
6e30faba73 QmlDesigner: Quick fix for Popup
This is a quickfix for Controls 2 Popup, Drawer, Menu and Dialog.
We pretend everything derived from QtQuick.Controls.Popup
is an item instead of a QQObject.

Change-Id: I603dce8a1a1b08df3e2c1dccc0fa57e7ccef0800
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-22 12:58:20 +00:00
Thomas Hartmann
f952c3ee4a QmlDesigner: Fallback to create types from source
We fallback to create types from source, if other means failed.
This can be required if the meta info is incomplete/incorrect when
a C++ type is mocked.

Change-Id: I50d45a6f9d7eba3483da10d9e1d7d6644d9aeb96
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-31 14:30:40 +00:00
Thomas Hartmann
034f1728ea QmlDesigner: Set QQuickItem parent if item is written to a property
The QQuickEngine does the same.

Before in cases like this:

Item {
   Slider {
      handle: Item {
      }
   }
}

The item parent of the handle was the root item instead of the slider.

Change-Id: Ia022c82c6d85c2a957763c56639ac77bca9297e6
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-13 11:39:25 +00:00
Eike Ziller
467def6996 Merge remote-tracking branch 'origin/4.0'
Change-Id: I3f28f1f53cf2b2228928fbd7accf25d87bb40243
2016-03-23 14:15:31 +01:00
Tim Jenssen
50b1bf629e QmlDesigner: remove unused code
Change-Id: I00bc1b533f065b87a8d1b46e3296f76bf05b85d4
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-03-23 12:13:48 +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
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
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
fa6d623dfa QmlPuppet: Remove dependency on ObjectNodeInstance in MetaInfo
MetaInfo cannot depend on ObjectNodeInstance.
I forward the QObject and the QmlEngine all the way through.
The commented code in metainfo.cpp is about defining a context
for the root item. The feature is basically unused, but we can bring
it back using a callback later.

Change-Id: I8f099b06c848e2faeaafc011ac6bd313192a64bd
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2015-05-21 10:17:38 +00:00
Thomas Hartmann
c919795a08 QmlPuppet: Bring back simplified NodeInstanceSignalSpy
A simplified version of NodeInstanceSignalSpy is required to track
sub objects. I moved all private API usage to QmlPrivateGate.

Change-Id: I86e3e5411eb43777a6b1ab5018a1b8fb9088c666
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2015-05-21 07:39:25 +00:00
Thomas Hartmann
d38b1c21a2 QmlPuppet: DesignerSupport is not used directly anymore
No need to use DesignerSupport directly in ObjectNodeInstance.

Change-Id: I124adc6334feb23c30fb1a242fe95386678eadf5
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2015-05-20 14:02:12 +00:00
Thomas Hartmann
e1a19ba229 QmlPuppet: Removing private headers from ObjectNodeInstance
Change-Id: I179de2b759307a9251c672b1747823626e2f3ef0
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2015-05-20 14:02:00 +00:00
Thomas Hartmann
a1f70b965a QmlPuppet: Adding objectWasDeleted to QmlPrivateGate
Change-Id: I5dadc879f0c6a02ca29c35fff1847b3c7b0a0972
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2015-05-20 14:01:53 +00:00
Thomas Hartmann
f3abe73956 QmlPuppet: Adding keepBindingFromGettingDeleted to QmlPrivateGate
Change-Id: I51d0d29939b6fbd3fc309c092654f373abd8f179
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2015-05-20 14:01:48 +00:00