Exemplo n.º 1
0
Arquivo: qml.go Projeto: hahaya/qml
// 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
}
Exemplo n.º 2
0
// 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
}