I am using following Qt test application from here:
package main
import (
"os"
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/quick"
"github.com/therecipe/qt/quickcontrols2"
"github.com/therecipe/qt/widgets"
)
func main() {
// enable high dpi scaling
// useful for devices with high pixel density displays
// such as smartphones, retina displays, ...
core.QCoreApplication_SetAttribute(core.Qt__AA_EnableHighDpiScaling, true)
// needs to be called once before you can start using QML/Quick
widgets.NewQApplication(len(os.Args), os.Args)
// use the material style
// the other inbuild styles are:
// Default, Fusion, Imagine, Universal
quickcontrols2.QQuickStyle_SetStyle("Material")
// create the quick view
// with a minimum size of 250*200
// set the window title to "Hello QML/Quick Example"
// and let the root item of the view resize itself to the size of the view automatically
view := quick.NewQQuickView(nil)
view.SetMinimumSize(core.NewQSize2(250, 200))
view.SetResizeMode(quick.QQuickView__SizeRootObjectToView)
view.SetTitle("Hello QML/Quick Example")
// load the embedded qml file
// created by either qtrcc or qtdeploy
view.SetSource(core.NewQUrl3("qrc:/qml/main.qml", 0))
// you can also load a local file like this instead:
//view.SetSource(core.QUrl_FromLocalFile("./qml/main.qml"))
// make the view visible
view.Show()
// start the main Qt event loop
// and block until app.Exit() is called
// or the window is closed by the user
widgets.QApplication_Exec()
}
On running go build
command, I get following error:
I:\>go build main_qt_quicktest.go
# github.com/therecipe/qt/quickcontrols2
quickcontrols2.cpp:9:10: fatal error: QByteArray: No such file or directory
#include <QByteArray>
I am working on Windows7 with go version go1.12.9 windows/386
Where is the problem and how can it be solved? Thanks for your help.