Use overload resolution instead of static-call
src/signal-slot/signal.lisp
Sun May 24 16:40:11 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Use overload resolution instead of static-call
--- old-qt.gui/src/signal-slot/signal.lisp 2014-10-30 07:49:51.000000000 +0100
+++ new-qt.gui/src/signal-slot/signal.lisp 2014-10-30 07:49:51.000000000 +0100
@@ -76,38 +76,32 @@
()
"No slot ~S for class ~S."
slot (class-name receiver))
- (assert (static-call "QMetaObject" "connect#$#$$$"
- qsignal
- (id qsignal)
- receiver
- slot-id
- type
- ;; QMetaObject::connect is responsible for freeing
- ;; the types array.
- (types (method-arguments-type
- (cxx:meta-object receiver)
- slot-id)))
- ()
- "Failed to connect ~S to the slot ~S of ~S."
- qsignal slot receiver)))
+ (or (meta-object.connect qsignal (id qsignal)
+ receiver slot-id
+ type
+ ;; QMetaObject::connect is responsible
+ ;; for freeing the types array.
+ (types (method-arguments-type
+ (cxx:meta-object receiver)
+ slot-id)))
+ (cerror "Ignore"
+ "Failed to connect ~S to the slot ~S of ~S."
+ qsignal slot receiver))))
(defun disconnect-signal (qsignal receiver slot)
(let ((qsignal (signal-object qsignal))
(slot-id (cxx:index-of-slot (cxx:meta-object receiver)
- (cxx:data
- (meta-object.normalized-signature slot)))))
+ (cxx:data
+ (meta-object.normalized-signature slot)))))
(assert (>= slot-id 0)
()
"No slot ~S for class ~S."
slot (class-name receiver))
- (assert (static-call "QMetaObject" "disconnect#$#$"
- qsignal
- (id qsignal)
- receiver
- slot-id)
- ()
- "Failed to disconnect ~S to the slot ~S of ~S."
- qsignal slot receiver)))
+ (or (meta-object.disconnect qsignal (id qsignal)
+ receiver slot-id)
+ (cerror "Ignore"
+ "Failed to disconnect ~S to the slot ~S of ~S."
+ qsignal slot receiver))))
(defmethod smoke::push-lisp-object (stack object class)
(let ((cxx-object (make-cxx-lisp-object object)))
@@ -147,9 +141,7 @@
'smoke::smoke-stack-item 'smoke::voidp))))
(setf (mem-aref args :pointer 0)
(null-pointer))
- (smoke::static-call *qt-smoke* "QMetaObject" "activate##$?"
- qsignal
- (cxx:meta-object qsignal)
+ (meta-object.activate qsignal (cxx:meta-object qsignal)
(id qsignal)
args))))