From 8f868496a814dbb484588dfc70ea5b452b2b0994 Mon Sep 17 00:00:00 2001 From: Filippo Cucchetto Date: Sun, 22 Nov 2015 23:27:37 +0100 Subject: [PATCH] Updated to Nim 0.12.1 and added {.base.} pragmas --- README.md | 2 +- .../abstractitemmodel/abstractitemmodel.nimble | 2 +- examples/contactapp/contactapp.nimble | 2 +- examples/helloworld/helloworld.nimble | 2 +- examples/qtobjectmacro/qtobjectmacro.nimble | 2 +- examples/simpledata/simpledata.nimble | 2 +- .../slotsandproperties/slotsandproperties.nimble | 2 +- nimqml.nimble | 4 ++-- src/nimqml.nim | 16 ++++++++-------- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 8693bc7..e850d45 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ QML binding for the Nim programming language ## Requirements * [DOtherside](https://github.com/filcuc/DOtherSide) 0.4.5 or higher -* [Nim](http://nim-lang.org/) 0.11.2 or higher +* [Nim](http://nim-lang.org/) 0.12.1 or higher ## Build instructions * Compile and Install DOtherside in your system PATH (i.e. /usr/lib) diff --git a/examples/abstractitemmodel/abstractitemmodel.nimble b/examples/abstractitemmodel/abstractitemmodel.nimble index 7c1e6db..10b76ae 100644 --- a/examples/abstractitemmodel/abstractitemmodel.nimble +++ b/examples/abstractitemmodel/abstractitemmodel.nimble @@ -7,4 +7,4 @@ description = "abstractitemmodel" license = "MIT" [Deps] -Requires: "nim >= 0.11.2, nimqml >= 0.4.5" +Requires: "nim >= 0.12.1, nimqml >= 0.4.7" diff --git a/examples/contactapp/contactapp.nimble b/examples/contactapp/contactapp.nimble index 29a2e05..d9a3d4a 100644 --- a/examples/contactapp/contactapp.nimble +++ b/examples/contactapp/contactapp.nimble @@ -7,4 +7,4 @@ description = "contactapp" license = "MIT" [Deps] -Requires: "nim >= 0.11.2, nimqml >= 0.4.5" +Requires: "nim >= 0.12.1, nimqml >= 0.4.7" diff --git a/examples/helloworld/helloworld.nimble b/examples/helloworld/helloworld.nimble index 7995732..7d91047 100644 --- a/examples/helloworld/helloworld.nimble +++ b/examples/helloworld/helloworld.nimble @@ -7,4 +7,4 @@ description = "helloworld" license = "MIT" [Deps] -Requires: "nim >= 0.11.2, nimqml >= 0.4.5" +Requires: "nim >= 0.12.1, nimqml >= 0.4.7" diff --git a/examples/qtobjectmacro/qtobjectmacro.nimble b/examples/qtobjectmacro/qtobjectmacro.nimble index 4c49740..e8b45f5 100644 --- a/examples/qtobjectmacro/qtobjectmacro.nimble +++ b/examples/qtobjectmacro/qtobjectmacro.nimble @@ -7,4 +7,4 @@ description = "qtobjectmacro" license = "MIT" [Deps] -Requires: "nim >= 0.11.2, nimqml >= 0.4.5" +Requires: "nim >= 0.12.1, nimqml >= 0.4.7" diff --git a/examples/simpledata/simpledata.nimble b/examples/simpledata/simpledata.nimble index d367024..9b66058 100644 --- a/examples/simpledata/simpledata.nimble +++ b/examples/simpledata/simpledata.nimble @@ -7,4 +7,4 @@ description = "simpledata" license = "MIT" [Deps] -Requires: "nim >= 0.11.2, nimqml >= 0.4.5" +Requires: "nim >= 0.12.1, nimqml >= 0.4.7" diff --git a/examples/slotsandproperties/slotsandproperties.nimble b/examples/slotsandproperties/slotsandproperties.nimble index 5bcec79..074ccd2 100644 --- a/examples/slotsandproperties/slotsandproperties.nimble +++ b/examples/slotsandproperties/slotsandproperties.nimble @@ -7,4 +7,4 @@ description = "slotsandproperties" license = "MIT" [Deps] -Requires: "nim >= 0.11.2, nimqml >= 0.4.5" +Requires: "nim >= 0.12.1, nimqml >= 0.4.7" diff --git a/nimqml.nimble b/nimqml.nimble index bb75f84..9f622cc 100644 --- a/nimqml.nimble +++ b/nimqml.nimble @@ -1,10 +1,10 @@ [Package] name = "nimqml" -version = "0.4.6" +version = "0.4.7" author = "Filippo Cucchetto, Will Szumski" description = "QML bindings for Nim" license = "LGPLv3" srcDir = "src" [Deps] -Requires: "nim >= 0.11.2" +Requires: "nim >= 0.12.1" diff --git a/src/nimqml.nim b/src/nimqml.nim index ddf172e..fb36469 100644 --- a/src/nimqml.nim +++ b/src/nimqml.nim @@ -360,7 +360,7 @@ proc dos_qobject_signal_create(qobject: RawQObject, signalName: cstring, argumen proc dos_qobject_signal_emit(qobject: RawQObject, signalName: cstring, argumentsCount: cint, arguments: ptr RawQVariant) {.cdecl, importc.} proc dos_qobject_property_create(qobject: RawQObject, propertyName: cstring, propertyType: cint, readSlot: cstring, writeSlot: cstring, notifySignal: cstring) {.cdecl, importc.} -method onSlotCalled*(nimobject: QObject, slotName: string, args: openarray[QVariant]) = +method onSlotCalled*(nimobject: QObject, slotName: string, args: openarray[QVariant]) {.base.} = ## Called from the NimQml bridge when a slot is called from Qml. ## Subclasses can override the given method for handling the slot call discard() @@ -632,7 +632,7 @@ proc dos_qabstractlistmodel_dataChanged(model: RawQAbstractListModel, rolesArrayPtr: ptr cint, rolesArrayLength: cint) {.cdecl, importc.} -method rowCount*(model: QAbstractListModel, index: QModelIndex): cint = +method rowCount*(model: QAbstractListModel, index: QModelIndex): cint {.base.} = ## Return the model's row count return 0 @@ -642,7 +642,7 @@ proc rowCountCallback(modelObject: ptr QAbstractListModelObj, rawIndex: RawQMode let index = newQModelIndex(rawIndex) result = model.rowCount(index) -method columnCount*(model: QAbstractListModel, index: QModelIndex): cint = +method columnCount*(model: QAbstractListModel, index: QModelIndex): cint {.base.} = ## Return the model's column count return 1 @@ -652,7 +652,7 @@ proc columnCountCallback(modelObject: ptr QAbstractListModelObj, rawIndex: RawQM let index = newQModelIndex(rawIndex) result = model.columnCount(index) -method data*(model: QAbstractListModel, index: QModelIndex, role: cint): QVariant = +method data*(model: QAbstractListModel, index: QModelIndex, role: cint): QVariant {.base.} = ## Return the data at the given model index and role return nil @@ -665,7 +665,7 @@ proc dataCallback(modelObject: ptr QAbstractListModelObj, rawIndex: RawQModelInd dos_qvariant_assign(result, variant.data) variant.delete -method setData*(model: QAbstractListModel, index: QModelIndex, value: QVariant, role: cint): bool = +method setData*(model: QAbstractListModel, index: QModelIndex, value: QVariant, role: cint): bool {.base.} = ## Sets the data at the given index and role. Return true on success, false otherwise return false @@ -676,7 +676,7 @@ proc setDataCallback(modelObject: ptr QAbstractListModelObj, rawIndex: RawQModel let variant = newQVariant(rawQVariant) result = model.setData(index, variant, role) -method roleNames*(model: QAbstractListModel): Table[cint, cstring] = +method roleNames*(model: QAbstractListModel): Table[cint, cstring] {.base.} = ## Return the model role names result = initTable[cint, cstring]() @@ -687,7 +687,7 @@ proc roleNamesCallback(modelObject: ptr QAbstractListModelObj, hash: RawQHashInt for key, val in table.pairs: dos_qhash_int_qbytearray_insert(hash, key, val) -method flags*(model: QAbstractListModel, index: QModelIndex): QtItemFlag = +method flags*(model: QAbstractListModel, index: QModelIndex): QtItemFlag {.base.} = ## Return the item flags and the given index return QtItemFlag.None @@ -697,7 +697,7 @@ proc flagsCallback(modelObject: ptr QAbstractListModelObj, rawIndex: RawQModelIn let index = newQModelIndex(rawIndex) result = model.flags(index).cint -method headerData*(model: QAbstractListModel, section: cint, orientation: QtOrientation, role: cint): QVariant = +method headerData*(model: QAbstractListModel, section: cint, orientation: QtOrientation, role: cint): QVariant {.base.} = ## Returns the data for the given role and section in the header with the specified orientation return nil