mirror of
https://github.com/bluszcz/cutego.git
synced 2024-09-29 05:35:16 +03:00
39 lines
872 B
Go
39 lines
872 B
Go
//source: http://doc.qt.io/qt-5/qtcanvas3d-interaction-example.html
|
|
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"runtime"
|
|
|
|
"github.com/therecipe/qt/core"
|
|
"github.com/therecipe/qt/gui"
|
|
"github.com/therecipe/qt/quick"
|
|
)
|
|
|
|
func main() {
|
|
core.QCoreApplication_SetAttribute(core.Qt__AA_EnableHighDpiScaling, true)
|
|
|
|
var app = gui.NewQGuiApplication(len(os.Args), os.Args)
|
|
|
|
var viewer = quick.NewQQuickView(nil)
|
|
|
|
var extraImportPath string
|
|
if runtime.GOOS == "windows" {
|
|
extraImportPath = "%v/../../../../%v"
|
|
} else {
|
|
extraImportPath = "%v/../../../%v"
|
|
}
|
|
|
|
viewer.Engine().AddImportPath(fmt.Sprintf(extraImportPath, app.ApplicationDirPath(), "qml"))
|
|
viewer.SetSource(core.NewQUrl3("qrc:/main.qml", 0))
|
|
|
|
viewer.SetTitle("Interaction")
|
|
viewer.SetResizeMode(quick.QQuickView__SizeRootObjectToView)
|
|
viewer.SetColor(gui.NewQColor6("#fafafa"))
|
|
viewer.Show()
|
|
|
|
app.Exec()
|
|
}
|