-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathqobject_implement.h
More file actions
33 lines (31 loc) · 1 KB
/
Copy pathqobject_implement.h
File metadata and controls
33 lines (31 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once
#include "framework.h"
#include "qobject_p.h"
#include "qobject_wrapper.h"
namespace shelllet {
namespace core {
class Object : public virtual QObjectWrapper<QObject, Object, true>
{
using ReturnType = QObjectPrivate<QObject, true>;
using ReturnType2 = QObjectPrivate<QObject, false>;
ReturnType* Param(const v8::FunctionCallbackInfo<v8::Value>& args) {
return new ReturnType(args.GetIsolate(), args.This());
}
public:
Object(const v8::FunctionCallbackInfo<v8::Value>& args) : QObjectWrapper(*Param(args), args)
{
}
Object(QObject* p, const v8::FunctionCallbackInfo<v8::Value>& args) : QObjectWrapper(*new ReturnType2(args.GetIsolate(), args.This(), p), args)
{
}
Object(v8::Isolate* isolate, const v8::Local<v8::FunctionTemplate>& tpl) : QObjectWrapper(isolate, tpl) {}
Object(v8::Isolate* isolate, const v8::Local<v8::ObjectTemplate>& proto) : QObjectWrapper(isolate, proto)
{
}
public:
static const char* Name() {
return "QObject";
}
};
}
}