![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
The QSqlIndex class provides functions to manipulate and describe database indexes. More...
#include <qsqlindex.h>
Public Member Functions | |
QSqlIndex (const QString &cursorName=QString(), const QString &name=QString()) | |
Constructs an empty index using the cursor name cursorname and index name name. | |
QSqlIndex (const QSqlIndex &other) | |
Constructs a copy of other. | |
QSqlIndex (QSqlIndex &&other) noexcept=default | |
Move-constructs a new QSqlIndex from other. | |
~QSqlIndex () | |
Destroys the object and frees any allocated resources. | |
QSqlIndex & | operator= (const QSqlIndex &other) |
Move-assigns other to this QSqlIndex instance. | |
void | swap (QSqlIndex &other) noexcept |
void | setCursorName (const QString &cursorName) |
Sets \l cursorName to cursorName. | |
QString | cursorName () const |
Returns the \l cursorName. | |
void | setName (const QString &name) |
Sets \l name to name. | |
QString | name () const |
Returns the \l name. | |
void | append (const QSqlField &field) |
Appends the field field to the list of indexed fields. | |
void | append (const QSqlField &field, bool desc) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Appends the field field to the list of indexed fields. | |
bool | isDescending (int i) const |
Returns true if field i in the index is sorted in descending order; otherwise returns false . | |
void | setDescending (int i, bool desc) |
If desc is true, field i is sorted in descending order. | |
Public Member Functions inherited from QSqlRecord | |
QSqlRecord () | |
Constructs an empty record. | |
QSqlRecord (const QSqlRecord &other) | |
Constructs a copy of other. | |
QSqlRecord (QSqlRecord &&other) noexcept=default | |
QSqlRecord & | operator= (const QSqlRecord &other) |
Sets the record equal to other. | |
~QSqlRecord () | |
Destroys the object and frees any allocated resources. | |
void | swap (QSqlRecord &other) noexcept |
bool | operator== (const QSqlRecord &other) const |
Returns true if this object is identical to other (i.e., has the same fields in the same order); otherwise returns false . | |
bool | operator!= (const QSqlRecord &other) const |
Returns true if this object is not identical to other; otherwise returns false . | |
QVariant | value (int i) const |
Returns the value of the field located at position index in the record. | |
QVariant | value (QAnyStringView name) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns the value of the field called name in the record. | |
void | setValue (int i, const QVariant &val) |
Sets the value of the field at position index to val. | |
void | setValue (QAnyStringView name, const QVariant &val) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the value of the field called name to val. | |
void | setNull (int i) |
Sets the value of field index to null. | |
void | setNull (QAnyStringView name) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the value of the field called name to null. | |
bool | isNull (int i) const |
Returns true if the field index is null or if there is no field at position index; otherwise returns false . | |
bool | isNull (QAnyStringView name) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns true if the field called name is null or if there is no field called name; otherwise returns false . | |
int | indexOf (QAnyStringView name) const |
Returns the position of the field called name within the record, or -1 if it cannot be found. | |
QString | fieldName (int i) const |
Returns the name of the field at position index. | |
QSqlField | field (int i) const |
Returns the field at position index. | |
QSqlField | field (QAnyStringView name) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns the field called name. | |
bool | isGenerated (int i) const |
Returns true if the record has a field at position index and this field is to be generated (the default); otherwise returns false . | |
bool | isGenerated (QAnyStringView name) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns true if the record has a field called name and this field is to be generated (the default); otherwise returns false . | |
void | setGenerated (QAnyStringView name, bool generated) |
Sets the generated flag for the field called name to generated. | |
void | setGenerated (int i, bool generated) |
Sets the generated flag for the field index to generated. | |
void | append (const QSqlField &field) |
Append a copy of field field to the end of the record. | |
void | replace (int pos, const QSqlField &field) |
Replaces the field at position pos with the given field. | |
void | insert (int pos, const QSqlField &field) |
Inserts the field field at position pos in the record. | |
void | remove (int pos) |
Removes the field at position pos. | |
bool | isEmpty () const |
Returns true if there are no fields in the record; otherwise returns false . | |
bool | contains (QAnyStringView name) const |
Returns true if there is a field in the record called name; otherwise returns false . | |
void | clear () |
Removes all the record's fields. | |
void | clearValues () |
Clears the value of all fields in the record and sets each field to null. | |
int | count () const |
Returns the number of fields in the record. | |
QSqlRecord | keyValues (const QSqlRecord &keyFields) const |
Properties | |
QString | name |
QString | cursorName |
The QSqlIndex class provides functions to manipulate and describe database indexes.
\inmodule QtSql
An index refers to a single table or view in a database. Information about the fields that comprise the index can be used to generate SQL statements.
Definition at line 18 of file qsqlindex.h.
|
explicit |
Constructs an empty index using the cursor name cursorname and index name name.
Definition at line 31 of file qsqlindex.cpp.
QSqlIndex::QSqlIndex | ( | const QSqlIndex & | other | ) |
Constructs a copy of other.
Definition at line 40 of file qsqlindex.cpp.
|
defaultnoexcept |
Move-constructs a new QSqlIndex from other.
QSqlIndex::~QSqlIndex | ( | ) |
Destroys the object and frees any allocated resources.
Definition at line 82 of file qsqlindex.cpp.
Appends the field field to the list of indexed fields.
The field is appended with an ascending sort order.
Definition at line 109 of file qsqlindex.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Appends the field field to the list of indexed fields.
The field is appended with an ascending sort order, unless desc is true.
Definition at line 122 of file qsqlindex.cpp.
|
inline |
Returns the \l cursorName.
Definition at line 40 of file qsqlindex.h.
bool QSqlIndex::isDescending | ( | int | i | ) | const |
Returns true
if field i in the index is sorted in descending order; otherwise returns false
.
Definition at line 134 of file qsqlindex.cpp.
|
inline |
Returns the \l name.
Definition at line 42 of file qsqlindex.h.
Move-assigns other to this QSqlIndex instance.
Sets the index equal to other.
Definition at line 68 of file qsqlindex.cpp.
Sets \l cursorName to cursorName.
Definition at line 166 of file qsqlindex.cpp.
void QSqlIndex::setDescending | ( | int | i, |
bool | desc ) |
If desc is true, field i is sorted in descending order.
Otherwise, field i is sorted in ascending order (the default). If the field does not exist, nothing happens.
Definition at line 147 of file qsqlindex.cpp.
Sets \l name to name.
Definition at line 99 of file qsqlindex.cpp.
Definition at line 32 of file qsqlindex.h.
|
readwrite |
Definition at line 22 of file qsqlindex.h.
|
readwrite |
Definition at line 21 of file qsqlindex.h.
Referenced by testing.tools.encode_pdf_filter._PdfStream::RegisterByName().