@ando_skoa:
As this is going to be generic proxy which can be for table or tree view so i need those functions.As you can see below are the implementation for the functions.I am very much confusd why selection model behaves like this when i change the behaviour(SelectRows).

QModelIndex LiPivotTableProxyModel::mapToSource(const QModelIndex &proxyIndex) const
{
return (sourceModel() && proxyIndex.isValid()) ? sourceModel()->index(proxyIndex.row(), proxyIndex.column(), proxyIndex.parent()) : QModelIndex();
}

QModelIndex LiPivotTableProxyModel::mapFromSource(const QModelIndex &sourceIndex) const
{
return index(sourceIndex.row(), sourceIndex.column(), sourceIndex.parent());
}
QModelIndex LiPivotTableProxyModel::index(int row, int column, const QModelIndex &parent) const
{
Q_UNUSED(parent);
return createIndex(row, column, row);
}

QModelIndex LiPivotTableProxyModel:arent(const QModelIndex &child) const
{
Q_UNUSED(child);
return QModelIndex();
}
As you can see parent i return new QModelIndex for my use case.