revision of 'qml.lisp'

This commit is contained in:
polos 2021-03-13 17:48:44 +01:00
parent 799cc1de36
commit 089ba6521d

View file

@ -5,35 +5,6 @@
;;; * allows to evaluate JS code from Lisp (needs 'objectName' to be set)
;;;
(defpackage :qml-lisp
(:use :common-lisp :eql)
(:nicknames :qml)
(:export
#:*quick-view*
#:*caller*
#:children
#:file-to-url
#:find-quick-item
#:ini-quick-view
#:js
#:js-arg
#:qml-call
#:qml-get
#:qml-set
#:qml-set-all
#:q!
#:q<
#:q>
#:q>*
#:qjs
#:paint
#:scale
#:reload
#:root-context
#:root-item))
(provide :qml-lisp)
(in-package :qml-lisp)
(defvar *quick-view* nil)
@ -213,8 +184,10 @@
;;; ini
(defun ini-quick-view (file)
(setf *quick-view* (qnew "QQuickView"))
(defun ini-quick-view (file &optional widget)
(setf *quick-view* (qnew (if widget
"QQuickWidget" ; needed for 'PaintedItem'
"QQuickView")))
;; special settings for mobile, taken from Qt example
(let ((env (ext:getenv "QT_QUICK_CORE_PROFILE")))
(when (and (stringp env)