From 15f253a46aa45e2a9fa1055799fa2768ba49b9a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lund=20Martsum?= Date: Thu, 15 Dec 2011 16:48:51 +0100 Subject: Introduce QItemDelegate::destroyEditor virtual invoked at editor close This provides a stronger mechanism e.g when inheriting QItemDelegate. It makes some things much easier e.g avoid delete of an editor and maybe only delete depending on what the editor says itself. This introduces a new virtual function. Task-number: QTBUG-2299 Change-Id: I8410f8199775987dbacffd99e4c354fdadcdd21f Reviewed-by: Stephen Kelly --- doc/src/examples/spinboxdelegate.qdoc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'doc/src') diff --git a/doc/src/examples/spinboxdelegate.qdoc b/doc/src/examples/spinboxdelegate.qdoc index c00f014afe..b36176b042 100644 --- a/doc/src/examples/spinboxdelegate.qdoc +++ b/doc/src/examples/spinboxdelegate.qdoc @@ -55,10 +55,14 @@ create an editor widget, display it at the correct location in a view, and communicate with a model. Custom delegates can also provide their own painting code by reimplementing the \c paintEvent() function. + Furthermore it is also possible to reuse (and avoid deleting) the editor + widget by reimplementing the \a destroyEditor() function. A reused widget + could be a mutable member created in the constructor and deleted in + the destructor. \section1 SpinBoxDelegate Class Implementation - Since the delegate is stateless, the constructor only needs to + Delegates are often stateless. The constructor only needs to call the base class's constructor with the parent QObject as its argument: -- cgit v1.2.3