Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qqmlsorterbase_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
// Qt-Security score:significant reason:default
4
5
#
ifndef
QQMLSORTERBASE_H
6
#
define
QQMLSORTERBASE_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists purely as an
13
// implementation detail. This header file may change from version to
14
// version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
<
QtQml
/
qqml
.
h
>
20
#
include
<
QtCore
/
QObject
>
21
#
include
<
QtCore
/
QAbstractItemModel
>
22
#
include
<
QtQmlModels
/
private
/
qtqmlmodelsglobal_p
.
h
>
23
#
include
<
QtQml
/
private
/
qqmlcustomparser_p
.
h
>
24
25
QT_BEGIN_NAMESPACE
26
27
class
QQmlSortFilterProxyModel;
28
class
QQmlSorterBasePrivate
;
29
30
class
Q_QMLMODELS_EXPORT
QQmlSorterBase
:
public
QObject
31
{
32
Q_OBJECT
33
Q_PROPERTY(
bool
enabled READ enabled WRITE setEnabled NOTIFY enabledChanged FINAL)
34
Q_PROPERTY(Qt::SortOrder sortOrder READ sortOrder WRITE setSortOrder NOTIFY sortOrderChanged FINAL)
35
Q_PROPERTY(
int
priority READ priority WRITE setPriority NOTIFY priorityChanged FINAL)
36
Q_PROPERTY(
int
column READ column WRITE setColumn NOTIFY columnChanged FINAL)
37
QML_NAMED_ELEMENT(SorterBase)
38
QML_UNCREATABLE(
""
)
39
QML_ADDED_IN_VERSION(6, 10)
40
41
public
:
42
explicit
QQmlSorterBase(QQmlSorterBasePrivate *privObj, QObject *parent =
nullptr
);
43
virtual
~QQmlSorterBase() =
default
;
44
45
bool
enabled()
const
;
46
void
setEnabled(
const
bool
enabled);
47
48
Qt::SortOrder sortOrder()
const
;
49
void
setSortOrder(
const
Qt::SortOrder sortOrder);
50
51
int
priority()
const
;
52
void
setPriority(
const
int
priority);
53
54
int
column()
const
;
55
void
setColumn(
const
int
column);
56
57
virtual
QPartialOrdering compare(
const
QModelIndex&,
const
QModelIndex&,
const
QQmlSortFilterProxyModel *)
const
= 0;
58
virtual
void
update(
const
QQmlSortFilterProxyModel *) {
/* do nothing */
}
59
60
Q_SIGNALS:
61
void
enabledChanged();
62
void
sortOrderChanged();
63
void
priorityChanged();
64
void
columnChanged();
65
void
invalidateModel();
66
void
invalidateCache(QQmlSorterBase *filter);
67
68
public
slots:
69
void
invalidate(
bool
updateCache =
true
);
70
71
private
:
72
Q_DECLARE_PRIVATE(QQmlSorterBase)
73
};
74
75
class
QQmlSorterBasePrivate
:
public
QObjectPrivate
76
{
77
Q_DECLARE_PUBLIC(QQmlSorterBase)
78
79
public
:
80
QQmlSorterBasePrivate
() =
default
;
81
virtual
~
QQmlSorterBasePrivate
() =
default
;
82
83
bool
m_enabled
=
true
;
84
Qt
::
SortOrder
m_sortOrder
=
Qt
::
AscendingOrder
;
85
int
m_sorterPriority
=
std
::
numeric_limits
<
int
>::
max
();
86
int
m_sortColumn
= 0;
87
};
88
89
QT_END_NAMESPACE
90
91
#
endif
// QQMLSORTERBASE_H
QQmlSorterBasePrivate
Definition
qqmlsorterbase_p.h:76
QQmlSorterBasePrivate::m_enabled
bool m_enabled
Definition
qqmlsorterbase_p.h:83
QQmlSorterBasePrivate::m_sortColumn
int m_sortColumn
Definition
qqmlsorterbase_p.h:86
QQmlSorterBasePrivate::m_sortOrder
Qt::SortOrder m_sortOrder
Definition
qqmlsorterbase_p.h:84
QQmlSorterBasePrivate::~QQmlSorterBasePrivate
virtual ~QQmlSorterBasePrivate()=default
QQmlSorterBasePrivate::m_sorterPriority
int m_sorterPriority
Definition
qqmlsorterbase_p.h:85
QQmlSorterBase
Definition
qqmlsorterbase_p.h:31
qtdeclarative
src
qmlmodels
sfpm
sorters
qqmlsorterbase_p.h
Generated on
for Qt by
1.18.0