Context of a QDeclarativeItem
-
Hi! Is it possible to get the context that corresponds to a custom QDeclarativeItem that was instantiated in QML? I mean, something like:
foo.qml:
@Item {
Component.onCompleted: component.createChildren()MyComponent {
id: component
delegate: Rectangle {}
}@mycomponent.h:
@class MyComponent : public QDeclarativeItem
{
...
Q_PROPERTY(QDeclarativeComponent* delegate ... )Q_INVOKABLE void createChildren() { QObject *object = delegate->create(context); // where do I get the context from? }
};@
-