-
Notifications
You must be signed in to change notification settings - Fork 738
/
main.go
41 lines (30 loc) · 1.03 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//source: https://doc.qt.io/qt-5/qt3d-audio-visualizer-qml-example.html
package main
import (
"os"
"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 format = gui.NewQSurfaceFormat()
if true /*TODO: gui.QOpenGLContext__OpenGLModuleType == gui.QOpenGLContext__LibGL*/ {
format.SetVersion(3, 2)
format.SetProfile(gui.QSurfaceFormat__CoreProfile)
}
format.SetDepthBufferSize(24)
format.SetStencilBufferSize(8)
var view = quick.NewQQuickView(nil)
view.SetFormat(format)
view.Create()
var touchSettings = NewTouchSettings(nil)
view.RootContext().SetContextProperty("touchSettings", touchSettings)
view.SetSource(core.NewQUrl3("qrc:/main.qml", 0))
view.SetResizeMode(quick.QQuickView__SizeRootObjectToView)
view.SetMaximumSize(core.NewQSize2(1820, 1080))
view.SetMinimumSize(core.NewQSize2(300, 150))
view.Show()
app.Exec()
}