mirror of
https://gitlab.com/eql/lqml.git
synced 2025-12-06 02:30:38 -08:00
review marshalling docu, remove obsolete QStringList (use QVariantList instead)
This commit is contained in:
parent
6d1be2a51f
commit
39deb3199a
4 changed files with 6 additions and 25 deletions
|
|
@ -12,6 +12,9 @@ Function `ecl_fun()` is convenient because you don't need to care about type
|
||||||
conversions, as long as you only use `bool`, `long`, `double`, `QString`,
|
conversions, as long as you only use `bool`, `long`, `double`, `QString`,
|
||||||
`QByteArray` or (nested) `QVariant` lists of mentioned types.
|
`QByteArray` or (nested) `QVariant` lists of mentioned types.
|
||||||
|
|
||||||
|
For the complete list of marshalled types please see `toQVariant()` and
|
||||||
|
`from_qvariant` in [marshal.cpp](../src/cpp/marshal.cpp).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Build
|
Build
|
||||||
|
|
|
||||||
|
|
@ -454,8 +454,9 @@ cl_object qinvoke_method2(cl_object l_obj, cl_object l_name, cl_object l_args) {
|
||||||
// for internal use: this is used to call user defined JS functions, and to
|
// for internal use: this is used to call user defined JS functions, and to
|
||||||
// call user defined Qt/C++ plugin functions.
|
// call user defined Qt/C++ plugin functions.
|
||||||
// Max. 10 arguments of type T, NIL, INTEGER, FLOAT, STRING, VECTOR of
|
// Max. 10 arguments of type T, NIL, INTEGER, FLOAT, STRING, VECTOR of
|
||||||
// octets, (nested) LIST of mentioned arguments. On Qt side, only QVariant
|
// octets, (nested) LIST of mentioned arguments.
|
||||||
// arguments are allowed.
|
// For the complete list of supported types see 'marshal.cpp:toQVariant()'.
|
||||||
|
// On Qt side, only QVariant arguments are allowed.
|
||||||
// N.B. does not support default arguments, if used to call JS functions
|
// N.B. does not support default arguments, if used to call JS functions
|
||||||
ecl_process_env()->nvalues = 1;
|
ecl_process_env()->nvalues = 1;
|
||||||
const int MAX = 10;
|
const int MAX = 10;
|
||||||
|
|
|
||||||
|
|
@ -130,18 +130,6 @@ QString toQString(cl_object l_str) {
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList toQStringList(cl_object l_list) {
|
|
||||||
QStringList l;
|
|
||||||
if (ECL_LISTP(l_list)) {
|
|
||||||
cl_object l_el = l_list;
|
|
||||||
while (l_el != ECL_NIL) {
|
|
||||||
l << toQString(cl_car(l_el));
|
|
||||||
l_el = cl_cdr(l_el);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return l;
|
|
||||||
}
|
|
||||||
|
|
||||||
TO_QT_2 (QPoint, toInt)
|
TO_QT_2 (QPoint, toInt)
|
||||||
TO_QT_2 (QSize, toInt)
|
TO_QT_2 (QSize, toInt)
|
||||||
TO_QT_4 (QRect, toInt)
|
TO_QT_4 (QRect, toInt)
|
||||||
|
|
@ -287,15 +275,6 @@ cl_object from_qstring(const QString& s) {
|
||||||
return l_s;
|
return l_s;
|
||||||
}
|
}
|
||||||
|
|
||||||
cl_object from_qstringlist(const QStringList& l) {
|
|
||||||
cl_object l_list = ECL_NIL;
|
|
||||||
for (QString s : qAsConst(l)) {
|
|
||||||
l_list = CONS(from_qstring(s), l_list);
|
|
||||||
}
|
|
||||||
l_list = cl_nreverse(l_list);
|
|
||||||
return l_list;
|
|
||||||
}
|
|
||||||
|
|
||||||
TO_CL_2 (QPoint, qpoint, ecl_make_fixnum, x, y)
|
TO_CL_2 (QPoint, qpoint, ecl_make_fixnum, x, y)
|
||||||
TO_CL_2 (QSize, qsize, ecl_make_fixnum, width, height)
|
TO_CL_2 (QSize, qsize, ecl_make_fixnum, width, height)
|
||||||
TO_CL_4 (QRect, qrect, ecl_make_fixnum, x, y, width, height)
|
TO_CL_4 (QRect, qrect, ecl_make_fixnum, x, y, width, height)
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,6 @@ qreal toReal(cl_object);
|
||||||
QByteArray toCString(cl_object);
|
QByteArray toCString(cl_object);
|
||||||
QByteArray toQByteArray(cl_object);
|
QByteArray toQByteArray(cl_object);
|
||||||
QString toQString(cl_object);
|
QString toQString(cl_object);
|
||||||
QStringList toQStringList(cl_object);
|
|
||||||
QVariant toQVariant(cl_object, int = -1);
|
QVariant toQVariant(cl_object, int = -1);
|
||||||
QVariantList toQVariantList(cl_object);
|
QVariantList toQVariantList(cl_object);
|
||||||
QVariant toQVariantMap(cl_object);
|
QVariant toQVariantMap(cl_object);
|
||||||
|
|
@ -92,7 +91,6 @@ cl_object from_cstring(const QByteArray&);
|
||||||
cl_object from_qbytearray(const QByteArray&);
|
cl_object from_qbytearray(const QByteArray&);
|
||||||
cl_object from_qchar(const QChar&);
|
cl_object from_qchar(const QChar&);
|
||||||
cl_object from_qstring(const QString&);
|
cl_object from_qstring(const QString&);
|
||||||
cl_object from_qstringlist(const QStringList&);
|
|
||||||
cl_object from_qvariant(const QVariant&);
|
cl_object from_qvariant(const QVariant&);
|
||||||
cl_object from_qobject_pointer(QObject*);
|
cl_object from_qobject_pointer(QObject*);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue