QAbstractItemModel的
点中item就把它的值,拿到
bool setData(const QModelIndex &index, const QVariant &value, int role)
{
if (role != Qt::EditRole)
return false;
if(!index.isValid())
return false;
TreeItem *item = static_cast<TreeItem*>(index.internalPointer());
bool result =item->setData(value);
return result;
}