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

Function run

examples/particle/main.go:19–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17}
18
19func run() error {
20 engine := qml.NewEngine()
21 component, err := engine.LoadFile("particle.qml")
22 if err != nil {
23 return err
24 }
25
26 ctrl := Control{Message: "Hello from Go!"}
27
28 context := engine.Context()
29 context.SetVar("ctrl", &ctrl)
30
31 window := component.CreateWindow(nil)
32
33 ctrl.Root = window.Root()
34
35 rand.Seed(time.Now().Unix())
36
37 window.Show()
38 window.Wait()
39
40 return nil
41}
42
43type Control struct {
44 Root qml.Object

Callers

nothing calls this directly

Calls 7

LoadFileMethod · 0.95
ContextMethod · 0.95
SetVarMethod · 0.80
RootMethod · 0.80
ShowMethod · 0.80
WaitMethod · 0.80
CreateWindowMethod · 0.65

Tested by

no test coverage detected