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>
If a cpp type is somehow available do not create the mockup.
Change-Id: Ibd76429c3d1190c46a223062d77d676f728fe666
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
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>
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>
A "raw" QObject (created instead of the Timer) will crash the engine later. Instead we setup
the QObject using createPrimitive().
Task-number: QTCREATORBUG-15916
Change-Id: I5f0dd9c887fd57d492222d221e54f267e12a5044
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
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>
The dummyContextObject is now set as the context object
Change-Id: I710f1ef36b8c97cc481b9109a775f06d9e03f6b6
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
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>
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>
Those headers are used implcitly.
Change-Id: I49dcfb1a04b2103866b1d828605381570fb3e5c6
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
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>
No need to use DesignerSupport directly in ObjectNodeInstance.
Change-Id: I124adc6334feb23c30fb1a242fe95386678eadf5
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
No need to use private API in QuickItemNodeInstance.
Change-Id: I5450ea41571c2787081cc88f59494a28eea5546c
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
We cannot keep the context.
The context has to be forwarded each time.
Change-Id: I50b944bea1c6ad30832490edad8b35f392c32029
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>