[ANNOUNCE] KExtendableItemDelegate
Andreas Hartmetz
ahartmetz at gmail.com
Tue Apr 10 00:03:23 BST 2007
Hello all,
In the planning stage of KShortcusEditor I missed the possibility to add fully
interactable, large, arbitrary editor widgets to an item in a QTreeView. I
made KExtendableItemDelegate to make this possible.
It was not planned to be in the public API. When I added it to kdelibs, it was
not planned to have it public. Well, kdelibs didn't compile the way I put it
in, and somebody added its .h file to CMakeLists.txt to fix compilation. So,
it's already in the public API.
It can be made private if most people think it's too special or too unused
[zero users outside of kdelibs ATM - cf. rules for new public classes] to
warrant a place in the public API.
It also breaks some assumptions of the Model/View/Delegate design, especially
the one that a delegate holds no persistent data. The delegate needs to
remember which items have an extender widget.
HOWEVER, I think it is in fact very useful in many situations. It vastly
simplifies programming in its use case. You can put large editor widgets
directly next to the data they edit.
KShortcutsEditor, the widget in the "Configure Shortcuts" Dialog, makes use of
it, if you are curious about its mechanism and looks.
As mentioned in another thread, KShortcutsEditor is still under development.
The code of KExtendableItemDelegate is in
kdelibs/kdeui/itemviews/kextendableitemdelegate.cpp/h.
Are there any prospective users, or do you have comments on its design?
Cheers,
Andreas
More information about the kde-core-devel
mailing list