swift
Loading...
Searching...
No Matches
orderable.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2015 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#ifndef SWIFT_MISC_ORDERABLE_H
7#define SWIFT_MISC_ORDERABLE_H
8
9#include <QString>
10#include <QVariant>
11
14
15namespace swift::misc
16{
19 {
20 public:
23 {
24 IndexOrder = CPropertyIndexRef::GlobalIndexIOrderable,
25 IndexOrderString
26 };
27
29 int getOrder() const { return m_order; }
30
32 QString getOrderAsString() const;
33
35 void setOrder(int order) { m_order = order; }
36
38 bool hasValidOrder() const;
39
41 static bool isAnyOrderIndex(int index);
42
43 protected:
45 static bool canHandleIndex(CPropertyIndexRef index);
46
48 IOrderable() = default;
49
51 IOrderable(int order);
52
55
57 void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant);
58
60 int comparePropertyByIndex(CPropertyIndexRef index, const IOrderable &compareValue) const;
61
62 int m_order = -1;
63 };
64} // namespace swift::misc
65
66#endif // SWIFT_MISC_ORDERABLE_H
Non-owning reference to a CPropertyIndex with a subset of its features.
int m_order
order number
Definition orderable.h:62
IOrderable()=default
Constructor.
int comparePropertyByIndex(CPropertyIndexRef index, const IOrderable &compareValue) const
Compare for index.
Definition orderable.cpp:77
void setOrder(int order)
Set order.
Definition orderable.h:35
ColumnIndex
Properties by index.
Definition orderable.h:23
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
Definition orderable.cpp:61
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
Definition orderable.cpp:44
int getOrder() const
Order.
Definition orderable.h:29
Free functions in swift::misc.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.