![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\inmodule QtSql More...
#include <qsqlrelationaltablemodel.h>
Public Member Functions | |
QSqlRelation () | |
Constructs an invalid QSqlRelation object. | |
QSqlRelation (const QString &aTableName, const QString &indexCol, const QString &displayCol) | |
Constructs a QSqlRelation object, where tableName is the SQL table name to which a foreign key refers, indexColumn is the foreign key, and displayColumn is the field that should be presented to the user. | |
void | swap (QSqlRelation &other) noexcept |
\memberswap{relation} | |
QString | tableName () const |
Returns the name of the table to which a foreign key refers. | |
QString | indexColumn () const |
Returns the index column from table tableName() to which a foreign key refers. | |
QString | displayColumn () const |
Returns the column from table tableName() that should be presented to the user instead of a foreign key. | |
bool | isValid () const noexcept |
Returns true if the QSqlRelation object is valid; otherwise returns false . |
\inmodule QtSql
The QSqlRelation class stores information about an SQL foreign key.
QSqlRelation is a helper class for QSqlRelationalTableModel. See QSqlRelationalTableModel::setRelation() and QSqlRelationalTableModel::relation() for details.
Definition at line 18 of file qsqlrelationaltablemodel.h.
|
inline |
Constructs an invalid QSqlRelation object.
For such an object, the tableName(), indexColumn(), and displayColumn() functions return an empty string.
Definition at line 21 of file qsqlrelationaltablemodel.h.
|
inline |
Constructs a QSqlRelation object, where tableName is the SQL table name to which a foreign key refers, indexColumn is the foreign key, and displayColumn is the field that should be presented to the user.
Definition at line 22 of file qsqlrelationaltablemodel.h.
|
inline |
Returns the column from table tableName() that should be presented to the user instead of a foreign key.
Definition at line 37 of file qsqlrelationaltablemodel.h.
|
inline |
Returns the index column from table tableName() to which a foreign key refers.
Definition at line 35 of file qsqlrelationaltablemodel.h.
|
inlinenoexcept |
Returns true
if the QSqlRelation object is valid; otherwise returns false
.
Definition at line 39 of file qsqlrelationaltablemodel.h.
|
inlinenoexcept |
\memberswap{relation}
Definition at line 26 of file qsqlrelationaltablemodel.h.
|
inline |
Returns the name of the table to which a foreign key refers.
Definition at line 33 of file qsqlrelationaltablemodel.h.