QML Extension Objects: Registering extended type for default QML Items through qmlRegisterExtendedType
-
Hello!
I would like to extend all default elements available in QML with a new property. How to do this for custom types is explained in "QML Extension Objects":http://doc.qt.nokia.com/4.7-snapshot/qml-extending.html#extension-objects
This works as expected when I try it like this
@qmlRegisterExtendedType<QDeclarativeItem, SomeObject>("QtQuick", 1, 1, "SomeItem");@
but it does exactly nothing when I try the following
@qmlRegisterExtendedType<QDeclarativeItem, SomeObject>("QtQuick", 1, 1, "Item");@What exactly is the reason for this behaviour? Is it somehow possible to change all QDeclarativeItem derived Components (e.g. Rectangle, Text, etc.) at once, without having to modify QDeclarativeItem's source code?
Greets,
Bernhard -
-
Guys, I ran into the same problem. I was trying to extend QDeclarativeItem with some properties, but then I cannot access anymore the "implicitWidth" and "implicitHeight" properties. More, state change seems not to be signaled either... Any idea? This is using Qt 4.8.1 on Linux.
Thx!