Made QModelIndex safer by always coping values

This commit is contained in:
Filippo Cucchetto 2016-02-25 23:36:22 +01:00
parent 74d0e47281
commit 4124153d3e
2 changed files with 3 additions and 1 deletions

View File

@ -159,6 +159,7 @@ proc dos_qhash_int_qbytearray_value(qHash: DosQHashIntByteArray, key: int, value
# QModelIndex # QModelIndex
proc dos_qmodelindex_create(modelIndex: var DosQModelIndex) {.cdecl, importc.} proc dos_qmodelindex_create(modelIndex: var DosQModelIndex) {.cdecl, importc.}
proc dos_qmodelindex_create_qmodelindex(modelIndex: var DosQModelIndex, other: DosQModelIndex) {.cdecl, importc.}
proc dos_qmodelindex_delete(modelIndex: DosQModelIndex) {.cdecl, importc.} proc dos_qmodelindex_delete(modelIndex: DosQModelIndex) {.cdecl, importc.}
proc dos_qmodelindex_row(modelIndex: DosQModelIndex, row: var cint) {.cdecl, importc.} proc dos_qmodelindex_row(modelIndex: DosQModelIndex, row: var cint) {.cdecl, importc.}
proc dos_qmodelindex_column(modelIndex: DosQModelIndex, column: var cint) {.cdecl, importc.} proc dos_qmodelindex_column(modelIndex: DosQModelIndex, column: var cint) {.cdecl, importc.}
@ -167,6 +168,7 @@ proc dos_qmodelindex_data(modelIndex: DosQModelIndex, role: cint, data: DosQVari
proc dos_qmodelindex_parent(modelIndex: DosQModelIndex, parent: DosQModelIndex) {.cdecl, importc.} proc dos_qmodelindex_parent(modelIndex: DosQModelIndex, parent: DosQModelIndex) {.cdecl, importc.}
proc dos_qmodelindex_child(modelIndex: DosQModelIndex, row: cint, column: cint, parent: DosQModelIndex) {.cdecl, importc.} proc dos_qmodelindex_child(modelIndex: DosQModelIndex, row: cint, column: cint, parent: DosQModelIndex) {.cdecl, importc.}
proc dos_qmodelindex_sibling(modelIndex: DosQModelIndex, row: cint, column: cint, sibling: DosQModelIndex) {.cdecl, importc.} proc dos_qmodelindex_sibling(modelIndex: DosQModelIndex, row: cint, column: cint, sibling: DosQModelIndex) {.cdecl, importc.}
proc dos_qmodelindex_assign(leftSide: DosQModelIndex, rightSide: DosQModelIndex) {.cdecl, importc.}
# QAbstractListModel # QAbstractListModel
proc dos_qabstractlistmodel_create(model: var DosQAbstractListModel, proc dos_qabstractlistmodel_create(model: var DosQAbstractListModel,

View File

@ -4,7 +4,7 @@ proc setup*(self: QModelIndex) =
proc setup(self: QModelIndex, vptr: DosQModelIndex) = proc setup(self: QModelIndex, vptr: DosQModelIndex) =
## Setup a new QModelIndex ## Setup a new QModelIndex
self.vptr = vptr dos_qmodelindex_create_qmodelindex(self.vptr, vptr)
proc delete*(self: QModelIndex) = proc delete*(self: QModelIndex) =
## Delete the given QModelIndex ## Delete the given QModelIndex