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>
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>
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>
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>
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>
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>
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>
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>
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>
We cannot keep the context.
The context has to be forwarded each time.
Change-Id: I50b944bea1c6ad30832490edad8b35f392c32029
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This class holds the additional data we use to annotate QObject.
At the moment we store the default values and bindings there.
I also moved the code to populate and read the hashes
into that class.
Change-Id: Ib5e4b5291cfd2bf5555a896bf42578d07f2c6253
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This patch also fixes a memory leak.
The inspectedObjects in the default case were never deleted.
We now use a pointer to an object on the stack instead.
Change-Id: I07490e26b956e6c04911cb3e5e051704b2c2c35d
Reviewed-by: Tim Jenssen <tim.jenssen@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>
engine can be used from the ObjectNodeInstance and
prefix is not used since some time.
Change-Id: I857537643f149955a8ca9c5538ad15420bca9ab4
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.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>