Rework QObject parent ownership transfer
src/properties.lisp
Sun May 31 19:33:32 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Rework QObject parent ownership transfer
--- old-qt.gui/src/properties.lisp 2014-10-30 07:48:37.000000000 +0100
+++ new-qt.gui/src/properties.lisp 2014-10-30 07:48:37.000000000 +0100
@@ -14,12 +14,17 @@
"Returns the property NAME of OBJECT."
(from-variant (cxx:property object (property-name name))))
+
(defun (setf property) (new-value object name)
(cxx:set-property object (property-name name)
(make-instance 'qt:variant
:args (list new-value)))
new-value)
+(defun remove-property (object name)
+ "Removes the property NAME from OBJECT."
+ (setf (property object name) (qt:make-variant)))
+
(defun property-p (object name)
"Returns T when NAME is a property of OBJECT and NIL otherwise."
(variant-boundp (cxx:property object (property-name name))))