nimqml/examples/abstractitemmodel/main.nim

25 lines
470 B
Nim
Raw Normal View History

2015-09-14 21:38:02 +00:00
import NimQml, MyListModel
proc mainProc() =
echo "Starting"
var app = newQApplication()
defer: app.delete
var myListModel = newMyListModel();
defer: myListModel.delete
var engine = newQQmlApplicationEngine()
defer: engine.delete
var variant = newQVariant(myListModel)
defer: variant.delete
engine.rootContext.setContextProperty("myListModel", variant)
engine.load("main.qml")
app.exec()
when isMainModule:
mainProc()
GC_fullcollect()