diff options
author | Thorbjørn Lund Martsum <tmartsum@gmail.com> | 2011-12-15 16:48:51 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-02 01:56:03 +0100 |
commit | 15f253a46aa45e2a9fa1055799fa2768ba49b9a3 (patch) | |
tree | 46156f4e7ed503d9c0596b74ef58361f14ceb90f /doc | |
parent | efecd011897e8852cf67ce119dafa879fc671b9c (diff) |
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 <stephen.kelly@kdab.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/src/examples/spinboxdelegate.qdoc | 6 |
1 files changed, 5 insertions, 1 deletions
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: |