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

▸ get‹T›(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