"quick": get rid of JS glue code (now done in Qt/C++, better and safer); only drawback is "Lisp.call()" max. argument limit (currently 16, but could be extended);

This commit is contained in:
polos 2017-02-07 10:31:11 +01:00
parent 763040a437
commit 5403e5db46
22 changed files with 494 additions and 104 deletions

View file

@ -16,7 +16,9 @@
#:js
#:qml-get
#:qml-set
#:paint
#:reload
#:root-context
#:root-item))
(provide :qml-lisp)
@ -81,6 +83,10 @@
(when *quick-view*
(|rootObject| *quick-view*)))
(defun root-context ()
(when *quick-view*
(|rootContext| *quick-view*)))
(defun find-quick-item (object-name)
"Finds the first QQuickItem matching OBJECT-NAME."
(if (string= (|objectName| (root-item)) object-name)
@ -131,7 +137,7 @@
(defun js (item/name js-format-string &rest arguments)
"Evaluates a JS string, with 'this' bound to either ITEM, or first object matching NAME. Arguments are passed through FORMAT."
(qlet ((qml-exp "QQmlExpression(QQmlContext*,QObject*,QString)"
(|rootContext| *quick-view*)
(root-context)
(quick-item item/name)
(apply 'format nil js-format-string arguments))
(variant (|evaluate| qml-exp)))