// NewEngine returns a new QML engine. // // The Destory method must be called to finalize the engine and // release any resources used. func NewEngine() *Engine { engine := &Engine{values: make(map[interface{}]*valueFold)} gui(func() { engine.addr = C.newEngine(nil) engines[engine.addr] = engine stats.enginesAlive(+1) }) return engine }
// NewEngine returns a new QML engine. // // The Destory method must be called to finalize the engine and // release any resources used. func NewEngine() *Engine { engine := &Engine{values: make(map[interface{}]*valueFold)} gui(func() { engine.addr = C.newEngine(nil) engine.engine = engine engine.imageProviders = make(map[string]*func(providerId string, width, height int) image.Image) engines[engine.addr] = engine stats.enginesAlive(+1) }) return engine }