Commit ed5afdfc authored by Black Hat's avatar Black Hat

Move UI into a package.

parent 77c3fedd
package db
type Controller struct {
}
......@@ -6,6 +6,7 @@ import (
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/gui"
"github.com/therecipe/qt/qml"
"matrique/ui"
)
func main() {
......@@ -14,14 +15,14 @@ func main() {
gui.NewQGuiApplication(len(os.Args), os.Args)
Controller_QmlRegisterType2("Matrique", 0, 1, "Controller")
RoomListModel_QmlRegisterType2("Matrique", 0, 1, "RoomListModel")
ui.Controller_QmlRegisterType2("Matrique", 0, 1, "Controller")
ui.RoomListModel_QmlRegisterType2("Matrique", 0, 1, "RoomListModel")
var app = qml.NewQQmlApplicationEngine(nil)
pro := NewImageProvider(nil)
pro := ui.NewImageProvider(nil)
pro.Init()
app.AddImageProvider("mxc", pro.provider)
app.AddImageProvider("mxc", pro.GetProvider())
app.RootContext().SetContextProperty("imageProvider", pro)
......
package main
package ui
import (
"fmt"
......
package main
package ui
import (
"fmt"
......@@ -83,3 +83,7 @@ func (ip *ImageProvider) Init() {
func (ip *ImageProvider) setServerAddr(addr string) {
ip.serverAddr = addr
}
func (ip *ImageProvider) GetProvider() *quick.QQuickImageProvider {
return ip.provider
}
package main
package ui
import (
"github.com/therecipe/qt/core"
......
package main
package ui
import (
"github.com/therecipe/qt/core"
......
package main
package ui
func checkErr(err error) {
if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment