qt delegate setEditorData()

来源:互联网 发布:fg代理软件下载 编辑:程序博客网 时间:2024/06/14 20:36
void QItemDelegate::setEditorData ( QWidget * editor, const QModelIndex & index ) const [virtual]



Sets the data to be displayed and edited by the editor    from the data model item specified by the model index.

从model中获取数据,赋值给editor widget。

这样,用editor编辑数据的时候,就是正确的数据。



model中获取 数据

QVariant vData   =    index.model() ->data(  index );


调用Editor widget的setValue()方法。

0 0
原创粉丝点击