内容表

上一话题

QSqlRecord

下一话题

QSqlRelationalTableModel

QSqlRelation

QSqlRelation class stores information about an SQL foreign key. 更多

Inheritance diagram of PySide2.QtSql.QSqlRelation

概要

函数

详细描述

QSqlRelation is a helper class for QSqlRelationalTableModel 。见 setRelation() and relation() 了解细节。

另请参阅

QSqlRelationalTableModel QSqlRelationalDelegate Relational Table Model Example

class QSqlRelation

QSqlRelation(QSqlRelation)

QSqlRelation(aTableName, indexCol, displayCol)

param QSqlRelation

QSqlRelation

param aTableName

unicode

param indexCol

unicode

param displayCol

unicode

Constructs an invalid QSqlRelation 对象。

For such an object, the tableName() , indexColumn() ,和 displayColumn() functions return an empty string.

另请参阅

isValid()

构造 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.

PySide2.QtSql.QSqlRelation. displayColumn ( )
返回类型

unicode

Returns the column from table tableName() that should be presented to the user instead of a foreign key.

PySide2.QtSql.QSqlRelation. indexColumn ( )
返回类型

unicode

Returns the index column from table tableName() to which a foreign key refers.

PySide2.QtSql.QSqlRelation. isValid ( )
返回类型

bool

返回 true QSqlRelation object is valid; otherwise returns false .

PySide2.QtSql.QSqlRelation. swap ( other )
参数

other QSqlRelation

交换 this with other .

PySide2.QtSql.QSqlRelation. tableName ( )
返回类型

unicode

Returns the name of the table to which a foreign key refers.