| 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 | { |
no test coverage detected