From a3dabe05c3676955fbf3c0747544f8dd4860739b Mon Sep 17 00:00:00 2001 From: Filippo Cucchetto Date: Sun, 21 Feb 2016 18:36:38 +0100 Subject: [PATCH] Fixed with the changes in the DOtherSide library --- src/private/dotherside.nim | 6 +++--- src/private/qmetaobject.nim | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) 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)