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

Method TestComponentCreateWindow

qml_test.go:265–283  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

263}
264
265func (s *S) TestComponentCreateWindow(c *C) {
266 data := `
267 import QtQuick 2.0
268 Item { width: 300; height: 200; }
269 `
270 component, err := s.engine.LoadString("file.qml", data)
271 c.Assert(err, IsNil)
272
273 // TODO How to test this more effectively?
274 window := component.CreateWindow(nil)
275 window.Show()
276
277 // Just a smoke test, as there isn't much to assert.
278 c.Assert(window.PlatformId(), Not(Equals), uintptr(0))
279
280 // Qt doesn't hide the Window if we call it too quickly. :-(
281 time.Sleep(100 * time.Millisecond)
282 window.Hide()
283}
284
285func (s *S) TestContextSpawn(c *C) {
286 context1 := s.engine.Context()

Callers

nothing calls this directly

Calls 5

LoadStringMethod · 0.80
ShowMethod · 0.80
PlatformIdMethod · 0.80
HideMethod · 0.80
CreateWindowMethod · 0.65

Tested by

no test coverage detected