-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.go
More file actions
45 lines (34 loc) · 1.16 KB
/
Copy pathmain.go
File metadata and controls
45 lines (34 loc) · 1.16 KB
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
42
43
44
45
package main
import (
"os"
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/quick"
"github.com/therecipe/qt/widgets"
)
var (
receiveBridge *ReceiveBridge
senderBridge *SenderBridge
settingsBridge *SettingsBridge
receiverTableModel *RecvFileTableModel
senderTableModel *SendFileTableModel
)
const BufferSize = 1024
func init() {
RecvFileTableModel_QmlRegisterType2("CustomQmlTypes", 1, 0, "RecvFileTableModel")
SendFileTableModel_QmlRegisterType2("CustomQmlTypes", 1, 0, "SendFileTableModel")
ReceiveBridge_QmlRegisterType2("CustomQmlTypes", 1, 0, "ReceiveBridge")
SenderBridge_QmlRegisterType2("CustomQmlTypes", 1, 0, "SenderBridge")
SettingsBridge_QmlRegisterType2("CustomQmlTypes", 1, 0, "SettingsBridge")
}
func main() {
core.QCoreApplication_SetAttribute(core.Qt__AA_EnableHighDpiScaling, true)
receiverTableModel = NewRecvFileTableModel(nil)
senderTableModel = NewSendFileTableModel(nil)
app := widgets.NewQApplication(len(os.Args), os.Args)
view := quick.NewQQuickView(nil)
view.SetTitle("Rosen")
view.SetResizeMode(quick.QQuickView__SizeRootObjectToView)
view.SetSource(core.NewQUrl3("qrc:/qml/rosen.qml", 0))
view.Show()
app.Exec()
}