a bunch of revisions

This commit is contained in:
pls.153 2022-01-29 09:37:19 +01:00
parent 1220bf06dc
commit 113386fdae
16 changed files with 109 additions and 112 deletions

View file

@ -1,6 +1,7 @@
QT += widgets
TEMPLATE = lib
CONFIG += plugin release
CONFIG += plugin release no_keywords
LIBS += -L/usr/local/lib -lecl
DESTDIR = ../
TARGET = cpp
OBJECTS_DIR = ./tmp/
@ -10,5 +11,14 @@ win32 {
include(../../src/windows.pri)
}
HEADERS += lib.h
SOURCES += lib.cpp
# 'marshal.*' and 'qt_ecl.*' only needed for calling Lisp
HEADERS += \
lib.h \
../../src/cpp/marshal.h \
../../src/cpp/qt_ech.h
SOURCES += \
lib.cpp \
../../src/cpp/marshal.cpp \
../../src/cpp/qt_ecl.cpp

View file

@ -1,4 +1,5 @@
#include "lib.h"
#include "../../src/cpp/ecl_fun.h" // for calling Lisp
#include <QApplication>
#include <QMessageBox>
#include <QtDebug>
@ -19,7 +20,10 @@ QObject* ini() {
return cpp;
}
// functiones defined Q_INVOKABLE
QVariant CPP::hello(const QVariant& arg) {
QString msg;
QDebug debug(&msg);
debug << arg;
@ -29,4 +33,9 @@ QVariant CPP::hello(const QVariant& arg) {
return arg;
}
QVariant CPP::callLisp(const QVariant& arg) {
return ecl_fun("cl:format", false, "~R", arg);
}
QT_END_NAMESPACE

View file

@ -20,6 +20,7 @@ public:
// max. 10 arguments of type QVariant
// return type must also be a QVariant
Q_INVOKABLE QVariant hello(const QVariant&);
Q_INVOKABLE QVariant callLisp(const QVariant&);
};
QT_END_NAMESPACE