forked from qt-creator/qt-creator
QmlPuppet: Register callback for notifyPropertyChange
MetaObject cannot have a dependency on ObjectNodeInstance. Instead we register a callback. Change-Id: I9f6e096c67caf1abd525201c9bacd363d31a2fa2 Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
This commit is contained in:
committed by
Thomas Hartmann
parent
0321f6e1a7
commit
c9eb75e2f8
@@ -110,6 +110,16 @@ namespace {
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
static NodeInstanceServer *nodeInstanceServerInstance = 0;
|
||||
|
||||
static void notifyPropertyChangeCallBackFunction(QObject *object, const PropertyName &propertyName)
|
||||
{
|
||||
qint32 id = nodeInstanceServerInstance->instanceForObject(object).instanceId();
|
||||
nodeInstanceServerInstance->notifyPropertyChange(id, propertyName);
|
||||
}
|
||||
|
||||
static void (*notifyPropertyChangeCallBackPointer)(QObject *, const PropertyName &) = ¬ifyPropertyChangeCallBackFunction;
|
||||
|
||||
NodeInstanceServer::NodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient) :
|
||||
NodeInstanceServerInterface(),
|
||||
m_childrenChangeEventFilter(new Internal::ChildrenChangeEventFilter(this)),
|
||||
@@ -122,6 +132,8 @@ NodeInstanceServer::NodeInstanceServer(NodeInstanceClientInterface *nodeInstance
|
||||
qmlRegisterType<DummyContextObject>("QmlDesigner", 1, 0, "DummyContextObject");
|
||||
|
||||
connect(m_childrenChangeEventFilter.data(), SIGNAL(childrenChanged(QObject*)), this, SLOT(emitParentChanged(QObject*)));
|
||||
nodeInstanceServerInstance = this;
|
||||
Internal::QmlPrivateGate::registerNotifyPropertyChangeCallBack(notifyPropertyChangeCallBackPointer);
|
||||
}
|
||||
|
||||
NodeInstanceServer::~NodeInstanceServer()
|
||||
|
||||
Reference in New Issue
Block a user