mirror of
https://gitlab.com/eql/EQL5.git
synced 2025-12-14 14:20:34 -08:00
add example "quick/Tic-Tac-Toe"; lots of minor revisions;
This commit is contained in:
parent
43abbe2415
commit
c7cefd839c
62 changed files with 1731 additions and 1004 deletions
25
examples/M-modules/quick/Tic-Tac-Toe/lib/qml_lisp.cpp
Normal file
25
examples/M-modules/quick/Tic-Tac-Toe/lib/qml_lisp.cpp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#include "qml_lisp.h"
|
||||
#include <eql_fun.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
static Lisp* lisp = 0;
|
||||
|
||||
static QObject* lisp_provider(QQmlEngine*, QJSEngine*) { return lisp; }
|
||||
|
||||
QObject* ini() {
|
||||
if(!lisp) {
|
||||
lisp = new Lisp;
|
||||
qmlRegisterSingletonType<Lisp>("EQL5", 1, 0, "EQL5", lisp_provider); }
|
||||
return lisp; }
|
||||
|
||||
QVariant Lisp::apply(const QString& function, const QVariantList& arguments) {
|
||||
QVariant ret =
|
||||
eql_fun("qml:qml-apply", QVariant::String,
|
||||
Q_ARG(QString, function),
|
||||
Q_ARG(QVariantList, arguments));
|
||||
if(ret.toString() == "NIL") {
|
||||
ret = QVariant(); }
|
||||
return ret; }
|
||||
|
||||
QT_END_NAMESPACE
|
||||
Loading…
Add table
Add a link
Reference in a new issue