Commit Graph

90 Commits

Author SHA1 Message Date
Tim Jenssen
b8cd87dea0 Merge remote-tracking branch 'origin/qds-1.59' into 4.13
Conflicts:
	src/plugins/clangformat/clangformatplugin.cpp
	src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp
	src/plugins/qmldesigner/qmldesigner.qbs

Change-Id: Ie4a0beeb9fd32ac9683f4e8769988a9c3f3e369a
2020-06-26 16:51:22 +02: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
Tim Jenssen
f652167768 qmldesigner: add language to create scene command
and also save the last used language to settings

Task-number: QDS-2218
Change-Id: Ib82f7bc755755661183452b32829be3d048d9947
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-06-11 15:26:39 +00:00
Tim Jenssen
cbd0649e3b qmlpuppet: enable the use of multilanguage database
Change-Id: I2277348ac1e6b5025e75c640da83da30294c9d10
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-26 18:12:38 +02:00
Marco Bubke
0e7a1e6650 QmlDesigner: Preview size is now changeable
You can now change the preview size with
rootModelNode.setAuxiliaryData("previewSize@Internal", size);
If size is null it will use the bounding box size.

Change-Id: Icbe747ccc5a2e26e79783825d2ed94ecc640012b
Reviewed-by: Michael Winkelmann <michael.winkelmann@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-05-12 07:11:15 +00:00
Marco Bubke
dacea667ed QmlDesigner: Add ChangeLanguage command
Change-Id: If79de7d04717ad81af05411e61c262b9ff70129b
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-04-29 06:17:34 +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
Mahmoud Badri
fb843d3442 QmlDesigner: Remove the standalone view3D window implementation
Task-number: QDS-1692
Change-Id: I6c04aaee9ab6a119cfcc22ee2e19b808bb95ae0a
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2020-03-05 11:00:11 +00:00
Miikka Heikkinen
4908055937 Integrate Edit3D view into Creator
Edit3D view is now a tab alongside Form Editor.
Buttons were moved to a Creator side task bar on Edit 3D view.

Change-Id: Ia06107e4f855ba512ffea3e628a61558894e800e
Fixes: QDS-1570
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-02-24 12:18:53 +00:00
Miikka Heikkinen
7c992f5450 QmlDesigner: Insert a node dragged to 3d edit view into correct scene
Added scene instance id to the drop command.

Change-Id: I42df07fec823083454ad5a70ccafa318d05ab224
Fixes: QDS-1594
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-02-07 10:17:47 +00:00
Mahmoud Badri
f97de35dd4 Improve edit view 3D "on top" logic
- Proxy dialog removed
- When the QDS window is minimized/maximized, the edit view 3D follows.
  The opposite is not true (edit view 3D can be minimized separately).
- Edit view 3D is always on top of QDS window. Only exception is when
  a popup is shown (so that the user can handle the popup).
- External apps go normally on top of the edit view 3D.

Known (non critical) issues:
- Activating the edit view 3D doesn't raise() the QDS window, so if an
external app is on top of the edit view 3D then the view is clicked,
the external app will be in between the view and the QDS window.
- Closing the edit view 3D from the x button doesnt work (causes a
  restart). This is not in the scope of this commit.

Task-number: QDS-1179
Change-Id: I1dd72590037be295b94735de96772307ba14c59c
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-12-13 12:40:43 +00:00
Thomas Hartmann
880ab11e76 QmlDesigner: Use proxy dialog for 3D edit view
To integrate the 3D edit view in the qml2puppet process,
we create a dialog in the Qt Creator process.
This dialog acts as a proxy that manages the actual window.

For this I introduced a new command that allows showing, hiding, resizing
and moving of the 3D edit view.
The 3D edit view always follows the proxy dialog.

During moving and resizing we hide the window to avoid artefacts.

At this point in time the proxy widget is a dialog, but it could
also be a dockwidget or any other QWidget in the future.

Task-number: QDS-1179
Change-Id: I67ccab49eb2de9ba23098a67b2f9577f6c7fd3ac
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2019-11-28 13:09:51 +00:00
Mahmoud Badri
5df7ad94ec Implement DnD 3D objects from the item library to the EditView3D
Proof of concept drag and drop implementation. Basic functionality
working but needs polish.

Task-number: QDS-1132
Change-Id: Ie3b9e80de9a414c4955d6e38daf338045bc1e614
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-11-12 10:00:34 +00:00
Thomas Hartmann
9469432035 QmlDesigner: Add Qt5InformationNodeInstanceServer::modifyProperties()
This method allows to modify properties in the data model from
the puppet. For performance reasons, properties should be modified
in bulks. Each bulk will be one step on the undo stack.

Change-Id: I7dbef02781706c8638981512ca0ec45d24c54545
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-10-24 08:22:11 +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
640044c8f8 QmlDesigner: Implement command for synchronising the selection
This patch implements the command and dispatchers for
synchronising the selection between Qt Creator and the qml2puppet.

Qt5InformationNodeInstanceServer::changeSelection() is called whenever the selection
is changed in Qt Creator.

Qt5InformationNodeInstanceServer::changeSelection() allows to change the
selection from the qml2puppet.

Change-Id: I73a64d8dc2a3f330433f966b42a10229cbbff649
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-10-21 05:52:13 +00:00
Thomas Hartmann
c5fe523774 QmlDesigner: Fix eyeball in navigator for QQuick3DNode
The eyeball status for QQuickItem is handled in the form editor.
This does not work for QQuick3DNode.

* Adding support for 'invisible' in QmlVisualNode
  This allows to handle the 'invisible" state for
  both QQuickItem and QQuick3DNode.

* Adding support for 'invisible' in the NodeInstanceServer.
  This means that the nodes are actuallly made invisible,
  if the AuxiliaryData is set.

Even with this patch there is still a downside. We actually do
hide the QQuick3DNode, which is reflected by the value of 'visible'
in the property editor. This is not correct. The eybeball should not affect
the actual property. To properly implement this we need a way to hide an
item in the scene wihout changing the visibility property.

Task-number: QDS-1065
Change-Id: I713ec97bc89fdd7271b2174756f36ce3731cfd4e
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2019-10-09 12:02:36 +00:00
Eike Ziller
e5543eaebf Merge remote-tracking branch 'origin/4.10'
Change-Id: Id9cab641788f93cda9a81da9f156614b91d87b2a
2019-08-01 11:58:56 +02:00
Thomas Hartmann
0f3c8a3c7b QmlDesigner: Fix custom qml2puppet build
The build of a custom qml2puppet was failing, because
of utils/algorithm.h missing.
We should minimize Qt Creator dependencies in the puppet.

Change-Id: Iba8dd1a3979dbeeb1bfa860b50ba586bea20c7a7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-31 10:38:28 +00:00
hjk
e3b1106afa Compile fix with recent Qt dev
The reasoning in 1b4766e26c did not take into account that the scope
of QT_NO_JAVA_STYLE_ITERATORS may change over time, as done with
f70905448f6 in Qt base.

Change-Id: Ib1966ff26c4d36d5f62e149d6b45baa4aecf825d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-29 08:54:18 +00:00
hjk
a34bf6a23b QmlPuppet: Replace some foreach
Change-Id: I59b4049282564762f75aa5e9a7a0b7eba055db48
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-26 12:59:41 +00:00
hjk
6a58666f44 More Utils::toSet/toList
... and unrelated cosmetic changes.

Change-Id: I591b17fd5289831e701b683f8fb47816efd1fa67
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-04 12:28:38 +00:00
hjk
92a52a7181 Use Qt's QFileInfoList instead of QList<QFileInfo>
Helps to adapt to potential upstream changes in Qt 6

Change-Id: Ie154bd4fd513d46cb0493758be8943fc4581d71c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-05-28 07:19:45 +00:00
Tobias Hunger
d366944519 QmlPuppet: Modernize (nullptr and member initialization)
Change-Id: Ifac20a48df8702f9d31042eb8765cbaadb60b25b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-20 12:40:18 +00:00
Thomas Hartmann
6745536f1e QmlDesigner: Fix @NodeInstance
With @NodeInstance we can override the value of any property.

Change-Id: Ib64d8b6823b82f0a809092b2468c008d73a5525c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-20 12:18:43 +00:00
Thomas Hartmann
d942111ace QmlDesigner: Fix manual puppet build
The overload for the "+" operator is ambiguous.

Change-Id: Iaebd889ef2eaed6e2d4261ecbd9555a6ba73c521
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-22 16:14:04 +00:00
Nikolai Kosjar
ab87035ed3 QmlDesigner: Fix compilation
nodeinstanceserver.cpp: In member function 'void
    QmlDesigner::NodeInstanceServer::setupImports(const
    QVector<QmlDesigner::AddImportContainer>&)':
nodeinstanceserver.cpp:458:71: error: conversion from 'const char*' to
    'QChar' is ambiguous

Change-Id: Ifa4cb2700344aaacc17619f05249f338e9b28d0b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-22 10:01:04 +00:00
Tim Jenssen
cff0c06f0c QmlDesigner: fix import check again
Task-number: QTCREATORBUG-17303
Change-Id: I0f7a054d63234f3f368de65fd6092c494a9055d4
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-11-22 09:19:53 +00:00
Tim Jenssen
571168f9fb QmlDesigner: fix endless loop in check import code
Change-Id: Id1255ed1fd544e0eed75aeeeb2ffb3df8f75dc84
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-11-21 15:44:33 +00:00
Thomas Hartmann
cb86cc3bdd QmlDesigner: Only register mockup object if not available
If a cpp type is somehow available do not create the mockup.

Change-Id: Ibd76429c3d1190c46a223062d77d676f728fe666
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-25 14:05:41 +00:00
Thomas Hartmann
4f2557e9cf QmlDesigner: Fix build of qml2puppet
If the qml2puppet is build for the custom Qt then
the build failed because of utils/algorithm.h.

There is currently no reason to use utils/algorithm.h
in the puppet.

Change-Id: I4fb2aa2e7df4a5087ff48318cc416b457779c96e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-07 10:20:23 +00:00
Tim Jenssen
83e128c2d9 QmlDesigner: refactor test import code
Change-Id: I4efaaacbbf2de23b8709535a7b9a2446f0a4b90e
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-10-06 15:50:11 +00:00
Thomas Hartmann
d3b4acfae2 QmlDesigner: Allow qml2puppet to mockup C++ types
This allows Qt Quick Designer to register a component that can serve
as a mockup for known C++ components registered in e.g. main.cpp.

In many cases those components are the interface to the C++ backend.
While the C++ components itself are not relevant for the gui designer,
the user has to be able to instantiate gui components that use such C++
components.

We use the CreateSceneCommand to forward a list of C++ types to
qml2puppet.
Those types are then registered so that the imports and object institation
works.

Change-Id: I1543912f233f9a783998f3c6a1b48981b342ee80
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-04 08:59:24 +00:00
Thomas Hartmann
9065697572 QmlDesigner: Support .qrc files in the qml2puppet
The code model knows about .qrc files and has a mapping
that we forward to the qml2puppet.
Support for .qrc was broken when introducing the QmlPrivateGate.

Change-Id: I22d1c1add65d0c9a914e471dbe51ef505f308494
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-06-10 14:24:26 +00:00
Eike Ziller
4a826ada04 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	qtcreator.pri
	qtcreator.qbs

Change-Id: I0cbc9d335073e3234f472aa43f462eef9a9178aa
2016-04-22 15:13:58 +02:00
Thomas Hartmann
27c00777d5 QmlDesigner: Fix assert
Trying to serialize a void start  using QVariant does assert.
Solution: Ignore properties of type void star.
This was triggered by TreeView.

Change-Id: Idca5646a472fdfce8761861f5bf889bb73300fff
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-04-21 13:06:49 +00:00
Eike Ziller
5c87432260 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp

Change-Id: I6ae2d37290643d69390f679a54f7596782f3d97f
2016-04-12 11:34:46 +02:00
Thomas Hartmann
eb172fbbd4 QmlDesigner: Fix assert
Trying to serialize a QModelIndex using QVariant does assert.
Solution: Ignore properties of type QModelIndex.

Change-Id: Idca5646a472fdfce8761861f5bf889bb73340df7
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-04-06 13:10:04 +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
ece316fb64 QmlDesigner: Adding dummydata as context property
The dummyContextObject is now set as the context object

Change-Id: I710f1ef36b8c97cc481b9109a775f06d9e03f6b6
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-10 10:36:34 +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
Tobias Hunger
bf48d54b27 Convert to Qt5 style connects
Use Clazy fix-old-style-connect to turn most connects to Qt5 style.

Change-Id: Ib81da329a7c1f5cf3e76536cbcc729a5c5d6dd56
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2015-11-19 16:22:52 +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
6dfd03596f QmlDesigner.QmlPuppet: Fix compile for Qt 5.6
Change-Id: I231bcf61e813db14c0958565cf76dd4df56b4e99
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2015-07-14 10:28:10 +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
c9eb75e2f8 QmlPuppet: Register callback for notifyPropertyChange
MetaObject cannot have a dependency on ObjectNodeInstance.
Instead we register a callback.

Change-Id: I9f6e096c67caf1abd525201c9bacd363d31a2fa2
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2015-05-21 10:11:48 +00:00
Thomas Hartmann
afd903c4a4 QmlPuppet: Remove private dependencies from NodeInstanceServer
Change-Id: I386bd18704020d0b174cda224c4cf46245227877
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2015-05-20 14:02:43 +00:00
Thomas Hartmann
a02438a44f QmlPuppet: Move fixResourcePaths to QmlPrivateGate
Change-Id: I9bbd22c19df64d3cfda3bbf02d9c72da5c2a0542
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2015-05-19 12:26:07 +00:00
Thomas Hartmann
e0a3e25491 Qml2Puppet: Introduce QmlPrivateGate
The goal is to avoid direct usage of private API.
Any access to private QML API is supposed to go through QmlPrivateGate.

NodeInstanceMetaObject is moved into QmlPrivateGate and renamed to just
MetaObject.

Change-Id: Iba0b574605e455b01e7b86306ec3ca47be7b4e58
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2015-05-19 12:04:41 +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