QSqlRelation Class
Die Klasse `QSqlRelation` speichert Informationen zu einem SQL-Fremdschlüssel. Mehr...
| Header: | #include <QSqlRelation> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Sql) target_link_libraries(mytarget PRIVATE Qt6::Sql) |
| qmake: | QT += sql |
Öffentliche Funktionen
| QSqlRelation() | |
| QSqlRelation(const QString &tableName, const QString &indexColumn, const QString &displayColumn) | |
| QString | displayColumn() const |
| QString | indexColumn() const |
| bool | isValid() const |
| void | swap(QSqlRelation &other) |
| QString | tableName() const |
Ausführliche Beschreibung
QSqlRelation ist eine Hilfsklasse für „ QSqlRelationalTableModel “. Weitere Informationen finden Sie unter „ QSqlRelationalTableModel::setRelation()“ und „ QSqlRelationalTableModel::relation()“.
Siehe auch „ QSqlRelationalTableModel “, „ QSqlRelationalDelegate “ und „Beispiel für ein relationales Tabellenmodell“.
Dokumentation zu den Member-Funktionen
QSqlRelation::QSqlRelation()
Erstellt ein ungültiges QSqlRelation-Objekt.
Für ein solches Objekt geben die Funktionen ` tableName()`, ` indexColumn()` und ` displayColumn()` eine leere Zeichenkette zurück.
Siehe auch isValid().
QSqlRelation::QSqlRelation(const QString &tableName, const QString &indexColumn, const QString &displayColumn)
Erstellt ein QSqlRelation-Objekt, wobei „ tableName “ der Name der SQL-Tabelle ist, auf die sich ein Fremdschlüssel bezieht, „ indexColumn “ der Fremdschlüssel ist und „ displayColumn “ das Feld ist, das dem Benutzer angezeigt werden soll.
Siehe auch tableName(), indexColumn() und displayColumn().
QString QSqlRelation::displayColumn() const
Gibt die Spalte aus der Tabelle „ tableName()“ zurück, die dem Benutzer anstelle eines Fremdschlüssels angezeigt werden soll.
QString QSqlRelation::indexColumn() const
Gibt die Indexspalte aus der Tabelle tableName() zurück, auf die ein Fremdschlüssel verweist.
[noexcept] bool QSqlRelation::isValid() const
Gibt „ true “ zurück, wenn das Objekt „ QSqlRelation “ gültig ist; andernfalls wird „ false “ zurückgegeben.
[noexcept] void QSqlRelation::swap(QSqlRelation &other)
Tauscht diese Beziehung mit „ other “ aus. Dieser Vorgang ist sehr schnell und schlägt niemals fehl.
QString QSqlRelation::tableName() const
Gibt den Namen der Tabelle zurück, auf die sich ein Fremdschlüssel bezieht.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.