The QSqlRelation class stores information about an SQL foreign key. More...
Header: | #include <QSqlRelation> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Sql) target_link_libraries(mytarget PRIVATE Qt6::Sql) |
qmake: | QT += sql |
QSqlRelation(const QString &tableName, const QString &indexColumn, const QString &displayColumn) | |
QSqlRelation() | |
QString | displayColumn() const |
QString | indexColumn() const |
bool | isValid() const |
void | swap(QSqlRelation &other) |
QString | tableName() const |
QSqlRelation is a helper class for QSqlRelationalTableModel. See QSqlRelationalTableModel::setRelation() and QSqlRelationalTableModel::relation() for details.
See also QSqlRelationalTableModel, QSqlRelationalDelegate, and Relational Table Model Example.
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.
See also tableName(), indexColumn(), and displayColumn().
Constructs an invalid QSqlRelation object.
For such an object, the tableName(), indexColumn(), and displayColumn() functions return an empty string.
See also isValid().
Returns the column from table tableName() that should be presented to the user instead of a foreign key.
Returns the index column from table tableName() to which a foreign key refers.
Returns true
if the QSqlRelation object is valid; otherwise returns false
.
Swaps this
with other.
Returns the name of the table to which a foreign key refers.
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: