このページでは

RoleSorter QML Type

SortFilterProxyModel 内のデータを、設定されたロール名に基づいて並べ替えます。詳細...

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

Sorter

Status: Technology preview

この機能はテクノロジープレビュー版であり、変更される可能性があります。

プロパティ

詳細な説明

RoleSorter を使用すると、ソースモデルで設定されたロール名に基づいてデータを並べ替えることができます。

RoleSorter は、以下のようにソートフィルタープロキシモデルで設定できます。

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

プロパティのドキュメント

roleName : string

このプロパティには、データの並べ替えに使用されるロール名が格納されます。

デフォルト値は「display role」です。

© 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.