fix 'reload'

This commit is contained in:
pls.153 2022-01-17 16:07:53 +01:00
parent 261c214af0
commit cb968f2d92
4 changed files with 8 additions and 4 deletions

View file

@ -2,7 +2,7 @@
Build Build
----- -----
Currently still using qmake, will be ported to CMake Currently still using qmake, will be ported to CMake.
* make sure you have both **ECL** and **Qt6** installed * make sure you have both **ECL** and **Qt6** installed
* make sure to use `qmake` from Qt6 * make sure to use `qmake` from Qt6

View file

@ -45,7 +45,7 @@ void iniCLFunctions() {
DEFUN ("qtranslate", qtranslate, 3) DEFUN ("qtranslate", qtranslate, 3)
DEFUN ("qutf8", qutf8, 1) DEFUN ("qutf8", qutf8, 1)
DEFUN ("qversion", qversion, 0) DEFUN ("qversion", qversion, 0)
DEFUN ("reload", reload, 0) DEFUN ("%reload", reload2, 0)
DEFUN ("root-item", root_item, 0) DEFUN ("root-item", root_item, 0)
DEFUN ("%set-shutdown-p", set_shutdown_p, 1) DEFUN ("%set-shutdown-p", set_shutdown_p, 1)
} }
@ -461,7 +461,7 @@ cl_object pixel_ratio() {
ecl_return1(ecl_process_env(), l_ret); ecl_return1(ecl_process_env(), l_ret);
} }
cl_object reload() { cl_object reload2() {
LQML::quickView->engine()->clearComponentCache(); LQML::quickView->engine()->clearComponentCache();
QUrl source(LQML::quickView->source()); QUrl source(LQML::quickView->source());
LQML::quickView->setSource(source); LQML::quickView->setSource(source);

View file

@ -75,7 +75,7 @@ cl_object qsingle_shot2 (cl_object, cl_object);
cl_object qtranslate (cl_object, cl_object, cl_object); cl_object qtranslate (cl_object, cl_object, cl_object);
cl_object qutf8 (cl_object); cl_object qutf8 (cl_object);
cl_object qversion (); cl_object qversion ();
cl_object reload (); cl_object reload2 ();
cl_object root_item (); cl_object root_item ();
cl_object set_shutdown_p (cl_object); cl_object set_shutdown_p (cl_object);

View file

@ -105,6 +105,10 @@
"Like QML function 'children'." "Like QML function 'children'."
(qrun* (qchild-items (quick-item item/name)))) (qrun* (qchild-items (quick-item item/name))))
(defun reload ()
"Reloads all QML files, clearing the cache."
(qrun* (%reload)))
;;; get/set QML properties, call QML methods (through JS) ;;; get/set QML properties, call QML methods (through JS)
(defun qml-get (item/name property-name) (defun qml-get (item/name property-name)