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>
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>
Helps to adapt to potential upstream changes in Qt 6
Change-Id: Ie154bd4fd513d46cb0493758be8943fc4581d71c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
With @NodeInstance we can override the value of any property.
Change-Id: Ib64d8b6823b82f0a809092b2468c008d73a5525c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
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>
If a cpp type is somehow available do not create the mockup.
Change-Id: Ibd76429c3d1190c46a223062d77d676f728fe666
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
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>
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>
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>
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>
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>
The dummyContextObject is now set as the context object
Change-Id: I710f1ef36b8c97cc481b9109a775f06d9e03f6b6
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
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>
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>
MetaObject cannot have a dependency on ObjectNodeInstance.
Instead we register a callback.
Change-Id: I9f6e096c67caf1abd525201c9bacd363d31a2fa2
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
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>
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>
* If an import fails we show this as an error on the root item.
* If all imports fail (including the QtQuick import) we also
show an error message, but try to recover using QtQuick 2.0.
Change-Id: Ibfece2acdb9f2a6ba26dfd9b31607507fec82dd1
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
The hash was not cleaned up in any case and sometimes a new object
gets allocated at the exact same address.
To avoid leaking hashes in m_objectInstanceHash and to avoid the assert,
we remove any deleted QObject from the hash.
Change-Id: I2697ab2b2430ad47932841fb9c0ef88ffa4cbbb1
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
- adding line ending to the import code
- set correct fileUrl to resolve local directory imports
Task-number: QTCREATORBUG-12625
Change-Id: I2861fc5674ff0fa4f6cc9e308a22cd2853ffa85c
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>