Qt 6.x
The Qt SDK
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/qstring.h>
11
13
14
15class Q_SQL_EXPORT QSqlIndex : public QSqlRecord
16{
17public:
18 explicit QSqlIndex(const QString &cursorName = QString(), const QString &name = QString());
20 QSqlIndex(QSqlIndex &&other) noexcept = default;
21 ~QSqlIndex();
24
25 void setCursorName(const QString &cursorName);
26 inline QString cursorName() const { return cursor; }
27 void setName(const QString& name);
28 inline QString name() const { return nm; }
29
30 void append(const QSqlField &field);
31 void append(const QSqlField &field, bool desc);
32
33 bool isDescending(int i) const;
34 void setDescending(int i, bool desc);
35
36private:
37 QString createField(int i, const QString& prefix, bool verbose) const;
38 // ### Qt7: move to d-ptr
40 QString nm;
41 QList<bool> sorts;
42};
43
45
46#endif // QSQLINDEX_H
Definition qlist.h:74
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:16
QString name() const
Returns the name of the index.
Definition qsqlindex.h:28
QSqlIndex(QSqlIndex &&other) noexcept=default
Move-constructs a new QSqlIndex from other.
QString cursorName() const
Returns the name of the cursor which the index is associated with.
Definition qsqlindex.h:26
QSqlIndex & operator=(QSqlIndex &&other)=default
Move-assigns other to this QSqlIndex instance.
The QSqlRecord class encapsulates a database record.
Definition qsqlrecord.h:20
void append(const QSqlField &field)
Append a copy of field field to the end of the record.
QSqlRecord & operator=(const QSqlRecord &other)
Sets the record equal to other.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
QCursor cursor
employee setName("Richard Schmit")
Combined button and popup list for selecting options.
GLuint name
@ desc
QSharedPointer< T > other(t)
[5]