mirror of
https://gitlab.com/eql/EQL5.git
synced 2025-12-06 10:31:19 -08:00
"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:
parent
763040a437
commit
5403e5db46
22 changed files with 494 additions and 104 deletions
|
|
@ -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)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue