Sun Apr 12 16:50:23 CEST 2009 Tobias Rautenkranz * overloading of methods diff -rN -u old-doc/qt.docbook new-doc/qt.docbook --- old-doc/qt.docbook 2014-10-30 07:13:57.000000000 +0100 +++ new-doc/qt.docbook 2014-10-30 07:13:57.000000000 +0100 @@ -23,7 +23,7 @@ the unit tests and :qt.examples for various examples. -
QApplication +
qt:application The qt:application object should created with: qt:with-app. In its body the event loop can be diff -rN -u old-doc/smoke.docbook new-doc/smoke.docbook --- old-doc/smoke.docbook 2014-10-30 07:13:57.000000000 +0100 +++ new-doc/smoke.docbook 2014-10-30 07:13:57.000000000 +0100 @@ -46,8 +46,7 @@
Methods -The C++ methods are generic functions in the :cxx package. -Their lambda list is: (object &rest args). +C++ methods are generic functions in the :cxx package. The C++ method call: myInstance->frob(1); is in Lisp: @@ -60,6 +59,24 @@ adding methods. :around, :before, :after and (call-next-method) are supported. + +(defclass the-object-does-nothing (qt:object) + () + (:metaclass cxx:class)) + +(defmethod cxx:timer-event ((object the-object-does-nothing) event) + (declare (ignore object event)) + (call-next-method)) + + + +:cxx generic functions can be overload by argument count. Lambda list +keywords (e.g.: &rest and &key) are not supported. + + +Make sure you have the right number of arguments when adding a method; otherwise it will +not be called. +
Static Methods @@ -96,8 +113,9 @@ their deletion. When a qt:object has a parent, a strong reference is kept to prevent its garbage collection until the parent is deleted. + -Not that an instance may depend on an other one. +An instance may depend on an other one. It is a bad idea to do something like this: (defvar *meta* (cxx:meta-object (make-instance 'qt:object))) @@ -107,6 +125,7 @@ be garbage collected, and then the QMetaObject instance is deleted along with the QObject. +