From ccdf5b328eabce0c4cacb57de9c3b857a15c3b71 Mon Sep 17 00:00:00 2001 From: "pls.153" Date: Wed, 9 Mar 2022 17:51:24 +0100 Subject: [PATCH] revision --- examples/advanced-qml-auto-reload/readme.md | 2 +- examples/advanced-qml-auto-reload/run.lisp | 28 +++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 examples/advanced-qml-auto-reload/run.lisp diff --git a/examples/advanced-qml-auto-reload/readme.md b/examples/advanced-qml-auto-reload/readme.md index 0d2eefa..f08e216 100644 --- a/examples/advanced-qml-auto-reload/readme.md +++ b/examples/advanced-qml-auto-reload/readme.md @@ -23,7 +23,7 @@ It adds a QML `SwipeView` with 3 pages, to demonstrate how to reload single QML pages, without reloading the whole UI. This is important for nested UI pages, in order to not lose your current view in the UI. -Without the aboce feature, you would always land on the main view after +Without the above feature, you would always land on the main view after reloading QML. diff --git a/examples/advanced-qml-auto-reload/run.lisp b/examples/advanced-qml-auto-reload/run.lisp new file mode 100644 index 0000000..a7ff05a --- /dev/null +++ b/examples/advanced-qml-auto-reload/run.lisp @@ -0,0 +1,28 @@ +(in-package :qml-user) + +(require :asdf) + +(push (merge-pathnames "./") + asdf:*central-registry*) + +(asdf:operate 'asdf:load-source-op :app) + +(qset *quick-view* + |x| 75 + |y| 75) + +(defun option (name) + (find name (ext:command-args) :test 'search)) + +;;; trivial auto reload of all QML files after saving any change + +(when (option "-auto") + (load "lisp/qml-reload/auto-reload")) + +;;; for Slime after copying 'lqml-start-swank.lisp' from LQML sources +;;; to your Slime directory, which is assumed to be '~/slime/' + +(when (option "-slime") + (load "~/slime/lqml-start-swank")) ; for 'slime-connect' from Emacs + +(load "qml/.create-qml-loaders.lisp")