small revisions

This commit is contained in:
polos 2017-03-25 15:07:52 +01:00
parent e28e2a4af3
commit d961d400f1
2 changed files with 10 additions and 4 deletions

View file

@ -3,8 +3,13 @@ INFO
This shows the use of a QML ApplicationWindow and a TableView.
The data source part is identical to the "item-model/abstract-model"
The data source part is very similar to the "item-model/abstract-model"
example.
Additionally, a QSortFilterProxyModel is used for both search
and sorting.
Additionally, a QSortFilterProxyModel is used for both search and sorting.
RUN
===
Run "table-view.lisp" from this directory.

View file

@ -38,7 +38,8 @@
(defun make-book-model ()
(setf *book-model* (qnew "QAbstractListModel"))
(qoverride *book-model* "rowCount(QModelIndex)"
(lambda (index) (length *books*)))
(lambda (index)
(length *books*)))
(qoverride *book-model* "data(QModelIndex,int)" ; QOVERRIDE return value is GC'd
(lambda (index role)
(let* ((row (|row| index))