nimqml/examples/abstractitemmodel/main.nim

25 lines
470 B
Nim

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()