MCPcopy
hub / github.com/go-qml/qml / run

Function run

examples/gopher/gopher.go:22–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20}
21
22func run() error {
23 engine := qml.NewEngine()
24
25 model, err := Read("model/gopher.obj")
26 if err != nil {
27 return err
28 }
29
30 qml.RegisterTypes("GoExtensions", 1, 0, []qml.TypeSpec{{
31 Init: func(g *Gopher, obj qml.Object) {
32 g.Object = obj
33 g.model = model
34 },
35 }})
36
37 component, err := engine.LoadFile(filename)
38 if err != nil {
39 return err
40 }
41
42 win := component.CreateWindow(nil)
43 win.Set("x", 560)
44 win.Set("y", 320)
45 win.Show()
46 win.Wait()
47 return nil
48}
49
50type Gopher struct {
51 qml.Object

Callers

nothing calls this directly

Calls 6

LoadFileMethod · 0.95
ReadFunction · 0.85
ShowMethod · 0.80
WaitMethod · 0.80
CreateWindowMethod · 0.65
SetMethod · 0.65

Tested by

no test coverage detected