[EQL5] Making a model available for a ListView in QML

Erik Winkels aerique at xs4all.nl
Wed Dec 16 11:42:54 UTC 2020


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



More information about the ecl-devel mailing list