qt

 

 

Overview

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.

(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

More comprehensive examples of the qt function usage can be found in the Tutorial_Console folder in the Ais folder.

 

Syntax


Expression:(qt receiver message ...)

Arguments Name Type Description
Argument:receiverSymbol Pointer The QT class receiving the message (must be new, console, mainWindow, or a Pointer)
Argument:messageSymbol 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: The value returned is entirely dependent upon the message and the QT Lisp-aware receiver class


 

Examples

Here are a number of links to Lambda coding examples which contain this instruction in various use cases.

 

Argument Types

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.

++ += + /=
/ *= * --
-= - addMethod addi
appendWriteln append apply avg
badd balance bdiv binaryInsert
binaryNand binaryNor binaryNot binaryNxor
binarySearch bitwiseAnd bitwiseNand bitwiseNor
bitwiseNot bitwiseNxor bitwiseOr bitwiseShiftLeft
bitwiseShiftRight bitwiseXor bmod bmul
boolean cadd cdiv cdr
char character clean closeLog
cmod cmul code compareEQ
compareGE compareGT compareLE compareLT
compareNE compare comparison compress
cons count csub date
day days360 debugBrowsableProcs debugDetective
debugEval debug decode defchild
defclass define(macro) define defmacro
defmethod deforphan defriend defun
deleteRows delete dimension disassemble
display divi downcase encode
evalInSyncLocalContext eval exit exportCsv
exportSbf exportTab fact fdisplay
fileClose fileCopy fileDir fileDisplay
fileEraseDir fileErase fileExists fileMakeDir
fileOpen fileReadAll fileReadRecord fileRead
fileResize fileSeek fileSizeOf fileWriteAll
fileWrite filewriteln findBlock find
floor fraction freeBlock gc
gcd getGlobalValue getRecursionCount getSymbolTable
globalBinding hashString hour iadd
icompareEQ icompareGE icompareGT icompareLE
icompareLT icompareNE idiv imod
importCsv importSbf importTab imul
insertRows insert inside inspect
integer isAtom isBitVector isBoolean
isBound isByteVector isCharAlphabetic isCharAlphanumeric
isCharLowercase isCharName isCharNumeric isCharUppercase
isCharWhitespace isChar isCharacter isComplex
isDate isDictionary isDirectory isEqual
isError isEven isFloatVector isIdentical
isInside isIntegerVector isInteger isLambda
isMatrix isMember isMoney isNumberMatrix
isNumberVector isNumber isObjectVector isObject
isPair isPcodeVector isString isStructure
isSymbol isText isType isVector
isub julian kurtosis lcm
left length list loadModule
loadObject loadWorkspace lock macroReplace
makeQuotedList makeQuotedSymbol max median
member methodsOf mid min
minute mod modi money
month muli new now
number objectToMatrix objectToNumMatrix objectToNumVector
offset openLog pair parent
parse pointer preAllocateFixedMemoryBlocks product
proplist proprecord putprop qt
random randomize range rank
refAttributes refValues ref remProp
remove rename replace rept
resize right round run
saveImmediate saveModule saveObject saveRepository
saveWorkspace second setAttributes setBlock
setCar setCdr setLastCdr set
setf setq sizeof skew
sort sql sqrt srandom
stdev stdevp stringCiEQ stringCiGE
stringCiGT stringCiLE stringCiLT stringCiNE
stringFill stringToBVector stringToVector string
subi submit substitute substringCiEQ
substringCiGE substringCiGT substringCiLE substringCiLT
substringCiNE substringEQ substringFill substringGE
substringGT substringLE substringLT substringNE
substring sum sumsqr svmRegression
symbolToTypeCode symbol system text
time today trim type
uncompress uniqueInsert unlock upcase
var varp vectorBinaryInnerProduct vectorBipolarInnerProduct
vectorCosineInnerProduct vectorCubeInnerProduct vectorDelete vectorExpInnerProduct
vectorFill vectorInnerProduct vectorLogInnerProduct vectorQuartInnerProduct
vectorQuintInnerProduct vectorSigmoidInnerProduct vectorSineInnerProduct vectorSquareInnerProduct
vectorTanInnerProduct vectorTanhInnerProduct writelg writeln
year

Analytic Information Server (AIS)

AIS Component Systems

  • Smartbase Engine
  • QT C++ Libraries
  • MySQL Relational Database
  • AIS Lisp Libraries
  • Rapid Analytic Demo IDE