feat: add signal handler for status-go

This commit is contained in:
Richard Ramos 2020-05-16 21:28:07 -04:00
parent 5c42890e5b
commit 79025e4687
No known key found for this signature in database
GPG Key ID: 80D4B01265FDFE8F
3 changed files with 11 additions and 0 deletions

View File

@ -29,3 +29,8 @@ include "nimqml/private/qabstracttablemodel.nim"
include "nimqml/private/qresource.nim"
include "nimqml/private/qdeclarative.nim"
include "nimqml/private/nimqmlmacros.nim"
proc signal_handler*(receiver: pointer, signal: cstring, slot: cstring) =
var dosqobj = cast[DosQObject](receiver)
if(dosqobj.isNil == false):
dos_signal(receiver, signal, slot)

View File

@ -191,6 +191,9 @@ proc dos_qmetaobject_create(superclassMetaObject: DosQMetaObject,
propertyDefinitions: ptr DosPropertyDefinitions): DosQMetaObject {.cdecl, dynlib: dynLibName, importc.}
proc dos_qmetaobject_delete(vptr: DosQMetaObject) {.cdecl, dynlib: dynLibName, importc.}
# status-go signal handler
proc dos_signal(vptr: pointer, signal: cstring, slot: cstring) {.cdecl, dynlib: dynLibName, importc.}
# QUrl
proc dos_qurl_create(url: cstring, parsingMode: cint): DosQUrl {.cdecl, dynlib: dynLibName, importc.}
proc dos_qurl_delete(vptr: DosQUrl) {.cdecl, dynlib: dynLibName, importc.}

View File

@ -68,3 +68,6 @@ proc newQObject*(): QObject =
## Create a new QObject
new(result, delete)
result.setup()
proc vptr*(self: QObject): DosQObject =
result = self.vptr