Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qsqlindex.h
Go to the documentation of this file.
1// Copyright (C) 2016 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 QSQLINDEX_H
5#define QSQLINDEX_H
6
7#include <QtSql/qtsqlglobal.h>
8#include <QtSql/qsqlrecord.h>
9#include <QtCore/qlist.h>
10#include <QtCore/qmetaobject.h>
11#include <QtCore/qstring.h>
12
13// clazy:excludeall=qproperty-without-notify
15
16
17class Q_SQL_EXPORT QSqlIndex : public QSqlRecord
18{
20public:
22 Q_PROPERTY(QString cursorName READ cursorName WRITE setCursorName)
23
24 explicit QSqlIndex(const QString &cursorName = QString(), const QString &name = QString());
26 QSqlIndex(QSqlIndex &&other) noexcept = default;
27 ~QSqlIndex();
28 QSqlIndex &operator=(const QSqlIndex &other);
29 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QSqlIndex)
30
31 void swap(QSqlIndex &other) noexcept {
33 cursor.swap(other.cursor);
34 nm.swap(other.nm);
35 sorts.swap(other.sorts);
36 };
37
38 void setCursorName(const QString &cursorName);
39 inline QString cursorName() const { return cursor; }
40 void setName(const QString& name);
41 inline QString name() const { return nm; }
42
43 void append(const QSqlField &field);
44 void append(const QSqlField &field, bool desc);
45
46 bool isDescending(int i) const;
47 void setDescending(int i, bool desc);
48
49private:
50 // ### Qt7: move to d-ptr
52 QString nm;
53 QList<bool> sorts;
54};
55
56Q_DECLARE_SHARED(QSqlIndex)
57
59
60#endif // QSQLINDEX_H
void swap(QCursor &other) noexcept
Swaps this cursor with the other cursor.
Definition qcursor.h:57
The QSqlField class manipulates the fields in SQL database tables and views.
Definition qsqlfield.h:19
The QSqlIndex class provides functions to manipulate and describe database indexes.
Definition qsqlindex.h:18
QString name() const
Returns the \l name.
Definition qsqlindex.h:41
QString cursorName() const
Returns the \l cursorName.
Definition qsqlindex.h:39
The QSqlRecord class encapsulates a database record.
Definition qsqlrecord.h:20
void swap(QSqlRecord &other) noexcept
Definition qsqlrecord.h:29
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QCursor cursor
list append(new Employee("Blackpool", "Stephen"))
employee setName("Richard Schmit")
Combined button and popup list for selecting options.
GLuint name
#define Q_PROPERTY(...)
#define Q_GADGET
#define explicit
QSharedPointer< T > other(t)
[5]
this swap(other)