Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmlrolesorter_p.h
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQMLROLESORTER_P_H
5#define QQMLROLESORTER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQmlModels/private/qqmlsorterbase_p.h>
19
20QT_BEGIN_NAMESPACE
21
22class QQmlSortFilterProxyModel;
24
25class Q_QMLMODELS_EXPORT QQmlRoleSorter : public QQmlSorterBase
26{
27 Q_OBJECT
28 Q_PROPERTY(QString roleName READ roleName WRITE setRoleName NOTIFY roleNameChanged)
29 QML_NAMED_ELEMENT(RoleSorter)
30 QML_ADDED_IN_VERSION(6, 10)
31
32public:
33 explicit QQmlRoleSorter(QObject *parent = nullptr);
34 QQmlRoleSorter(QQmlSorterBasePrivate *priv, QObject *parent = nullptr);
35 ~QQmlRoleSorter() = default;
36
37 const QString& roleName() const;
38 void setRoleName(const QString& roleName);
39
40 QPartialOrdering compare(const QModelIndex& sourceLeft, const QModelIndex& sourceRight, const QQmlSortFilterProxyModel *proxyModel) const override;
41
42Q_SIGNALS:
43 void roleNameChanged();
44
45private:
46 Q_DECLARE_PRIVATE(QQmlRoleSorter)
47};
48
50{
51 Q_DECLARE_PUBLIC (QQmlRoleSorter)
52
53public:
55};
56
57QT_END_NAMESPACE
58
59#endif // QQMLROLESORTER_P_H