I'm not sure this should be done in the sort filter proxy model. You could overload QAbstractItemModel::sort() either for your model or an abstract proxy model and have all the required parameters at hand.