make example work on android; revisions

This commit is contained in:
pls.153 2022-02-11 13:05:59 +01:00
parent 113386fdae
commit 99ea5a081d
49 changed files with 637 additions and 133 deletions

View file

@ -16,7 +16,7 @@ win32 {
HEADERS += \
lib.h \
../../src/cpp/marshal.h \
../../src/cpp/qt_ech.h
../../src/cpp/qt_ecl.h
SOURCES += \
lib.cpp \

View file

@ -20,7 +20,7 @@ QObject* ini() {
return cpp;
}
// functiones defined Q_INVOKABLE
// functions defined Q_INVOKABLE
QVariant CPP::hello(const QVariant& arg) {

View file

@ -23,9 +23,18 @@ the argument and return type simply being defined as `QVariant`, you may also
pass lists, because a `QVariant` can also be of type `QVariantList`, so this
is a perfect fit for (nested) Lisp lists.
So, we pass a nested Lisp list, and it gets shown on Qt side with the
respective types. Then the `QVariantList` is returned to Lisp, where it is
So, we pass a nested Lisp list, and it gets converted and shown on Qt side with
the respective types. Then the `QVariantList` is returned to Lisp, where it is
automatically converted back to a nested Lisp list.
Really convenient!
From the second function -- which calls back to Lisp -- we can see that it
suffices to simply pass some intuitive, primitive C++ values to `ecl_fun`,
which will be converted automatically (using `QVariant`) to the appropriate
Lisp values.
**Conclusion**: by only allowing `QVariant` arguments for calls between Lisp
and C++/Qt, we simplify things to a point where it becomes trivial, especially
considering nested lists on both sides.