dougouqin0763 2019-08-25 08:40
浏览 241

在此Qt应用程序中找不到QByteArray

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.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?