add 'qml-call' to all 'quick' examples (for calling QML methods)

This commit is contained in:
polos 2017-08-03 15:17:08 +02:00
parent a5d8640ca6
commit 955734e192
7 changed files with 56 additions and 0 deletions

View file

@ -1,6 +1,7 @@
;;;
;;; * enables QML to call Lisp functions
;;; * allows to get/set any QML property from Lisp (needs 'objectName' to be set)
;;; * allows to call QML methods from Lisp (needs 'objectName' to be set)
;;; * allows to evaluate JS code from Lisp (needs 'objectName' to be set)
;;;
@ -13,6 +14,7 @@
#:children
#:find-quick-item
#:js
#:qml-call
#:qml-get
#:qml-set
#:qml-set-all
@ -113,6 +115,12 @@
(|clearComponentCache| (|engine| *quick-view*))
(|setSource| *quick-view* (|source| *quick-view*)))
;;; call QML methods
(defun qml-call (item/name method-name &rest arguments)
;; QFUN+ comes in handy here
(apply 'qfun+ (quick-item item/name) method-name arguments))
;;; get/set QQmlProperty
(defun qml-get (item/name property-name)