mirror of
https://gitlab.com/eql/EQL5.git
synced 2025-12-16 07:10:48 -08:00
add convenience function EQL::addObject() for adding Qt class instances as Lisp variables
This commit is contained in:
parent
53c6a9e246
commit
2156ea501f
5 changed files with 23 additions and 16 deletions
|
|
@ -11,13 +11,13 @@ int main(int argc, char* argv[]) {
|
|||
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;
|
||||
|
||||
// add desired Qt class instances as Lisp variables (uses 'defvar'):
|
||||
|
||||
EQL::addObject(main, "eql-user:*main-widget*");
|
||||
EQL::addObject(new Test(main), "eql-user:*test*");
|
||||
|
||||
EQL::eval("(in-package :eql-user)");
|
||||
EQL::eval("(load \"test.lisp\")"); // will start a REPL
|
||||
app.processEvents(); // needed for 'qlater' in 'test.lisp'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue