QSqlRelation Class
QSqlRelation 클래스는 SQL 외래 키에 대한 정보를 저장합니다. 더 보기...
| 헤더: | #include <QSqlRelation> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Sql) target_link_libraries(mytarget PRIVATE Qt6::Sql) |
| qmake: | QT += sql |
공개 함수
| 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 |
상세 설명
QSqlRelation은 QSqlRelationalTableModel 을 위한 보조 클래스입니다. 자세한 내용은 QSqlRelationalTableModel::setRelation() 및 QSqlRelationalTableModel::relation()을 참조하십시오.
QSqlRelationalTableModel, QSqlRelationalDelegate 및 관계형 테이블 모델 예제도참조하십시오 .
멤버 함수 설명서
QSqlRelation::QSqlRelation()
유효하지 않은 QSqlRelation 객체를 생성합니다.
이러한 객체의 경우, tableName(), indexColumn() 및 displayColumn() 함수는 빈 문자열을 반환합니다.
isValid()도 참조하십시오 .
QSqlRelation::QSqlRelation(const QString &tableName, const QString &indexColumn, const QString &displayColumn)
QSqlRelation 객체를 생성합니다. 여기서 tableName 는 외래 키가 참조하는 SQL 테이블 이름이고, indexColumn 는 외래 키이며, displayColumn 는 사용자에게 표시되어야 하는 필드입니다.
tableName(), indexColumn() 및 displayColumn()도 참조하십시오 .
QString QSqlRelation::displayColumn() const
tableName() 테이블에서 외래 키 대신 사용자에게 표시해야 할 열을 반환합니다.
QString QSqlRelation::indexColumn() const
tableName() 테이블에서 외래 키가 참조하는 인덱스 열을 반환합니다.
[noexcept] bool QSqlRelation::isValid() const
QSqlRelation 객체가 유효한 경우 true 를 반환하고, 그렇지 않은 경우 false 를 반환합니다.
[noexcept] void QSqlRelation::swap(QSqlRelation &other)
other 와 이 관계를 바꿉니다. 이 작업은 매우 빠르며 실패하는 일이 없습니다.
QString QSqlRelation::tableName() const
외래 키가 참조하는 테이블의 이름을 반환합니다.
© 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.