PDA

View Full Version : ProxyModel and ItemDelegate work togather?



litterflybug
15th December 2009, 03:28
Hello everyone:

i use QAbstraceProxyModel subclass , QSplRelationalTableModel ,QItemDelegate SubClass, QTableView togather work,but when i edit cell,the QItemDelegate isn't valid,
then i debug it, find in QAbstrateItemView's private class have this code:



inline bool isIndexValid(const QModelIndex &index) const {
return (index.row() >= 0) && (index.column() >= 0) && (index.model() == model);
}

this is (index.model()==model) ==false
index.model==>SourceModel
model==>ProxyModel

i want (index.model()==model) ==true,to evalid my delegate to work

thanks