2020-07-25
I just made a quite important update for users of QML. You'll need to upgrade your eql5 desktop version to the latest commit (eql5 version 20.7.1
).
Run your app (on the desktop, even if destined for mobile) as usual, example:
$ eql5 run.lisp # use -qtpl if not set in ~/.eclrc
To generate all UI variable names, simply call:
> (qml) ; or (eql:qml)
This will generate a file lisp/ui-vars.lisp
. In the case of the sokoban example, it looks like this:
;;; THIS FILE IS GENERATED, see '(eql:qml)'
(defpackage ui
(:use :cl :eql)
(:export
#:*board*
#:*buttons1*
#:*buttons2*
#:*down*
#:*left*
#:*level*
#:*next*
#:*previous*
#:*restart*
#:*right*
#:*rotate-player*
#:*solve*
#:*undo*
#:*up*
#:*wiggle-box*
#:*zoom-board-in*
#:*zoom-board-out*))
(provide :ui-vars)
(in-package :ui)
(defparameter *down* "down") ; Button "qml/sokoban.qml"
(defparameter *left* "left") ; Button "qml/sokoban.qml"
(defparameter *next* "next") ; Button "qml/sokoban.qml"
(defparameter *previous* "previous") ; Button "qml/sokoban.qml"
(defparameter *restart* "restart") ; Button "qml/sokoban.qml"
(defparameter *right* "right") ; Button "qml/sokoban.qml"
(defparameter *solve* "solve") ; Button "qml/sokoban.qml"
(defparameter *undo* "undo") ; Button "qml/sokoban.qml"
(defparameter *up* "up") ; Button "qml/sokoban.qml"
(defparameter *board* "board") ; Rectangle "qml/sokoban.qml"
(defparameter *rotate-player* "rotate_player") ; RotationAnimation "qml/items/player.qml"
(defparameter *buttons1* "buttons1") ; Row "qml/sokoban.qml"
(defparameter *buttons2* "buttons2") ; Row "qml/sokoban.qml"
(defparameter *zoom-board-in* "zoom_board_in") ; ScaleAnimator "qml/sokoban.qml"
(defparameter *zoom-board-out* "zoom_board_out") ; ScaleAnimator "qml/sokoban.qml"
(defparameter *wiggle-box* "wiggle_box") ; SequentialAnimation "qml/items/box2.qml"
(defparameter *level* "level") ; Slider "qml/sokoban.qml"
As you can see, the variable names are conveniently sorted alphabetically in the export list, and are listed below sorted by the QML class name, showing also the file path of the QML file.
The generated file will also be loaded immediately, this is important for interactive development.
Here a summary of this important update:
objectName
are now generated automatically
(eql:qml)
again
In hindsight, I should have added the above much earlier...
P.S. I also fixed an issue which made it impossible to run/develop the eql-ios examples on the desktop (sorry for that).
P.P.S. A convenience note for usage of eql5 from a console: switch to ~/.eql5/lib/
and run ecl --compile ecl-readline.lisp
(very convenient, since it offers both line history and Tab completion). In case it doesn't work, check if you have C readline/ncurses installed.