En esta página

RoleSorter QML Type

Ordenar los datos de un « SortFilterProxyModel » según el nombre de la función configurada. Más información...

Import Statement: import QtQml.Models
Since: Qt 6.10
Inherits:

Sorter

Status: Technology preview

Este tipo se encuentra en fase de vista previa tecnológica y está sujeto a cambios.

Propiedades

Descripción detallada

RoleSorter permite al usuario ordenar los datos según el nombre del rol, tal y como se ha configurado en el modelo de origen.

RoleSorter se puede configurar en el modelo proxy del filtro de ordenación como se indica a continuación:

SortFilterProxyModel {
    sourceModel: model
    sorters: [
        RoleSorter { roleName: "firstname" }
    ]
}

Documentación de propiedades

roleName : string

Esta propiedad contiene el nombre del rol que se utilizará para ordenar los datos.

El valor por defecto es «rol de visualización».

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.