ownership transfer QGraphicsScene::addItem --> to head
Wed Mar 10 18:13:52 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Delete QPainDevices before the QApplication is destroyed.
Mon Jan 25 20:09:40 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Fix with-app cleanup
Mon Jan 25 19:50:16 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Fix with-painter
Mon Jan 25 19:49:07 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* QList<Foo*> translations
Mon Jan 25 19:48:42 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* QVector<QPointF> translation
Mon Jan 25 19:48:17 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* ownership transfer QGraphicsScene::addItem
diff -rN -u old-qt.gui/src/application.lisp new-qt.gui/src/application.lisp
--- old-qt.gui/src/application.lisp 2014-10-30 07:41:07.000000000 +0100
+++ new-qt.gui/src/application.lisp 2014-10-30 07:41:07.000000000 +0100
@@ -2,7 +2,7 @@
(defvar *widgets* nil)
-(defmethod delete-app :around ((application qt:application))
+(defmethod cl-smoke.qt.core:delete-app :around ((application qt:application))
(qt:application.close-all-windows)
;; widgets are only valid as long, as an application object
;; exists. QApplication::~QApplication() deletes all widgets in
@@ -11,6 +11,13 @@
;; see: qt4/src/gui/kernel/qapplication.cpp
(loop for widget across (qt:application.all-widgets) do
(tg:cancel-finalization widget))
+ ;; QPaintDevices are only valid when a application object exists.
+ (loop for object being the hash-values of smoke::*object-map* do
+ (when (typep object 'qt:paint-device)
+ (delete-object object)))
+ ;; Finalize other stuff before deleting the QApplication,
+ ;; e.g. QGraphicsScene
+ (tg:gc :full t)
(call-next-method)
(setf *widgets* nil))
diff -rN -u old-qt.gui/src/ownership.lisp new-qt.gui/src/ownership.lisp
--- old-qt.gui/src/ownership.lisp 2014-10-30 07:41:07.000000000 +0100
+++ new-qt.gui/src/ownership.lisp 2014-10-30 07:41:07.000000000 +0100
@@ -66,6 +66,9 @@
item)
item)
+;; FIXME graphic-item has a lot more.
+(define-takes-ownership cxx:add-item ((this qt:graphics-scene) item)
+ item)
;; Allocates return value
;; QLineEdit::createStandardContextMenu()
diff -rN -u old-qt.gui/src/painter.lisp new-qt.gui/src/painter.lisp
--- old-qt.gui/src/painter.lisp 2014-10-30 07:41:07.000000000 +0100
+++ new-qt.gui/src/painter.lisp 2014-10-30 07:41:07.000000000 +0100
@@ -7,16 +7,16 @@
Makes sure the painter ends after BODY; thus preventing problems with
still active and not yet garbage collected painters in CXX:PAINT-EVENT."
- (when paint-device
- `(let ((,painter (make-instance 'qt:painter :arg0 ,paint-device)))
- (assert (cxx:is-active ,painter)
- (,painter)
- "Painter ~A for ~A is not active"
- ,painter ,paint-device)
- (unwind-protect
- (progn ,@body)
- (cxx:end ,painter)))
- `(progn (cxx:save ,painter)
- (unwind-protect
- (progn ,@body)
- (cxx:restore ,painter)))))
+ (if paint-device
+ `(let ((,painter (make-instance 'qt:painter :arg0 ,paint-device)))
+ (assert (cxx:is-active ,painter)
+ (,painter)
+ "Painter ~A for ~A is not active"
+ ,painter ,paint-device)
+ (unwind-protect
+ (progn ,@body)
+ (cxx:end ,painter)))
+ `(progn (cxx:save ,painter)
+ (unwind-protect
+ (progn ,@body)
+ (cxx:restore ,painter)))))
diff -rN -u old-qt.gui/src/translations.lisp new-qt.gui/src/translations.lisp
--- old-qt.gui/src/translations.lisp 2014-10-30 07:41:07.000000000 +0100
+++ new-qt.gui/src/translations.lisp 2014-10-30 07:41:07.000000000 +0100
@@ -3,6 +3,12 @@
;; QPoint has a trivial copy ctor and destructor, thus memcpying it
;; should be fine.
(cl-smoke.qt.core:define-qvector-translations "QPoint" qt:point)
+(cl-smoke.qt.core:define-qvector-translations "QPointF" qt:point-f)
(cl-smoke.qt.core:define-qvector-translations "unsigned int"
(smoke:c-integer :unsigned-int))
+
+(cl-smoke.qt.core::define-qlist-wrapper "QAction*" qt:action "void")
+(cl-smoke.qt.core::define-qlist-wrapper "QGraphicsItem*" qt:graphics-item "void")
+(cl-smoke.qt.core::define-qlist-wrapper "QStandardItem*" qt:standard-item "void")
+(cl-smoke.qt.core::define-qlist-wrapper "QWidget*" qt:widget "void")