mirror of https://github.com/status-im/nimqml.git
feat: add signal handler for status-go
This commit is contained in:
parent
5c42890e5b
commit
79025e4687
|
@ -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)
|
||||
|
|
|
@ -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.}
|
||||
|
|
|
@ -68,3 +68,6 @@ proc newQObject*(): QObject =
|
|||
## Create a new QObject
|
||||
new(result, delete)
|
||||
result.setup()
|
||||
|
||||
proc vptr*(self: QObject): DosQObject =
|
||||
result = self.vptr
|
||||
|
|
Loading…
Reference in New Issue