lqml/examples/cl-repl/cpp
2024-12-25 18:33:25 +01:00
..
usb example 'cl-repl': simple edit mode for uLisp (Arduino) connected to USB 2024-05-07 12:31:32 +02:00
qt.cpp revisions regarding iOS and latest Xcode 2024-12-25 18:33:25 +01:00
qt.h revisions regarding iOS and latest Xcode 2024-12-25 18:33:25 +01:00
qt.pro revisions 2024-05-12 08:41:21 +02:00
readme.md example 'cl-repl': fix loading custom color settings 2022-10-23 12:19:21 +02:00

Info

This demonstrates how to extend your app with Qt code callable from Lisp.

Please note that we only need QVariant arguments, which can also hold pointers which are type checked when retrieving the pointer value (that is, the pointer is a nullptr if the type doesn't match).

It also shows how to extend non QObject classes with a QObject, in order to store their pointer values in a QVariant.

If we need to return a non QObject value to Lisp (not a pointer or primitive value, but a class like TextBlock in this example, that is a QTextBlock extended with a QObject), a new instance is created on the heap, calling QTimer::singleShot(0, tmp, &QObject::deleteLater) on it, which should be sufficient in any circumstance. The additional timer is needed here because of SplitView, which delays certain events.