diff --git a/src/private/dotherside.nim b/src/private/dotherside.nim index 6771797..c2d8ec7 100644 --- a/src/private/dotherside.nim +++ b/src/private/dotherside.nim @@ -134,9 +134,9 @@ proc dos_qabstractlistmodel_qmetaobject(vptr: var DosQmetaObject) {.cdecl import proc dos_qmetaobject_create(vptr: var DosQmetaObject, superclassMetaObject: DosQMetaObject, className: cstring, - signalDefinitions: DosSignalDefinitions, - slotDefinitions: DosSlotDefinitions, - propertyDefinitions: DosPropertyDefinitions) {.cdecl, importc.} + signalDefinitions: ptr DosSignalDefinitions, + slotDefinitions: ptr DosSlotDefinitions, + propertyDefinitions: ptr DosPropertyDefinitions) {.cdecl, importc.} proc dos_qmetaobject_delete(vptr: DosQmetaObject) {.cdecl, importc.} # QUrl diff --git a/src/private/qmetaobject.nim b/src/private/qmetaobject.nim index 6025d11..b3b04d6 100644 --- a/src/private/qmetaobject.nim +++ b/src/private/qmetaobject.nim @@ -59,7 +59,9 @@ proc newQMetaObject*(superClass: QMetaObject, className: string, notifySignal: notifySignal) dosProperties.add(dosProperty) + let signals = DosSignalDefinitions(count: dosSignals.len.cint, definitions: if dosSignals.len > 0: dosSignals[0].unsafeAddr else: nil) + let slots = DosSlotDefinitions(count: dosSlots.len.cint, definitions: if dosSlots.len > 0: dosSlots[0].unsafeAddr else: nil) + let properties = DosPropertyDefinitions(count: dosProperties.len.cint, definitions: if dosProperties.len > 0: dosProperties[0].unsafeAddr else: nil) + dos_qmetaobject_create(result.vptr, superClass.vptr, className.cstring, - DosSignalDefinitions(count: dosSignals.len.cint, definitions: if dosSignals.len > 0: dosSignals[0].unsafeAddr else: nil), - DosSlotDefinitions(count: dosSlots.len.cint, definitions: if dosSlots.len > 0: dosSlots[0].unsafeAddr else: nil), - DosPropertyDefinitions(count: dosProperties.len.cint, definitions: if dosProperties.len > 0: dosProperties[0].unsafeAddr else: nil)) + signals.unsafeAddr, slots.unsafeAddr, properties.unsafeAddr)