Пример #1
0
func main() {

	gui.NewQGuiApplication(len(os.Args), os.Args)

	var app = qml.NewQQmlApplicationEngine(nil)
	app.Load(core.NewQUrl3("qrc:///qml/application.qml", 0))

	gui.QGuiApplication_Exec()
}
Пример #2
0
func main() {

	gui.NewQGuiApplication(len(os.Args), os.Args)

	var view = quick.NewQQuickView(nil)
	view.SetSource(core.NewQUrl3("qrc:///qml/calc.qml", 0))
	view.SetResizeMode(quick.QQuickView__SizeRootObjectToView)
	view.Show()

	gui.QGuiApplication_Exec()
}
Пример #3
0
func main() {

	core.NewQCoreApplication(len(os.Args), os.Args)

	var (
		component = qml.NewQQmlComponent5(qml.NewQQmlEngine(nil), core.NewQUrl3("qrc:///qml/prop.qml", 0), nil)
		object    = component.Create(nil)
	)

	fmt.Println("Property value:", object.Property("someNumber"))
	object.SetProperty("someNumber", core.NewQVariant7(5000))
	fmt.Println("Property value:", object.Property("someNumber"))
	object.SetProperty("someNumber", core.NewQVariant7(100))
}