qt
|
The qt function provides a Lisp-aware interface to the underlying
Embedded QT C++ library. The QT C++ library is a very popular,
widely used library of C++ classes. The qt function supports a lisp-aware subset
of the available QT Classes. The return type of the function depends
entirely on the arguments passed. The QT C++ library supports a wide variety of useful C++ classes
for all types of applications. The qt function allows messages to be
sent to some of these QT C++ classes. The QT classes surfaced via the
qt function can be found in the
QT Document. The qt function surfaces a set of useful QT C++ classes specially designed
to interface with Lisp. The qt function allows the Lisp programmer to send
messages to and from these C++ classes more or less directly. The messages
are always Symbols of some specific content (the messages), and the
receivers of the messages are always these special Lisp-aware
QT C++ classes. The qt function surfaces three static Lisp-aware QT C++ classes:
new, console, and mainWindow. There is one and only
one instance of these static classes, so they must always be referenced by
their symbolic name. All other Lisp-aware QT C++ classes can have multiple
instances and must be referenced by their C++ object pointer. A complete list of the Lisp-aware QT C++ classes surfaced by the qt function
can be found in the
QT Document.
A brief list of a few of the available Lisp-aware QT C++ classes is as follows. The qt function always has a receiver followed by a message. The receiver is either
a Symbol, if one of the three static Lisp-aware classes, or a C++ object pointer for all other classes.
The remaining arguments to the qt function and the value returned by the qt function are entirely
dependent upon the receiver and the message. Usage The qt function is used to send messages to Lisp-aware QT C++ classes.
For instance the following Lisp code shows how to create a RadPushButton object, and
how to receive notification when the object's button is pushed.
More comprehensive examples of the qt function usage can be found in the Tutorial_Console folder
in the Ais folder.
(defun myButton(String:title) ;; Lisp function to make a button and permanently store the resulting C++ pointer
pvars:(buttonPtr) ;; The C++ object pointer must be permanently stored as C++ does NOT suport garabge collection
(defun press() (writeln "my button has been pressed"));; The RadPushButton object calls this function whenever its button is pressed
;; Create the RadPushButton C++ object and use myself as the Button's event manager.
(setq buttonPtr (qt new: RadPushButton: title (myself))) ;; Create the new button with the specified title and event manager
buttonPtr)
(myButton "Press Me") ;; Create a new QT RadPushButton object and store the C++ object pointer to the button
Expression:
Arguments
Name
Type
Description Argument: receiver Symbol Pointer
The QT class receiving the message (must be new, console, mainWindow, or a Pointer) Argument: message Symbol
The message sent to the QT Lisp-aware receiver class Argument: ... Word
none or more argument depending upon the message and the QT Lisp-aware receiver class
Returns:
Here are a number of links to Lambda coding examples which contain this instruction in various use cases.
Here are the links to the data types of the function arguments.
Symbol | String | Text | Integer |
Date | ByteVector |
Here are also a number of links to functions having arguments with any of these data types.
Analytic Information Server (AIS)AIS Component Systems
|