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() }
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() }
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)) }