QSqlRelationclass stores information about an SQL foreign key. 更多 …
def
displayColumn
()
def
indexColumn
()
def
isValid
()
def
swap
(other)
def
tableName
()
QSqlRelationis a helper class forQSqlRelationalTableModel。见setRelation()andrelation()了解细节。另请参阅
QSqlRelationalTableModelQSqlRelationalDelegateRelational Table Model Example
QSqlRelation
¶
QSqlRelation(QSqlRelation)
QSqlRelation(aTableName, indexCol, displayCol)
- param 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.
另请参阅
构造
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.