73QPartialOrdering QQmlRoleSorter::compare(
const QModelIndex& sourceLeft,
const QModelIndex& sourceRight,
const QQmlSortFilterProxyModel *proxyModel)
const
75 Q_D(
const QQmlRoleSorter);
76 int role = proxyModel->itemRoleForName(d->m_roleName);
79 if (!d->m_roleName.isEmpty() && !d->m_roleNameValidated) {
80 qWarning(
"Provided role name %s doesn't exist in the model", d->m_roleName.toUtf8().constData());
81 d->m_roleNameValidated =
true;
83 return QPartialOrdering::Unordered;
86 return QVariant::compare(proxyModel->sourceData(sourceLeft, role), proxyModel->sourceData(sourceRight, role));