EQL5/examples/M-modules/quick/qml-lisp
2017-01-25 14:31:16 +01:00
..
lib "qml-lisp": allow for nested lists, vectors etc. as return values from QML function calls; some revisions; 2017-01-20 20:57:32 +01:00
qml add "eql5.js" to compiled eql5 lib resources; add class QResource; 2017-01-24 23:29:35 +01:00
example.lisp add new function QVARIANT-FROM-VALUE, needed in QML:QML-SET ("quick" examples) 2017-01-21 22:40:08 +01:00
qml-lisp.lisp review "qml-lisp" utility functions; no more JS needed in "tic-tac-toe" game logic; 2017-01-25 14:31:16 +01:00
README.txt add "eql5.js" to compiled eql5 lib resources; add class QResource; 2017-01-24 23:29:35 +01:00

A trivial example of calling Lisp functions from QML.


RUN
===

Please run it from this directory.

For Emacs/Slime, this would be:

    eql5 ~/slime/eql-start-swank.lisp example


GET/SET QML OBJECT PROPERTIES
=============================

You can access any QML property from Lisp (needs 'objectName' to be set).

Examples:

    (in-package :qml)

    (qml-get "label" "text")
    (qml-set "label" "color" "red")
    (qml-set "label" "font.pixelSize" 24)


QML FILES
=========

Always add these 2 "import" lines for Lisp access:

    import EQL5 1.0
    import "qrc:///eql5.js" as Lisp

The "eql5.js" file is compiled as a resource into the eql5 shared library,
see "eql5/src/eql5.js" and "eql5/src/eql5.qrc".


NOTES
=====

Please see also the documentation in "qml/example.qml".


TIP
===

In order to have uniform access to QML objects from both JS and Lisp
functions, it is convenient to set both 'id:' and 'objectName:' to the
same name.

QML Example:

    Item {
        id: myItem
        objectName: "myItem"
    }