MCPcopy Create free account
hub / github.com/BrigJS/brig / createInstance

Method createInstance

src/QmlTypeBuilder.cpp:87–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85 }
86
87 void QmlTypeBuilder::createInstance(DynamicQObject *instance)
88 {
89 Nan::HandleScope scope;
90
91 instance->setId(instCounter++);
92
93 // Store this instance
94 TypeInstance *typeInstance = new TypeInstance();
95 typeInstance->id = instance->getId();
96 typeInstance->instance = instance;
97 instances.append(typeInstance);
98
99 // Prepare arguments
100 int argc = 2;
101 Handle<Value> *argv = new Handle<Value>[argc];
102 argv[0] = Nan::New<String>("created").ToLocalChecked();
103 argv[1] = Nan::New<Number>(typeInstance->id);
104
105 // Invoke
106 listener->Call(argc, argv);
107 }
108
109 TypeInstance *QmlTypeBuilder::findInstance(int _id)
110 {

Callers 1

BrigQMLTypeMethod · 0.80

Calls 2

setIdMethod · 0.80
getIdMethod · 0.80

Tested by

no test coverage detected