Re: [EQL5] Making a model available for a ListView in QML
Erik Winkels <aerique-qWit8jRvyhVmR6Xm/[email protected]> Wed, 16 Dec 2020 12:42:54 +0100
| Newsgroups | gmane.lisp.ecl.general |
|---|---|
| Message-ID | <[email protected]> |
Some progress, although I haven't tried updating the model from Lisp
yet, but to make sure you guys don't dive into it. This works for the
model defined in ECL and showing it in a QML ListView:
(defun set-my-model ()
(eql:qlet ((data (eql:qvariant-from-value *pushover-messages*
"QStringList")))
(eql:|setContextProperty| (eql:|rootContext| (qml:qview))
"myModel"
data)))
So I was falling into my common trap of running on too many assumptions.
I also called `set-my-model` before `(ini-quick-view (main-qml))` as
used in Renaud's template.
The examples help! It's a pity my use-case doesn't fit them 1 on 1.
Regards,
Erik