WrapperCache

JS side cache for wrapper objects.

This is mainly used for caching wrappers of Qt objects which are not directly created by our Nodejs application. The purpose of the cache is to keep "alive" wrapper objects and their underlying C++ wrappers which may be connected to Qt signals from the real Qt object. This makes it easier for application to grab one of these objects, set up event handlers, and then let the object go and not have the wrapper automatically and unexpectedly garbage collected.

Hierarchy

  • WrapperCache

Index

Constructors

Properties

Methods

Constructors

constructor

+ new WrapperCache(): WrapperCache

Returns: WrapperCache

Properties

logCreateQObject

logCreateQObject: boolean = false


logDestoryQObject

logDestoryQObject: boolean = false

Methods

_flush

_flush(): void

Returns: void


get

getT›(wrapperConstructor: object, native: NativeElement): T

Type parameters:

T: QObject

Parameters:

wrapperConstructor: object

NameType
constructor

native: NativeElement

Returns: T


getWrapper

getWrapper(native: any): QObject | null

Parameters:

NameType
nativeany

Returns: QObject | null


registerWrapper

registerWrapper(qobjectClassName: string, wrapperConstructor: object): void

Parameters:

qobjectClassName: string

wrapperConstructor: object

NameType
constructor

Returns: void


store

store(wrapper: QObject): void

Parameters:

NameType
wrapperQObject

Returns: void