mirror of
https://gitlab.com/eql/EQL5.git
synced 2025-12-13 05:40:25 -08:00
another review of "qml-lisp"
This commit is contained in:
parent
140e793040
commit
43abbe2415
7 changed files with 84 additions and 50 deletions
|
|
@ -10,37 +10,12 @@ static QObject* lisp_provider(QQmlEngine*, QJSEngine*) { return lisp; }
|
|||
QObject* ini() {
|
||||
if(!lisp) {
|
||||
lisp = new Lisp;
|
||||
qmlRegisterSingletonType<Lisp>("EQL5", 1, 0, "Lisp", lisp_provider); }
|
||||
qmlRegisterSingletonType<Lisp>("EQL5", 1, 0, "EQL5", lisp_provider); }
|
||||
return lisp; }
|
||||
|
||||
QString Lisp::fun(const QString& function,
|
||||
const QVariant& argument1, const QVariant& argument2, const QVariant& argument3,
|
||||
const QVariant& argument4, const QVariant& argument5, const QVariant& argument6,
|
||||
const QVariant& argument7, const QVariant& argument8, const QVariant& argument9) {
|
||||
QVariantList arguments;
|
||||
if(!argument1.isNull()) {
|
||||
arguments << argument1;
|
||||
if(!argument2.isNull()) {
|
||||
arguments << argument2;
|
||||
if(!argument3.isNull()) {
|
||||
arguments << argument3;
|
||||
if(!argument4.isNull()) {
|
||||
arguments << argument4;
|
||||
if(!argument5.isNull()) {
|
||||
arguments << argument5;
|
||||
if(!argument6.isNull()) {
|
||||
arguments << argument6;
|
||||
if(!argument7.isNull()) {
|
||||
arguments << argument7;
|
||||
if(!argument8.isNull()) {
|
||||
arguments << argument8;
|
||||
if(!argument9.isNull()) {
|
||||
arguments << argument9; }}}}}}}}}
|
||||
return apply(function, arguments); }
|
||||
|
||||
QString Lisp::apply(const QString& function, const QVariantList& arguments) {
|
||||
QVariant ret =
|
||||
eql_fun("eql::qml-apply", QVariant::String,
|
||||
eql_fun("qml:qml-apply", QVariant::String,
|
||||
Q_ARG(QString, function),
|
||||
Q_ARG(QVariantList, arguments));
|
||||
return ret.toString(); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue