Skip to content

Commit

Permalink
describe-qobject: Don't try to describe properties of object is not a…
Browse files Browse the repository at this point in the history
… QObject.
  • Loading branch information
stassats committed Dec 29, 2010
1 parent 4a901d4 commit 3567633
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions property.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,19 @@
(when (typep thing 'dynamic-object)
(format t "This object is also an instance of a Lisp class, ~A.~%~%"
(class-name (class-of thing))))
(format t "Properties~A:~%"
(if (typep thing 'dynamic-object) " and slots" ""))
(dolist (prop (object-properties thing))
(multiple-value-bind (value boundp)
(handler-bind ((warning #'muffle-warning))
(property thing prop))
(format t "~4T~A ~A~40T"
(#_typeName prop)
(#_name prop))
(if boundp
(format t "~S~%" value)
(format t "<unbound>~%"))))
(when (qtypep thing (qt::find-qclass "QObject"))
(format t "Properties~A:~%"
(if (typep thing 'dynamic-object) " and slots" ""))
(dolist (prop (object-properties thing))
(multiple-value-bind (value boundp)
(handler-bind ((warning #'muffle-warning))
(property thing prop))
(format t "~4T~A ~A~40T"
(#_typeName prop)
(#_name prop))
(if boundp
(format t "~S~%" value)
(format t "<unbound>~%")))))
(when (typep thing 'dynamic-object)
(dolist (slotd (c2mop:class-slots (class-of thing)))
(let ((name (c2mop:slot-definition-name slotd)))
Expand Down

0 comments on commit 3567633

Please sign in to comment.