- Qt 6.9
- Qt SQL
- C++ Classes
- QSqlRelation
- Qt 6.9.2 Reference Documentation

# QSqlRelation Class

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`

## Detailed Description

QSqlRelation is a helper class for QSqlRelationalTableModel. See QSqlRelationalTableModel::setRelation() and QSqlRelationalTableModel::relation() for details.

See also QSqlRelationalTableModel, QSqlRelationalDelegate, and Relational Table Model Example.