mirror of
https://gitlab.com/eql/lqml.git
synced 2025-12-30 13:51:43 -08:00
fix qml-apply (Lisp calls from QML)
This commit is contained in:
parent
e09778b76c
commit
82b904fe9c
5 changed files with 41 additions and 58 deletions
|
|
@ -80,7 +80,7 @@ int main(int argc, char* argv[]) {
|
|||
|
||||
bool slime = false;
|
||||
if (arguments.contains("-slime")
|
||||
|| (arguments.indexOf(QRegularExpression::fromWildcard(QStringView(QString("*start-swank*.lisp")))) != -1)) {
|
||||
|| (arguments.indexOf(QRegularExpression::fromWildcard(QString("*start-swank*.lisp"))) != -1)) {
|
||||
arguments.removeAll("-slime");
|
||||
slime = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,18 +17,13 @@ QObject* iniQml() {
|
|||
return lisp;
|
||||
}
|
||||
|
||||
static QVariant qmlApply(QObject* caller, const QString& function, const QVariantList& arguments) {
|
||||
QVariant var =
|
||||
ecl_fun("qml:qml-apply",
|
||||
QVariant(reinterpret_cast<quintptr>(caller)),
|
||||
QVariant(function),
|
||||
QVariant(arguments));
|
||||
QString str(var.toString());
|
||||
if(str.startsWith("#<>")) { // prepared in Lisp for JS eval
|
||||
QQmlExpression exp(LQML::quickView->rootContext(), caller, str.mid(3));
|
||||
return exp.evaluate();
|
||||
}
|
||||
return var;
|
||||
static QVariant qmlApply(QObject* caller,
|
||||
const QString& function,
|
||||
const QVariantList& arguments) {
|
||||
return ecl_fun("qml:qml-apply",
|
||||
QVariant(reinterpret_cast<quintptr>(caller)),
|
||||
QVariant(function),
|
||||
QVariant(arguments));
|
||||
}
|
||||
|
||||
QVariant Lisp::call(const QJSValue& caller_or_function,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue