StupidBeauty
Read times:736Posted at:Sat Nov 23 22:24:20 2013
- no title specified

Jwt3.3.0文档翻译:类WabstractItemDelegate,Class WAbstractItemDelegate

这是一个抽象的代表(delegate)类,用于渲染一个条目(item)视图中的单个条目对象。

对于 WAbstractItemView 中条目的渲染,是由这个代表类的一个具体实现类来代理的。Wt 的条目视图中使用的默认实现是 WItemDelegate 。要想提供特殊的渲染功能支持的话,可以继承(reimplement)这个类(或特化(specialize) WItemDelegate )。

由于一个代表对象会被用来渲染多个条目,所以,这个类不应当记录特定条目的状态信息。

一个代表对象可以提供对于编辑功能的支持,当 update() 被调用,并且标志位为 ViewItemRenderFlag.RenderEditing 时,可以实例化一个编辑器。在那种情况下,妳还需要实现 getEditState() setEditState() ,以支持虚拟的滚动,另外还需要实现 setModelData() ,以将编辑过后的值保存到模型中去。想看示例的话,参考 WItemDelegate

参考

WAbstractItemView.setItemDelegateForColumn(int column, WAbstractItemDelegate delegate)

胡紫薇

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands