add tutorial in 'Qt_EQL/' for accessing C++ apps from Lisp

This commit is contained in:
polos 2021-05-07 19:06:19 +02:00
parent 490c878dee
commit 28d5d133fb
6 changed files with 174 additions and 0 deletions

27
Qt_EQL/tutorial/main.cpp Normal file
View file

@ -0,0 +1,27 @@
#include "test.h"
#include <eql5/eql.h>
#include <QApplication>
#include <QLabel>
int main(int argc, char* argv[]) {
QApplication app(argc, argv);
QLabel* main = new QLabel("<h2>Main Window</h2>");
main->setAlignment(Qt::AlignCenter);
main->resize(600, 400);
main->show();
// we need an instance for 'define-qt-wrappers' and 'new-instance' to work;
// we pass the main widget as parent and a unique 'objectName', so we can
// find it from Lisp
Test test(main, "test");
EQL eql;
EQL::eval("(in-package :eql-user)");
EQL::eval("(load \"test.lisp\")"); // will start a REPL
app.processEvents(); // needed for 'qlater' in 'test.lisp'
return 0; // no 'app.exec()' because of REPL
}